diff --git a/lib/node_modules/@stdlib/math/base/special/sech/README.md b/lib/node_modules/@stdlib/math/base/special/sech/README.md new file mode 100644 index 000000000000..9cf9fabac313 --- /dev/null +++ b/lib/node_modules/@stdlib/math/base/special/sech/README.md @@ -0,0 +1,184 @@ + + +# sech + +> Compute the [hyperbolic cosecant][hyperbolic-functions] of a double-precision floating-point number. + +
+ +## Usage + +```javascript +var sech = require( '@stdlib/math/base/special/sech' ); +``` + +#### sech( x ) + +Computes the [hyperbolic cosecant][hyperbolic-functions] of a double-precision floating-point number. + +```javascript +var v = sech( 0.0 ); +// returns 1.0 + +v = sech( 2.0 ); +// returns ~0.2658 + +v = sech( -2.0 ); +// returns ~0.2658 + +v = sech( NaN ); +// returns NaN +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var sech = require( '@stdlib/math/base/special/sech' ); + +var opts = { + 'dtype': 'float64' +}; +var x = uniform( 100, -5.0, 5.0, opts ); + +logEachMap( 'sech(%0.4f) = %0.4f', x, sech ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/sech.h" +``` + +#### stdlib_base_sech( x ) + +Computes the [hyperbolic cosecant][hyperbolic-functions] of double-precision floating-point number. + +```c +double out = stdlib_base_sech( 2.0 ); +// returns ~0.2658 + +out = stdlib_base_sech( -2.0 ); +// returns ~0.2658 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_sech( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/sech.h" +#include + +int main( void ) { + const double x[] = { -4.0, -3.11, -2.22, -1.33, -0.44, 0.44, 1.33, 2.22, 3.11, 4.0 }; + + double v; + int i; + for ( i = 0; i < 10; i++ ) { + v = stdlib_base_sech( x[ i ] ); + printf( "sech(%lf) = %lf\n", x[ i ], v ); + } +} +``` + +
+ + + +
+ + + + + +