diff --git a/lib/node_modules/@stdlib/math/base/special/cospi/README.md b/lib/node_modules/@stdlib/math/base/special/cospi/README.md index 60e3aeb62f98..ee4799f30f52 100644 --- a/lib/node_modules/@stdlib/math/base/special/cospi/README.md +++ b/lib/node_modules/@stdlib/math/base/special/cospi/README.md @@ -74,6 +74,91 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/cospi.h" +``` + +#### stdlib_base_cospi( x ) + +Computes `cos(πx)` more accurately than `cos(pi*x)`, especially for large `x`. + +```c +double out = stdlib_base_cospi( 0.5 ); +// returns 0.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_cospi( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/cospi.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_cospi( x[ i ] ); + printf( "cospi(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +