Error function: Difference between revisions
Making formulas look neater. |
(No difference)
|
Latest revision as of 05:04, 1 March 2025
Template:Short description Template:Use dmy dates Template:Distinguish In mathematics, the error function (also called the Gauss error function), often denoted by Template:Math, is a function defined as:[1] Template:Infobox mathematical function
The integral here is a complex contour integral which is path-independent because is holomorphic on the whole complex plane . In many applications, the function argument is a real number, in which case the function value is also real.
In some old texts,[2] the error function is defined without the factor of . This nonelementary integral is a sigmoid function that occurs often in probability, statistics, and partial differential equations.
In statistics, for non-negative real values of Template:Mvar, the error function has the following interpretation: for a real random variable Template:Mvar that is normally distributed with mean 0 and standard deviation , Template:Math is the probability that Template:Mvar falls in the range Template:Closed-closed.
Two closely related functions are the complementary error function is defined as
and the imaginary error function is defined as
where Template:Mvar is the imaginary unit.
Name
The name "error function" and its abbreviation Template:Math were proposed by J. W. L. Glaisher in 1871 on account of its connection with "the theory of Probability, and notably the theory of Errors."[3] The error function complement was also discussed by Glaisher in a separate publication in the same year.[4] For the "law of facility" of errors whose density is given by (the normal distribution), Glaisher calculates the probability of an error lying between Template:Mvar and Template:Mvar as:

Applications
When the results of a series of measurements are described by a normal distribution with standard deviation Template:Mvar and expected value 0, then is the probability that the error of a single measurement lies between Template:Math and Template:Math, for positive Template:Mvar. This is useful, for example, in determining the bit error rate of a digital communication system.
The error and complementary error functions occur, for example, in solutions of the heat equation when boundary conditions are given by the Heaviside step function.
The error function and its approximations can be used to estimate results that hold with high probability or with low probability. Given a random variable Template:Math (a normal distribution with mean Template:Mvar and standard deviation Template:Mvar) and a constant Template:Math, it can be shown via integration by substitution:
where Template:Mvar and Template:Mvar are certain numeric constants. If Template:Mvar is sufficiently far from the mean, specifically Template:Math, then:
so the probability goes to 0 as Template:Math.
The probability for Template:Mvar being in the interval Template:Closed-closed can be derived as
Properties
The property Template:Math means that the error function is an odd function. This directly results from the fact that the integrand Template:Math is an even function (the antiderivative of an even function which is zero at the origin is an odd function and vice versa).
Since the error function is an entire function which takes real numbers to real numbers, for any complex number Template:Mvar: where Template:Math is the complex conjugate of z.
The integrand and Template:Math are shown in the complex Template:Mvar-plane in the figures at right with domain coloring.
The error function at Template:Math is exactly 1 (see Gaussian integral). At the real axis, Template:Math approaches unity at Template:Math and −1 at Template:Math. At the imaginary axis, it tends to Template:Math.
Taylor series
The error function is an entire function; it has no singularities (except that at infinity) and its Taylor expansion always converges. For Template:Math, however, cancellation of leading terms makes the Taylor expansion unpractical.
The defining integral cannot be evaluated in closed form in terms of elementary functions (see Liouville's theorem), but by expanding the integrand Template:Math into its Maclaurin series and integrating term by term, one obtains the error function's Maclaurin series as: which holds for every complex number Template:Mvar. The denominator terms are sequence A007680 in the OEIS.
For iterative calculation of the above series, the following alternative formulation may be useful: because Template:Math expresses the multiplier to turn the Template:Mvarth term into the Template:Mathth term (considering Template:Mvar as the first term).
The imaginary error function has a very similar Maclaurin series, which is: which holds for every complex number Template:Mvar.
Derivative and integral
The derivative of the error function follows immediately from its definition: From this, the derivative of the imaginary error function is also immediate: An antiderivative of the error function, obtainable by integration by parts, is An antiderivative of the imaginary error function, also obtainable by integration by parts, is Higher order derivatives are given by where Template:Mvar are the physicists' Hermite polynomials.[5]
Bürmann series
An expansion,[6] which converges more rapidly for all real values of Template:Mvar than a Taylor expansion, is obtained by using Hans Heinrich Bürmann's theorem:[7] where Template:Math is the sign function. By keeping only the first two coefficients and choosing Template:Math and Template:Math, the resulting approximation shows its largest relative error at Template:Math, where it is less than 0.0034361:
Inverse functions

Given a complex number Template:Mvar, there is not a unique complex number Template:Mvar satisfying Template:Math, so a true inverse function would be multivalued. However, for Template:Math, there is a unique real number denoted Template:Math satisfying
The inverse error function is usually defined with domain Template:Open-open, and it is restricted to this domain in many computer algebra systems. However, it can be extended to the disk Template:Math of the complex plane, using the Maclaurin series[8] where Template:Math and
So we have the series expansion (common factors have been canceled from numerators and denominators): (After cancellation the numerator and denominator values in Template:Oeis and Template:Oeis respectively; without cancellation the numerator terms are values in Template:Oeis.) The error function's value at Template:Math is equal to Template:Math.
For Template:Math, we have .
The inverse complementary error function is defined as For real Template:Mvar, there is a unique real number Template:Math satisfying . The inverse imaginary error function is defined as Template:Math.[9]
For any real x, Newton's method can be used to compute Template:Math, and for Template:Math, the following Maclaurin series converges: where Template:Math is defined as above.
Asymptotic expansion
A useful asymptotic expansion of the complementary error function (and therefore also of the error function) for large real Template:Mvar is where Template:Math is the double factorial of Template:Math, which is the product of all odd numbers up to Template:Math. This series diverges for every finite Template:Mvar, and its meaning as asymptotic expansion is that for any integer Template:Math one has where the remainder is which follows easily by induction, writing and integrating by parts.
The asymptotic behavior of the remainder term, in Landau notation, is as Template:Math. This can be found by For large enough values of Template:Mvar, only the first few terms of this asymptotic expansion are needed to obtain a good approximation of Template:Math (while for not too large values of Template:Mvar, the above Taylor expansion at 0 provides a very fast convergence).
Continued fraction expansion
A continued fraction expansion of the complementary error function was found by Laplace:[10][11]
Factorial series
The inverse factorial series: converges for . Here Template:Math denotes the rising factorial, and Template:Math denotes a signed Stirling number of the first kind.[12][13] There also exists a representation by an infinite sum containing the double factorial:
Numerical approximations
Approximation with elementary functions
- Abramowitz and Stegun give several approximations of varying accuracy (equations 7.1.25–28). This allows one to choose the fastest approximation suitable for a given application. In order of increasing accuracy, they are: (maximum error: Template:Val) Template:Pb where Template:Math, Template:Math, Template:Math, Template:Math (maximum error: Template:Val) Template:Pb where Template:Math, Template:Math, Template:Math, Template:Math (maximum error: Template:Val) Template:Pb where Template:Math, Template:Math, Template:Math, Template:Math, Template:Math, Template:Math (maximum error: Template:Val) Template:Pb where Template:Math, Template:Math, Template:Math, Template:Math, Template:Math, Template:Math Template:Pb All of these approximations are valid for Template:Math. To use these approximations for negative Template:Mvar, use the fact that Template:Math is an odd function, so Template:Math.
- Exponential bounds and a pure exponential approximation for the complementary error function are given by[14]
- The above have been generalized to sums of Template:Mvar exponentials[15] with increasing accuracy in terms of Template:Mvar so that Template:Math can be accurately approximated or bounded by Template:Math, where In particular, there is a systematic methodology to solve the numerical coefficients Template:Math that yield a minimax approximation or bound for the closely related Q-function: Template:Math, Template:Math, or Template:Math for Template:Math. The coefficients Template:Math for many variations of the exponential approximations and bounds up to Template:Math have been released to open access as a comprehensive dataset.[16]
- A tight approximation of the complementary error function for Template:Math is given by Karagiannidis & Lioumpas (2007)[17] who showed for the appropriate choice of parameters Template:Math that They determined Template:Math, which gave a good approximation for all Template:Math. Alternative coefficients are also available for tailoring accuracy for a specific application or transforming the expression into a tight bound.[18]
- A single-term lower bound is[19] where the parameter Template:Mvar can be picked to minimize error on the desired interval of approximation.
- Another approximation is given by Sergei Winitzki using his "global Padé approximations":[20][21]Template:Rp where This is designed to be very accurate in a neighborhood of 0 and a neighborhood of infinity, and the relative error is less than 0.00035 for all real Template:Mvar. Using the alternate value Template:Math reduces the maximum relative error to about 0.00013.[22] Template:Pb This approximation can be inverted to obtain an approximation for the inverse error function:
- An approximation with a maximal error of Template:Val for any real argument is:[23] with and
- An approximation of with a maximum relative error less than in absolute value is:[24] for Template:Nowrap and for
- A simple approximation for real-valued arguments could be done through Hyperbolic functions: which keeps the absolute difference Template:Nowrap
Table of values
Related functions
Complementary error function
The complementary error function, denoted Template:Math, is defined as

which also defines Template:Math, the scaled complementary error function[25] (which can be used instead of Template:Math to avoid arithmetic underflow[25][26]). Another form of Template:Math for Template:Math is known as Craig's formula, after its discoverer:[27] This expression is valid only for positive values of Template:Mvar, but it can be used in conjunction with Template:Math to obtain Template:Math for negative values. This form is advantageous in that the range of integration is fixed and finite. An extension of this expression for the Template:Math of the sum of two non-negative variables is as follows:[28]
Imaginary error function
The imaginary error function, denoted Template:Math, is defined as

where Template:Math is the Dawson function (which can be used instead of Template:Math to avoid arithmetic overflow[25]).
Despite the name "imaginary error function", Template:Math is real when Template:Mvar is real.
When the error function is evaluated for arbitrary complex arguments Template:Mvar, the resulting complex error function is usually discussed in scaled form as the Faddeeva function:
Cumulative distribution function
The error function is essentially identical to the standard normal cumulative distribution function, denoted Template:Math, also named Template:Math by some software languagesTemplate:Citation needed, as they differ only by scaling and translation. Indeed,

or rearranged for Template:Math and Template:Math:
Consequently, the error function is also closely related to the Q-function, which is the tail probability of the standard normal distribution. The Q-function can be expressed in terms of the error function as
The inverse of Template:Math is known as the normal quantile function, or probit function and may be expressed in terms of the inverse error function as
The standard normal cdf is used more often in probability and statistics, and the error function is used more often in other branches of mathematics.
The error function is a special case of the Mittag-Leffler function, and can also be expressed as a confluent hypergeometric function (Kummer's function):
It has a simple expression in terms of the Fresnel integral.Template:Elucidate
In terms of the regularized gamma function Template:Mvar and the incomplete gamma function, Template:Math is the sign function.
Iterated integrals of the complementary error function
The iterated integrals of the complementary error function are defined by[29]
The general recurrence formula is
They have the power series from which follow the symmetry properties and
Implementations
As real function of a real argument
- In POSIX-compliant operating systems, the header
math.hshall declare and the mathematical librarylibmshall provide the functionserfanderfc(double precision) as well as their single precision and extended precision counterpartserff,erflanderfcf,erfcl.[30] - The GNU Scientific Library provides
erf,erfc,log(erf), and scaled error functions.[31]
As complex function of a complex argument
libcerf, numeric C library for complex error functions, provides the complex functionscerf,cerfc,cerfcxand the real functionserfi,erfcxwith approximately 13–14 digits precision, based on the Faddeeva function as implemented in the MIT Faddeeva Package
References
Further reading
External links
Template:Nonelementary Integral Template:Authority control
- ↑ Template:Cite book
- ↑ Template:Cite book
- ↑ Template:Cite journal
- ↑ Template:Cite journal
- ↑ Template:Mathworld
- ↑ Template:Cite journal
- ↑ Template:Mathworld
- ↑ Template:Cite arXiv
- ↑ Template:Cite arXiv
- ↑ Pierre-Simon Laplace, Traité de mécanique céleste, tome 4 (1805), livre X, page 255.
- ↑ Template:Cite book
- ↑ Template:Cite journal
- ↑ Template:Cite book
- ↑ Template:Cite journal
- ↑ Template:Cite journal
- ↑ Template:Cite journal
- ↑ Template:Cite journal
- ↑ Template:Cite journal
- ↑ Template:Cite journal
- ↑ Template:Cite book
- ↑ Template:Cite journal
- ↑ Template:Cite web
- ↑ Template:Cite book
- ↑ Template:Cite journal
- ↑ 25.0 25.1 25.2 Template:Citation
- ↑ Template:Citation
- ↑ John W. Craig, A new, simple and exact result for calculating the probability of error for two-dimensional signal constellations Template:Webarchive, Proceedings of the 1991 IEEE Military Communication Conference, vol. 2, pp. 571–575.
- ↑ Template:Cite journal
- ↑ Template:Cite book
- ↑ Template:Cite web
- ↑ Template:Cite web