erfcInverse

Evaluates the real inverse complementary error function \(erfc^{-1}(x)\).

Synopsis

erfcInverse (x)

Required Arguments

float x (Input)
Point at which the inverse complementary error function is to be evaluated. The argument x must be in the range 0 < x < 2.

Return Value

The value of the inverse complementary error function.

Description

The inverse complementary error function \(y=erfc^{-1}(x)\) is such that \(x = erfc(y)\) where

\[\mathrm{erfc}(y) = \frac{2}{\sqrt{\pi}} \int_y^{\infty} e^{-t^2} dt\]
../../_images/Fig9-4.png

Figure 9.11 — Plot of \(erfc^{-1}(x)\)

Example

Evaluate the inverse complementary error function at \(x=1/2\).

from __future__ import print_function
from numpy import *
from pyimsl.math.erfcInverse import erfcInverse

x = 0.5
ans = erfcInverse(x)
print("Inverse erfc(%f) = %f" % (x, ans))

Output

Inverse erfc(0.500000) = 0.476936

Alert Errors

IMSL_LARGE_ARG_UNDERFLOW

The argument x must not be so large that the result underflows. Very approximately, x should be less than

\(2-\sqrt{\varepsilon/(4 \pi)}\)

where ɛ is the machine precision.

Warning Errors

IMSL_LARGE_ARG_WARN \(|x|\) should be less than \(1/\sqrt{\varepsilon}\) where ɛ is the machine precision, to prevent the answer from being less accurate than half precision.

Fatal Errors

IMSL_ERF_ALGORITHM The algorithm failed to converge.
IMSL_SMALL_ARG_OVERFLOW The computation of \(e^{x^2} \text{erfc } x\) must not overflow.
IMSL_REAL_OUT_OF_RANGE The function is defined only for 0 < x < 2.