MATLAB Function Reference    
erf, erfc, erfcx, erfinv

Error functions

表示

定義

The error function erf(X) is twice the integral of the Gaussian distribution with 0 mean and variance of :

The complementary error function erfc(X) is defined as:

The scaled complementary error function erfcx(X) is defined as:

For large X, erfcx(X) is approximately

.

詳細

Y = erf(X) returns the value of the error function for each element of real array X.

Y = erfc(X) computes the value of the complementary error function.

Y = erfcx(X) computes the value of the scaled complementary error function.

X = erfinv(Y) returns the value of the inverse error function for each element of Y. The elements of Y must fall within the domain

例題

erfinv(1) is Inf

erfinv(-1) is -Inf.

For abs(Y) > 1, erfinv(Y) is NaN.

注意

The relationship between the error function and the standard normal probability distribution is:

アルゴリズム

For the error functions, the MATLAB code is a translation of a Fortran program by W. J. Cody, Argonne National Laboratory, NETLIB/SPECFUN, March 19, 1990. The main computation evaluates near-minimax rational approximations from [1].

For the inverse of the error function, rational approximations accurate to approximately six significant digits are used to generate an initial approximation, which is then improved to full accuracy by two steps of Newton's method. The M-file is easily modified to eliminate the Newton improvement. The resulting code is about three times faster in execution, but is considerably less accurate.

参考文献

[1] Cody, W. J., "Rational Chebyshev Approximations for the Error Function," Math. Comp., pgs. 631-638, 1969


 eps error