From fe0f92de13943ed8aa69e64b9484e5f638e18621 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 6 Mar 2024 15:41:24 +0000 Subject: [PATCH] Auto-generated commit --- .github/.keepalive | 1 - CONTRIBUTORS | 11 ++ README.md | 92 +++++++++++ benchmark/benchmark.native.js | 60 ++++++++ benchmark/c/native/Makefile | 146 ++++++++++++++++++ benchmark/c/native/benchmark.c | 136 +++++++++++++++++ binding.gyp | 170 +++++++++++++++++++++ examples/c/Makefile | 146 ++++++++++++++++++ examples/c/example.c | 31 ++++ include.gypi | 53 +++++++ include/stdlib/math/base/special/avercos.h | 38 +++++ lib/native.js | 58 +++++++ manifest.json | 72 +++++++++ package.json | 7 +- src/Makefile | 70 +++++++++ src/addon.c | 23 +++ src/main.c | 34 +++++ test/test.native.js | 126 +++++++++++++++ 18 files changed, 1272 insertions(+), 2 deletions(-) delete mode 100644 .github/.keepalive create mode 100644 benchmark/benchmark.native.js create mode 100644 benchmark/c/native/Makefile create mode 100644 benchmark/c/native/benchmark.c create mode 100644 binding.gyp create mode 100644 examples/c/Makefile create mode 100644 examples/c/example.c create mode 100644 include.gypi create mode 100644 include/stdlib/math/base/special/avercos.h create mode 100644 lib/native.js create mode 100644 manifest.json create mode 100644 src/Makefile create mode 100644 src/addon.c create mode 100644 src/main.c create mode 100644 test/test.native.js diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index cb99110..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-03-01T03:51:50.081Z diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6a1c080..d7b90d5 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2,10 +2,13 @@ # # Contributors listed in alphabetical order. +Adarsh Palaskar <83298237+adarshpalaskar1@users.noreply.github.com> Aditya Sapra <110766802+adityacodes30@users.noreply.github.com> AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com> Ali Salesi +Aman Bhansali <92033532+aman-095@users.noreply.github.com> Amit Jimiwal +Anudeep Sanapala <71971574+anudeeps0306@users.noreply.github.com> Athan Reines Brendan Graetz Bruno Fenzl @@ -28,6 +31,7 @@ Joris Labie Justin Dennison Karthik Prakash <116057817+skoriop@users.noreply.github.com> Khaldon +Lovelin <100030865+lovelindhoni@users.noreply.github.com> Marcus Fantham Matt Cochrane Mihir Pandit <129577900+MSP20086@users.noreply.github.com> @@ -36,22 +40,29 @@ Momtchil Momtchev Naresh Jagadeesan Nithin Katta <88046362+nithinkatta@users.noreply.github.com> Ognjen Jevremović +Oneday12323 <107678750+Oneday12323@users.noreply.github.com> Philipp Burckhardt Prajwal Kulkarni Pranav Goswami Praneki <97080887+PraneGIT@users.noreply.github.com> Pratik <97464067+Pratik772846@users.noreply.github.com> +Priyansh <88396544+itsspriyansh@users.noreply.github.com> +Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com> Ricky Reusser Robert Gislason Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Rutam <138517416+performant23@users.noreply.github.com> Ryan Seal +Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com> Seyyed Parsa Neshaei +Shashank Shekhar Singh <123410790+Shashankss1205@users.noreply.github.com> Shraddheya Shendre Shubham Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> Spandan Barve <114365550+marsian83@users.noreply.github.com> Stephannie Jiménez Gacha +Utkarsh <137638507+Ut-the-pro@users.noreply.github.com> Yernar Yergaziyev orimiles5 <97595296+orimiles5@users.noreply.github.com> rei2hu +utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> diff --git a/README.md b/README.md index 1a476cf..c70eca5 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,98 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/avercos.h" +``` + +#### stdlib_base_avercos( x ) + +Compute the [inverse versed cosine][inverse-versed-cosine] of a double-precision floating-point number (in radians). + +```c +double out = stdlib_base_avercos( -3.141592653589793/2.0 ); +// returns ~2.1783 +``` + +If `x < -2`, `x > 0`, or `x` is `NaN`, the function returns `NaN`. + +```c +double out = stdlib_base_avercos( -3.141592653589793 ); +// returns NaN +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_avercos( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/avercos.h" +#include + +int main( void ) { + const double x[] = { -2.5, -2.0, -1.5, -1.0, -0.5, 0.5, 1.0, 1.5, 2.0, 2.5 }; + + double v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_avercos( x[ i ] ); + printf( "avercos(%lf) = %lf\n", x[ i ], v ); + } +} +``` + +
+ + + +
+ + +