0% found this document useful (0 votes)
302 views2 pages

Erf, Erfc, Erfcx, Erfinv, Erfcinv (MATLAB Functions)

This document summarizes MATLAB functions for error functions including erf, erfc, erfcx, erfinv, and erfcinv. It defines each function, describes their usage, provides examples, and discusses the algorithms used to compute them. The key functions are erf for the error function, erfc for the complementary error function, and erfinv and erfcinv for their inverses. It also discusses their relationships to normal probability distributions.

Uploaded by

Dobre Ionut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
302 views2 pages

Erf, Erfc, Erfcx, Erfinv, Erfcinv (MATLAB Functions)

This document summarizes MATLAB functions for error functions including erf, erfc, erfcx, erfinv, and erfcinv. It defines each function, describes their usage, provides examples, and discusses the algorithms used to compute them. The key functions are erf for the error function, erfc for the complementary error function, and erfinv and erfcinv for their inverses. It also discusses their relationships to normal probability distributions.

Uploaded by

Dobre Ionut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

MATLAB Function Reference  

  

erf, erfc, erfcx, erfinv, erfcinv

Error functions

Syntax

Y = erf(X) Error function

Y = erfc(X) Complementary error function


Y = erfcx(X) Scaled complementary error function

X = erfinv(Y) Inverse error function

X = erfcinv(Y) Inverse complementary error function

Definition

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

Description
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. Elements of Y must be in the
interval [-1 1]. The function erfinv satisfies for and .

X = erfcinv(Y)
returns the value of the inverse of the complementary error function for each element of Y.
Elements of Y must be in the interval [0 2]. The function erfcinv satisfies for and
.
Remarks
The relationship between the complementary error function erfc and the standard normal probability distribution
returned by the Statistics Toolbox function normcdf is

The relationship between the inverse complementary error function erfcinv and the inverse standard normal
probability distribution returned by the Statistics Toolbox function norminv is

Examples
erfinv(1) is Inf

erfinv(-1) is -Inf.

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

Algorithms
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 one step of Halley's
method.

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

 eps   error 
 

You might also like