In mathematics, the error function (also called the Gauss error function), often denoted by erf, is a function e r f : C → C {\displaystyle \mathrm {erf} :\mathbb {C} \to \mathbb {C} } defined as: erf ( z ) = 2 π ∫ 0 z e − t 2 d t . {\displaystyle \operatorname {erf} (z)={\frac {2}{\sqrt {\pi }}}\int _{0}^{z}e^{-t^{2}}\,\mathrm {d} t.}
The integral here is a complex contour integral which is path-independent because exp ( − t 2 ) {\displaystyle \exp(-t^{2})} is holomorphic on the whole complex plane C {\displaystyle \mathbb {C} } . In many applications, the function argument is a real number, in which case the function value is also real.
In some old texts, the error function is defined without the factor of 2 π {\displaystyle {\frac {2}{\sqrt {\pi }}}} . 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 {\displaystyle {\frac {1}{\sqrt {2}}}} , erf(x) is the probability that Y falls in the range [−x, x].
Two closely related functions are the complementary error function e r f c : C → C {\displaystyle \mathrm {erfc} :\mathbb {C} \to \mathbb {C} } is defined as
erfc ( z ) = 1 − erf ( z ) , {\displaystyle \operatorname {erfc} (z)=1-\operatorname {erf} (z),}
and the imaginary error function e r f i : C → C {\displaystyle \mathrm {erfi} :\mathbb {C} \to \mathbb {C} } is defined as
erfi ( z ) = − i erf ( i z ) , {\displaystyle \operatorname {erfi} (z)=-i\operatorname {erf} (iz),}
where i is the imaginary unit.