Skip to content

Latest commit

 

History

History
190 lines (115 loc) · 3.68 KB

File metadata and controls

190 lines (115 loc) · 3.68 KB

acothf

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

Usage

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

acothf( x )

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

var v = acothf( 2.0 );
// returns ~0.5493

v = acothf( 1.0 );
// returns Infinity

The domain of the inverse hyperbolic cotangent is the union of the intervals (-inf,-1] and [1,inf). If provided a value on the open interval (-1,1), the function returns NaN.

var v = acothf( 0.0 );
// returns NaN

v = acothf( 0.5 );
// returns NaN

Examples

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

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

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

C APIs

Usage

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

stdlib_base_acothf( x )

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

float out = stdlib_base_acothf( 2.0f );
// returns ~0.5493f

The function accepts the following arguments:

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

Examples

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

int main( void ) {
    const float x[] = { 1.0f, 1.44f, 1.89f, 2.33f, 2.78f, 3.22f, 3.67f, 4.11f, 4.56f, 5.0f };

    float v;
    int i;
    for ( i = 0; i < 10; i++ ) {
        v = stdlib_base_acothf( x[ i ] );
        printf( "acothf(%f) = %f\n", x[ i ], v );
    }
}

See Also