From d3a3f52cd414520a4f5c9c9bc855b6617908da5f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 18 Jun 2024 13:45:16 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 23 ++ base/special/vercos/README.md | 88 +++++++ .../vercos/benchmark/benchmark.native.js | 60 +++++ .../vercos/benchmark/c/native/Makefile | 146 ++++++++++++ .../vercos/benchmark/c/native/benchmark.c | 136 +++++++++++ base/special/vercos/binding.gyp | 170 +++++++++++++ base/special/vercos/examples/c/Makefile | 146 ++++++++++++ base/special/vercos/examples/c/example.c | 31 +++ base/special/vercos/include.gypi | 53 +++++ .../include/stdlib/math/base/special/vercos.h | 41 ++++ base/special/vercos/lib/native.js | 58 +++++ base/special/vercos/manifest.json | 72 ++++++ base/special/vercos/src/Makefile | 70 ++++++ base/special/vercos/src/addon.c | 22 ++ base/special/vercos/src/main.c | 34 +++ base/special/vercos/test/test.native.js | 225 ++++++++++++++++++ 16 files changed, 1375 insertions(+) create mode 100644 base/special/vercos/benchmark/benchmark.native.js create mode 100644 base/special/vercos/benchmark/c/native/Makefile create mode 100644 base/special/vercos/benchmark/c/native/benchmark.c create mode 100644 base/special/vercos/binding.gyp create mode 100644 base/special/vercos/examples/c/Makefile create mode 100644 base/special/vercos/examples/c/example.c create mode 100644 base/special/vercos/include.gypi create mode 100644 base/special/vercos/include/stdlib/math/base/special/vercos.h create mode 100644 base/special/vercos/lib/native.js create mode 100644 base/special/vercos/manifest.json create mode 100644 base/special/vercos/src/Makefile create mode 100644 base/special/vercos/src/addon.c create mode 100644 base/special/vercos/src/main.c create mode 100644 base/special/vercos/test/test.native.js diff --git a/CHANGELOG.md b/CHANGELOG.md index ba1f118c3..81d5f5164 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4282,6 +4282,28 @@ A total of 2 issues were closed in this release: +
+ +#### [@stdlib/math/base/special/vercos](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/vercos) + +
+ +
+ +##### Features + +- [`a4b2764`](https://github.com/stdlib-js/stdlib/commit/a4b276428bdc454a9412550375813f92bd242540) - add C implementation for `math/base/special/vercos` [(##2397)](#2397 ) + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/versin](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/versin) @@ -4666,6 +4688,7 @@ A total of 28 people contributed to this release. Thank you to the following con
+- [`a4b2764`](https://github.com/stdlib-js/stdlib/commit/a4b276428bdc454a9412550375813f92bd242540) - **feat:** add C implementation for `math/base/special/vercos` [(##2397)](#2397 ) _(by Gunj Joshi)_ - [`06f8b4a`](https://github.com/stdlib-js/stdlib/commit/06f8b4ad6fd804cd127387fa6a645cce0ee05250) - **feat:** add C implementation for `math/base/special/versin` [(##2398)](#2398 ) _(by Gunj Joshi)_ - [`c811882`](https://github.com/stdlib-js/stdlib/commit/c8118827f71ca602ccfea2721df03afbbd3857e5) - **feat:** add C implementation for `math/base/special/cosd` [(##2393)](#2393) _(by Gunj Joshi)_ - [`806075b`](https://github.com/stdlib-js/stdlib/commit/806075b124d1ab4fb7a541c117e0c7b6399a08b9) - **feat:** add C implementation for `math/base/special/hacoversin` [(##2387)](#2387) _(by Gunj Joshi)_ diff --git a/base/special/vercos/README.md b/base/special/vercos/README.md index c176a76ed..9eb8aee3f 100644 --- a/base/special/vercos/README.md +++ b/base/special/vercos/README.md @@ -93,6 +93,94 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/vercos.h" +``` + +#### stdlib_base_vercos( x ) + +Computes the [versed cosine][versed-cosine] of a `number` (in radians). + +```c +double out = stdlib_base_vercos( 0.0 ); +// returns 2.0 + +out = stdlib_base_vercos( 3.141592653589793 / 2.0 ); +// returns 1.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_vercos( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/vercos.h" +#include + +int main( void ) { + const double x[] = { 0.0, 0.523, 0.785, 1.047, 3.14 }; + + double y; + int i; + for ( i = 0; i < 5; i++ ) { + y = stdlib_base_vercos( x[ i ] ); + printf( "vercos(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +