0.2.1 • Published 3 months ago
@stdlib/math-base-special-erfcx v0.2.1
erfcx
Scaled complementary error function.
The scaled complementary error function is defined as
For large values, the scaled complementary error function is approximately equal to
Installation
npm install @stdlib/math-base-special-erfcx
Usage
var erfcx = require( '@stdlib/math-base-special-erfcx' );
erfcx( x )
Evaluates the scaled complementary error function.
var y = erfcx( 0.0 );
// returns 1.0
y = erfcx( 1.0 );
// returns ~0.4276
y = erfcx( -1.0 );
// returns ~5.01
y = erfcx( 50.0 );
// returns ~0.011
y = erfcx( -50.0 );
// returns +Infinity
If provided NaN
, the function returns NaN
.
var y = erfcx( NaN );
// returns NaN
Examples
var linspace = require( '@stdlib/array-base-linspace' );
var erfcx = require( '@stdlib/math-base-special-erfcx' );
var x = linspace( -30.0, 30.0, 100 );
var i;
for ( i = 0; i < x.length; i++ ) {
console.log( 'x: %d, erfcx(x): %d', x[ i ], erfcx( x[ i ] ) );
}
See Also
@stdlib/math-base/special/erfc
: complementary error function.@stdlib/math-base/special/erfcinv
: inverse complementary error function.@stdlib/math-base/special/erf
: error function.@stdlib/math-base/special/erfinv
: inverse error function.
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
Copyright
Copyright © 2016-2024. The Stdlib Authors.