Compute the hyperbolic cosecant of a number.
var csch = require( '@stdlib/math/base/special/csch' );
Computes the hyperbolic cosecant of x
.
var v = csch( 0.0 );
// returns Infinity
v = csch( 2.0 );
// returns ~0.2757
v = csch( -2.0 );
// returns ~-0.2757
v = csch( NaN );
// returns NaN
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var csch = require( '@stdlib/math/base/special/csch' );
var opts = {
'dtype': 'float64'
};
var x = uniform( 100, -5.0, 5.0, opts );
logEachMap( 'csch( %0.4f ) = %0.4f', x, csch );
#include "stdlib/math/base/special/csch.h"
Computes the hyperbolic cosecant of double-precision floating-point number x
.
double out = stdlib_base_csch( 2.0 );
// returns ~0.2757
out = stdlib_base_csch( -2.0 );
// returns ~-0.2757
The function accepts the following arguments:
- x:
[in] double
input value.
double stdlib_base_csch( const double x );
#include "stdlib/math/base/special/csch.h"
#include <stdio.h>
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_csch( x[ i ] );
printf( "csch(%lf) = %lf\n", x[ i ], v );
}
}
@stdlib/math/base/special/acsch
: compute the hyperbolic arccosecant of a number.@stdlib/math/base/special/csc
: compute the cosecant of a number.@stdlib/math/base/special/coth
: compute the hyperbolic cotangent of a number.@stdlib/math/base/special/sinh
: compute the hyperbolic sine of a double-precision floating-point number.