Inverse error function (source code)

= Inverse error function
{title2=$\operatorname{erf}^{-1}$}

Because the real <error function> is <strictly increasing> from $-1$ to $1$, its real <inverse function> maps $(-1,1)$ onto the <real line>. For $0<q<1$, the <standard normal quantile> is therefore
$$
\Phi^{-1}(q)=\sqrt2\,\operatorname{erf}^{-1}(2q-1).
$$
More generally, the $q$-<quantile> of a <normal distribution> with <expected value> $\mu$ and positive <standard deviation> $\sigma$ is $\mu+\sigma\sqrt2\,\operatorname{erf}^{-1}(2q-1)$. This reverses the area calculation: instead of asking how much <probability> lies below an endpoint, a <quantile> asks which endpoint encloses a specified <probability>. The domain restriction matters; $q=0$ and $q=1$ correspond to infinite endpoints, rather than finite real values of the <inverse error function>.