erfcinv

Inverse complementary error function.

The inverse complementary error function is defined as

e r f c Superscript negative 1 Baseline left-parenthesis 1 minus z right-parenthesis equals e r f Superscript negative 1 Baseline left-parenthesis z right-parenthesis

where erf^{-1}(z) is the inverse error function.

Usage

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

erfcinv( x )

Evaluates the inverse complementary error function.

var y = erfcinv( 0.5 );
// returns ~0.4769

y = erfcinv( 0.8 );
// returns ~0.1791

y = erfcinv( 0.0 );
// returns Infinity

y = erfcinv( 2.0 );
// returns -Infinity

The domain of x is restricted to [0,2]. If x is outside this interval, the function returns NaN.

var y = erfcinv( -3.14 );
// returns NaN

If provided NaN, the function returns NaN.

var y = erfcinv( NaN );
// returns NaN

Examples

var linspace = require( '@stdlib/math/utils/linspace' );
var erfcinv = require( '@stdlib/math/base/special/erfcinv' );

var x = linspace( 0.0, 2.0, 100 );
var y;
var i;

for ( i = 0; i < x.length; i++ ) {
    y = erfcinv( x[ i ] );
    console.log( 'x: %d, erfcinv(x): %d', x[ i ], y );
}