Compute the hyperbolic arccosecant of a single-precision floating-point number.
var acschf = require( '@stdlib/math/base/special/acschf' );Computes the hyperbolic arccosecant of x.
var v = acschf( 0.0 );
// returns Infinity
v = acschf( -0.0 );
// returns -Infinity
v = acschf( 1.0 );
// returns ~0.881
v = acschf( -1.0 );
// returns ~-0.881
v = acschf( NaN );
// returns NaN
v = acschf( -Infinity );
// returns -0.0
v = acschf( Infinity );
// returns 0.0var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var acschf = require( '@stdlib/math/base/special/acschf' );
var x = uniform( 100, 1.0, 5.0, {
'dtype': 'float32'
});
logEachMap( 'acschf(%0.4f) = %0.4f', x, acschf );#include "stdlib/math/base/special/acschf.h"Computes the hyperbolic arccosecant of a single-precision floating-point number.
float out = stdlib_base_acschf( 1.0f );
// returns ~0.881The function accepts the following arguments:
- x:
[in] floatinput value.
float stdlib_base_acschf( const float x );#include "stdlib/math/base/special/acschf.h"
#include <stdio.h>
int main( void ) {
const float x[] = { -5.0f, -3.89f, -2.78f, -1.67f, -0.55f, 0.55f, 1.67f, 2.78f, 3.89f, 5.0f };
float v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_acschf( x[ i ] );
printf( "acschf(%f) = %f\n", x[ i ], v );
}
}