In mathematics, the error function (also called the Gauss error function), often denoted by 𝐞𝐫𝐟, is the function erf(z)=2π∫0ze−t2dt. The integral here is a complex contour integral which is path-independent because exp(−t2) 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 older texts, the error function is defined without the factor of 2/π. 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 X, the error function has the following interpretation: for a real random variable Y that is normally distributed with mean 0 and standard deviation 1/2, erf(x) is the probability that Y falls in the range [−x,x]. Two closely related functions are the complementary error function
erfc(z)=1−erf(z) and the imaginary error function
erfi(z)=−ierf(iz), where i is the imaginary unit.
Name The name "error function" and its abbreviation erf 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". The complementary error function was also discussed by Glaisher in a separate publication in the same year. For the "law of facility" of errors whose density is given by
f(x)=(cπ)1/2e−cx2 (the normal distribution), Glaisher calculates the probability of an error lying between p and q as
(cπ)12∫pqe−cx2dx=12(erf(qc)−erf(pc)).
Applications When the results of a series of measurements are described by a normal distribution with standard deviation σ and expected value zero, then
erf(aσ2) is the probability that the error of a single measurement lies between −a and a. 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 normally distributed random variable X with mean μ and standard deviation σ and a constant L>μ, it can be shown via integration by substitution that
Pr[X≤L]=12+12erf(L−μ2σ)≈Aexp(−B(L−μσ)2) where A and B are certain numeric constants. If L is sufficiently far from the mean, specifically,
μ−L≥σlog(k), then
Pr[X≤L]≤Aexp(−Blog(k))=AkB and so the probability goes to 0 as k→∞. The probability for X being in the interval [La,Lb] can be derived as Pr[La≤X≤Lb]=∫LaLb12πσexp(−(x−μ)22σ2)dx=12(erf(Lb−μ2σ)−erf(La−μ2σ)).
Properties
The error function is an odd function. This directly results from the fact that the integrand e−t2 is an even function (since 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 maps real numbers to real numbers, for any complex number z,
erf(z¯)=erf(z)‾ where z¯ denotes the complex conjugate of z. The error function at ∞ is exactly 1 (see Gaussian integral). At the real axis, erf(z) approaches 1 at z→∞ and −1 at z→−∞. At the imaginary axis, it tends to ±i∞.
Taylor series The error function is an entire function; it has no singularities (except at infinity) and its Taylor expansion always converges. For x≫1, however, cancellation of leading terms makes the Taylor expansion impractical. The defining integral cannot be evaluated in closed form in terms of elementary functions (see Liouville's theorem), but by expanding the integrand e−z2 into its Maclaurin series, integrating term by term, and using the fact that erf(0)=0, one obtains the error function's Maclaurin series as: erf(z)=2π∑n=0∞(−1)nz2n+1n!(2n+1)=2π(z−z33+z510−z742+z9216−⋯) which holds for every complex number z. The denominator terms form sequence A007680 in the OEIS. This is a special case of Kummer's confluent hypergeometric function:
erf(z)=2zπ1F1(12,32,−z2). For iterative calculation of the above series, the following alternative formulation may be useful: erf(z)=2π∑n=0∞(z∏k=1n−(2k−1)z2k(2k+1))=2π∑n=0∞z2n+1∏k=1n−z2k, because
−(2k−1)z2k(2k+1) expresses the multiplier to turn the k-th term into the (k+1)-th term (considering z as the first term). The imaginary error function has a similar Maclaurin series: erfi(z)=2π∑n=0∞z2n+1n!(2n+1)=2π(z+z33+z510+z742+z9216+⋯) which holds for every complex number z.
Derivative and integral The derivative of the error function follows immediately from its definition: ddzerf(z)=2πe−z2. From this, the derivative of the imaginary error function is also immediate: ddzerfi(z)=2πez2.Higher order derivatives are given by erf(k)(z)=2(−1)k−1π𝐻k−1(z)e−z2=2πdk−1dzk−1(e−z2), where the Hk are the physicists' Hermite polynomials. An antiderivative of the error function, obtainable by integration by parts, is ∫erf(z)dz=zerf(z)+e−z2π+C. An antiderivative of the imaginary error function, also obtainable by integration by parts, is ∫erfi(z)dz=zerfi(z)−ez2π+C.
Bürmann series An expansion which converges more rapidly for all real values of x than a Taylor expansion is obtained by using Bürmann's theorem: erf(x)=2πsgn(x)⋅1−e−x2(1−112(1−e−x2)−7480(1−e−x2)2−5896(1−e−x2)3−⋯)=2πsgn(x)⋅1−e−x2(π2+∑k=1∞cke−kx2) where sgn is the sign function. By keeping only the first two coefficients and choosing c1=31/200 and c2=−341/8000, the resulting approximation shows its largest relative error at x=±1.40587, where it is less than 0.0034361: erf(x)≈2πsgn(x)⋅1−e−x2(π2+31200e−x2−3418000e−2x2).
Inverse functions
Given a complex number z, there is not a unique complex number w satisfying erf(w)=z, so a true inverse function would be multivalued. However, for −1<x<1, there is a unique real number denoted erf−1(x) satisfying
erf(erf−1(x))=x. The inverse error function is usually defined with domain (−1,1), and it is restricted to this domain in many computer algebra systems. However, it can be extended to the disk |z|<1 of the complex plane, using the Maclaurin series
erf−1(z)=∑k=0∞ck2k+1(π2z)2k+1, where c0=1 and ck=∑m=0k−1cmck−1−m(m+1)(2m+1)={1,1,76,12790,43692520,3480716200,…}. So we have the series expansion (common factors have been canceled from numerators and denominators):
… excerpt ends here. Continue reading the full article.





