Skip to content

Latest commit

 

History

History
197 lines (121 loc) · 3.6 KB

File metadata and controls

197 lines (121 loc) · 3.6 KB

asinhf

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

Usage

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

asinhf( x )

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

var v = asinhf( 0.0 );
// returns 0.0

v = asinhf( -0.0 );
// returns -0.0

v = asinhf( 2.0 );
// returns ~1.444

v = asinhf( -2.0 );
// returns ~-1.444

v = asinhf( NaN );
// returns NaN

v = asinhf( -Infinity );
// returns -Infinity

v = asinhf( Infinity );
// returns Infinity

Examples

var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var asinhf = require( '@stdlib/math/base/special/asinhf' );

var opts = {
    'dtype': 'float32'
};
var x = uniform( 100, -5.0, 5.0, opts );

logEachMap( 'asinhf(%0.4f) = %0.4f', x, asinhf );

C APIs

Usage

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

stdlib_base_asinhf( x )

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

float out = stdlib_base_asinhf( 2.0f );
// returns ~1.444f

out = stdlib_base_asinhf( -2.0f );
// returns ~-1.444f

The function accepts the following arguments:

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

Examples

#include "stdlib/math/base/special/asinhf.h"
#include <stdlib.h>
#include <stdio.h>

int main( void ) {
    float x;
    float v;
    int i;

    for ( i = 0; i < 100; i++ ) {
        x = ( (float)rand() / (float)RAND_MAX ) * 100.0f;
        v = stdlib_base_asinhf( x );
        printf( "asinhf(%f) = %f\n", x, v );
    }
}