From 2d494ed5bb749a5ae4d2eeb28475e06fcbbd3813 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 9 Mar 2024 04:20:03 +0000 Subject: [PATCH] Auto-generated commit --- CONTRIBUTORS | 1 + base/special/asec/README.md | 85 ++++++ .../asec/benchmark/benchmark.native.js | 60 ++++ base/special/asec/benchmark/c/Makefile | 126 ++++++++ base/special/asec/benchmark/c/native/Makefile | 146 +++++++++ .../asec/benchmark/c/native/benchmark.c | 136 +++++++++ base/special/asec/binding.gyp | 170 +++++++++++ base/special/asec/examples/c/Makefile | 146 +++++++++ base/special/asec/examples/c/example.c | 31 ++ base/special/asec/include.gypi | 53 ++++ .../include/stdlib/math/base/special/asec.h | 38 +++ base/special/asec/lib/native.js | 54 ++++ base/special/asec/manifest.json | 72 +++++ base/special/asec/src/Makefile | 70 +++++ base/special/asec/src/addon.c | 23 ++ base/special/asec/src/main.c | 34 +++ base/special/asec/test/test.native.js | 276 ++++++++++++++++++ 17 files changed, 1521 insertions(+) create mode 100644 base/special/asec/benchmark/benchmark.native.js create mode 100644 base/special/asec/benchmark/c/Makefile create mode 100644 base/special/asec/benchmark/c/native/Makefile create mode 100644 base/special/asec/benchmark/c/native/benchmark.c create mode 100644 base/special/asec/binding.gyp create mode 100644 base/special/asec/examples/c/Makefile create mode 100644 base/special/asec/examples/c/example.c create mode 100644 base/special/asec/include.gypi create mode 100644 base/special/asec/include/stdlib/math/base/special/asec.h create mode 100644 base/special/asec/lib/native.js create mode 100644 base/special/asec/manifest.json create mode 100644 base/special/asec/src/Makefile create mode 100644 base/special/asec/src/addon.c create mode 100644 base/special/asec/src/main.c create mode 100644 base/special/asec/test/test.native.js diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 68cca7700..0ad498e65 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -34,6 +34,7 @@ Justin Dennison Karthik Prakash <116057817+skoriop@users.noreply.github.com> Khaldon Lovelin <100030865+lovelindhoni@users.noreply.github.com> +Manik Sharma Marcus Fantham Matt Cochrane Mihir Pandit <129577900+MSP20086@users.noreply.github.com> diff --git a/base/special/asec/README.md b/base/special/asec/README.md index b0998693b..0dbbf0399 100644 --- a/base/special/asec/README.md +++ b/base/special/asec/README.md @@ -81,6 +81,91 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/asec.h" +``` + +#### stdlib_base_asec( x ) + +Computes the [inverse (arc) secant][arcsecant] of `x`. + +```c +double out = stdlib_base_asec( 2.0 ); +// returns ~1.0472 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_asec( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/asec.h" +#include + +int main( void ) { + const double x[] = { -5.0, -3.89, -2.78, -1.67, -0.56, 0.56, 1.67, 2.78, 3.89, 5.0 }; + + double v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_asec( x[ i ] ); + printf( "asec(%lf) = %lf\n", x[ i ], v ); + } +} +``` + +
+ + + +
+ + +