0.0.1 • Published 29 days ago

@stdlib/math-base-special-rcbrtf v0.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
29 days ago

rcbrtf

NPM version Build Status Coverage Status

Compute the reciprocal of the principal cube root of a single-precision floating-point number.

The reciprocal of the principal cube root is defined as

Installation

npm install @stdlib/math-base-special-rcbrtf

Usage

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

rcbrtf( x )

Computes the reciprocal cube root of a single-precision floating-point number.

var v = rcbrtf( 1.0 );
// returns 1.0

v = rcbrtf( 8.0 );
// returns 0.5

v = rcbrtf( 1000.0 );
// returns ~0.1

v = rcbrtf( 0.0 );
// returns Infinity

v = rcbrtf( NaN );
// returns NaN

v = rcbrtf( Infinity );
// returns 0.0

Examples

var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
var rcbrtf = require( '@stdlib/math-base-special-rcbrtf' );

var x;
var i;
for ( i = 0; i < 100; i++ ) {
    x = discreteUniform( 0.0, 100.0 );
    console.log( 'rcbrtf(%d) = %d', x, rcbrtf( x ) );
}

C APIs

Usage

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

stdlib_base_rcbrtf( x )

Computes the reciprocal cube root of a single-precision floating-point number.

float y = stdlib_base_rcbrtf( 8.0f );
// returns 0.5f

The function accepts the following arguments:

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

Examples

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

int main( void ) {
    const float x[] = { 3.14f, 9.0f, 0.0f, 0.0f / 0.0f };

    float y;
    int i;
    for ( i = 0; i < 4; i++ ) {
        y = stdlib_base_rcbrtf( x[ i ] );
        printf( "rcbrt(%f) = %f\n", x[ i ], y );
    }
}

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.