From fb1a764f2802a10524fab8cd17d0a102e2c61561 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 20 Jun 2024 12:58:39 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 23 ++ base/special/havercos/README.md | 88 +++++++ .../havercos/benchmark/benchmark.native.js | 60 +++++ .../havercos/benchmark/c/native/Makefile | 146 ++++++++++++ .../havercos/benchmark/c/native/benchmark.c | 136 +++++++++++ base/special/havercos/binding.gyp | 170 +++++++++++++ base/special/havercos/examples/c/Makefile | 146 ++++++++++++ base/special/havercos/examples/c/example.c | 31 +++ base/special/havercos/include.gypi | 53 +++++ .../stdlib/math/base/special/havercos.h | 41 ++++ base/special/havercos/lib/native.js | 58 +++++ base/special/havercos/manifest.json | 72 ++++++ base/special/havercos/src/Makefile | 70 ++++++ base/special/havercos/src/addon.c | 22 ++ base/special/havercos/src/main.c | 34 +++ base/special/havercos/test/test.native.js | 225 ++++++++++++++++++ 16 files changed, 1375 insertions(+) create mode 100644 base/special/havercos/benchmark/benchmark.native.js create mode 100644 base/special/havercos/benchmark/c/native/Makefile create mode 100644 base/special/havercos/benchmark/c/native/benchmark.c create mode 100644 base/special/havercos/binding.gyp create mode 100644 base/special/havercos/examples/c/Makefile create mode 100644 base/special/havercos/examples/c/example.c create mode 100644 base/special/havercos/include.gypi create mode 100644 base/special/havercos/include/stdlib/math/base/special/havercos.h create mode 100644 base/special/havercos/lib/native.js create mode 100644 base/special/havercos/manifest.json create mode 100644 base/special/havercos/src/Makefile create mode 100644 base/special/havercos/src/addon.c create mode 100644 base/special/havercos/src/main.c create mode 100644 base/special/havercos/test/test.native.js diff --git a/CHANGELOG.md b/CHANGELOG.md index a7d11c62a..1cd8f8e4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3272,6 +3272,28 @@ This release closes the following issue: +
+ +#### [@stdlib/math/base/special/havercos](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/havercos) + +
+ +
+ +##### Features + +- [`d0f9748`](https://github.com/stdlib-js/stdlib/commit/d0f97483ab6edaf668b7693dd7b96d527823f14b) - add C implementation for `math/base/special/havercos` [(##2410)](#2410 ) + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/kernel-cos](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/kernel-cos) @@ -4767,6 +4789,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`d0f9748`](https://github.com/stdlib-js/stdlib/commit/d0f97483ab6edaf668b7693dd7b96d527823f14b) - **feat:** add C implementation for `math/base/special/havercos` [(##2410)](#2410 ) _(by Gunj Joshi)_ - [`cb7d879`](https://github.com/stdlib-js/stdlib/commit/cb7d8790c02f7ce9df7d5c22e662d74ad9b95cd9) - **feat:** add C implementation for `math/base/special/tand` [(##2411)](#2411 ) _(by Gunj Joshi)_ - [`7ddca8e`](https://github.com/stdlib-js/stdlib/commit/7ddca8e7270b9d325d8047524a62381fb56dfc5e) - **feat:** add C implementation for `math/base/special/erfinv` _(by Pranav Goswami, Philipp Burckhardt)_ - [`4a0235a`](https://github.com/stdlib-js/stdlib/commit/4a0235a063e46d679253b6511fe7e9dbd4a9d625) - **feat:** add C implementation for `math/base/special/pow` _(by Aman Bhansali, Athan, Philipp Burckhardt)_ diff --git a/base/special/havercos/README.md b/base/special/havercos/README.md index c4c669e95..e5415d716 100644 --- a/base/special/havercos/README.md +++ b/base/special/havercos/README.md @@ -93,6 +93,94 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/havercos.h" +``` + +#### stdlib_base_havercos( x ) + +Computes the half-value [versed cosine][versed-cosine] (in radians). + +```c +double out = stdlib_base_havercos( 0.0 ); +// returns 1.0 + +out = stdlib_base_havercos( 3.141592653589793 / 2.0 ); +// returns 0.5 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_havercos( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/havercos.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_havercos( x[ i ] ); + printf( "havercos(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +