naginterfaces.library.specfun.erfcx_​real

naginterfaces.library.specfun.erfcx_real(x)[source]

erfcx_real returns the value of the scaled complementary error function .

For full information please refer to the NAG Library document for s15ag

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/s/s15agf.html

Parameters
xfloat

The argument of the function.

Returns
ecxfloat

The value of the scaled complementary error function .

Warns
NagAlgorithmicWarning
(errno )

On entry, and the constant .

Constraint: .

(errno )

On entry, was in the interval where is approximately : .

(errno )

On entry, and the constant .

Constraint: .

Notes

erfcx_real calculates an approximate value for the scaled complementary error function

Let be the root of the equation (then ). For the value of is based on the following rational Chebyshev expansion for :

where denotes a rational function of degree in the numerator and in the denominator.

For the value of is based on a rational Chebyshev expansion for : for the value is based on the expansion

and for it is based on the expansion

For each expansion, the specific values of and are selected to be minimal such that the maximum relative error in the expansion is of the order , where is the maximum number of decimal digits that can be accurately represented for the particular implementation (see machine.decimal_digits).

Asymptotically, . There is a danger of setting underflow in whenever , where is the largest positive model number (see machine.real_largest) and is the smallest positive model number (see machine.real_smallest). In this case erfcx_real exits with = 1 and returns . For in the range , where is the machine precision, the asymptotic value is returned for and erfcx_real exits with = 2.

There is a danger of setting overflow in whenever . In this case erfcx_real exits with = 3 and returns .

References

NIST Digital Library of Mathematical Functions

Cody, W J, 1969, Rational Chebyshev approximations for the error function, Math.Comp. (23), 631–637