Compute the reciprocal of the principal cube root of a double-precision floating-point number.
The reciprocal of the principal cube root is defined as
var rcbrt = require( '@stdlib/math/base/special/rcbrt' );Computes the reciprocal (inverse) cube root of a double-precision floating-point number.
var v = rcbrt( 1.0 );
// returns 1.0
v = rcbrt( 8.0 );
// returns 0.5
v = rcbrt( 1000.0 );
// returns 0.1
v = rcbrt( 0.0 );
// returns Infinity
v = rcbrt( NaN );
// returns NaN
v = rcbrt( Infinity );
// returns 0.0var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var rcbrt = require( '@stdlib/math/base/special/rcbrt' );
var opts = {
'dtype': 'float64'
};
var x = discreteUniform( 100, 0, 100, opts );
logEachMap( 'rcbrt(%d) = %0.4f', x, rcbrt );#include "stdlib/math/base/special/rcbrt.h"Computes the reciprocal (inverse) cube root of a double-precision floating-point number.
double y = stdlib_base_rcbrt( 8.0 );
// returns 0.5The function accepts the following arguments:
- x:
[in] doubleinput value.
double stdlib_base_rcbrt( const double x );#include "stdlib/math/base/special/rcbrt.h"
#include <stdio.h>
int main( void ) {
const double x[] = { 3.14, 9.0, 0.0, 0.0/0.0 };
double y;
int i;
for ( i = 0; i < 4; i++ ) {
y = stdlib_base_rcbrt( x[ i ] );
printf( "rcbrt(%lf) = %lf\n", x[ i ], y );
}
}@stdlib/math/base/special/cbrt: compute the cube root of a double-precision floating-point number.