Skip to content

Latest commit

 

History

History
191 lines (116 loc) · 3.56 KB

File metadata and controls

191 lines (116 loc) · 3.56 KB

acschf

Compute the hyperbolic arccosecant of a single-precision floating-point number.

Usage

var acschf = require( '@stdlib/math/base/special/acschf' );

acschf( x )

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.0

Examples

var 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 );

C APIs

Usage

#include "stdlib/math/base/special/acschf.h"

stdlib_base_acschf( x )

Computes the hyperbolic arccosecant of a single-precision floating-point number.

float out = stdlib_base_acschf( 1.0f );
// returns ~0.881

The function accepts the following arguments:

  • x: [in] float input value.
float stdlib_base_acschf( const float x );

Examples

#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 );
    }
}