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 ); + } +} +``` + +
+ + + +
+ + +