Compute the hyperbolic arccosine of a single-precision floating-point number.
var acoshf = require( '@stdlib/math/base/special/fast/acoshf' );Computes the hyperbolic arccosine of a single-precision floating-point number (in radians).
var v = acoshf( 1.0 );
// returns 0.0
v = acoshf( 2.0 );
// returns ~1.317
v = acoshf( 0.5 );
// returns NaNThe domain of x is restricted to [1,+infinity). If x < 1, the function will return NaN.
var v = acoshf( 0.0 );
// returns NaN-
For large
x, the function will overflow.var v = acoshf( 1.0e308 ); // returns Infinity // (expected 709.889355822726)
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var acoshf = require( '@stdlib/math/base/special/fast/acoshf' );
var opts = {
'dtype': 'float32'
};
var x = uniform( 103, 1.0, 5.0, opts );
logEachMap( 'acoshf(%0.4f) = %0.4f', x, acoshf );#include "stdlib/math/base/special/fast/acoshf.h"Computes the hyperbolic arccosine of a single-precision floating-point number.
float out = stdlib_base_fast_acoshf( 1.0f );
// returns 0.0
out = stdlib_base_fast_acoshf( 2.0f );
// returns ~1.317The function accepts the following arguments:
- x:
[in] floatinput value.
float stdlib_base_fast_acoshf( const float x );#include "stdlib/math/base/special/fast/acoshf.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_fast_acoshf( x );
printf( "acoshf(%f) = %f\n", x, v );
}
}