Skip to content

ErfInv ​

The inverse error function: erfinv⁡(x)\operatorname{erfinv}(x) solves erf⁡(y)=x\operatorname{erf}(y) = x for −1<x<1-1 < x < 1.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaError functionMathWorldInverseErfErfWikidataQ579262DLMF7.17.E17.2.E1Wolfram LanguageInverseErf!
ErfInv(x)the inverse error function, solving erf⁡(y)=x\operatorname{erf}(y) = x.
SageMatherfinv(x)SymPyerfinv(x)mpmatherfinv(x)Rusterf_inv(x)
Typed signatures
TypePackageApplies
(complex | infinity) -> numbercompute-enginealways
(number, number?) -> numberanalyticreplaces compute-enginealways

Domain: Special functions

Details
  • Inverse of Erf: erf⁡(erfinv⁡(x))=x\operatorname{erf}(\operatorname{erfinv}(x)) = x.
  • erfinv⁡(0)=0\operatorname{erfinv}(0) = 0, and erfinv⁡(x)→±∞\operatorname{erfinv}(x) \to \pm\infty as x→±1x \to \pm 1, the limits where Erf itself saturates.
  • Computed by Newton's method on Erf itself, refining an initial approximation to full machine precision.
  • Intrinsically ill-conditioned near x=±1x = \pm1: a tiny change in x there produces a large change in the result.
  • compute-engine leaves a call outside [−1,1][-1, 1] unevaluated rather than erroring or returning NaN.

Plot

Examples

2 more kept as data, checked against the oracles
Basic #
live ↗
InErfInv(0)\mathrm{ErfInv}(0)Out00
live ↗
InErfInv(1)\mathrm{ErfInv}(1)Out∞∞
live ↗
InErfInv(−1)\mathrm{ErfInv}(-1)Out−∞-∞

A floating-point argument evaluates directly to a high-precision decimal

live ↗
InErfInv(0.5)\mathrm{ErfInv}(0.5)Out0.476 936 276 204 469 873 3810.476\,936\,276\,204\,469\,873\,381

A machine-precision argument

live ↗
InErfInv(0.6)\mathrm{ErfInv}(0.6)Out0.595 116 081 449 994 850 0190.595\,116\,081\,449\,994\,850\,019
live ↗
InSeries⁡(ErfInv(x),x,0,3)\operatorname{Series}(\mathrm{ErfInv}(x), x, 0, 3)Outxπ2+124x3π3+O(x5)\frac{x\sqrt{π}}{2}+\frac{1}{24}x^3\sqrt{π}^{3}+O\left(x^5\right)
Scope #

Threads element-wise over a list, as Wolfram's Listable heads do

live ↗
InErfInv([0,1])\mathrm{ErfInv}(\bigl\lbrack0, 1\bigr\rbrack)Out[0,∞]\bigl\lbrack0, ∞\bigr\rbrack

Two arguments: erfinv⁡(z0,z)\operatorname{erfinv}(z_0, z) solves z=erf⁡(z0,x)=erf⁡(x)−erf⁡(z0)z = \operatorname{erf}(z_0, x) = \operatorname{erf}(x) - \operatorname{erf}(z_0)

live ↗
InErfInv(0.4,0.2)\mathrm{ErfInv}(0.4, 0.2)Out0.631 775 903 055 006 30.631\,775\,903\,055\,006\,3

Interval arithmetic: the inverse is increasing, so endpoints map to endpoints

live ↗
InErfInv(Interval(0.5,0.6))\mathrm{ErfInv}(\mathrm{Interval}(0.5, 0.6))OutInterval(0.476 936 276 204 469 9,0.595 116 081 449 994 8)\mathrm{Interval}(0.476\,936\,276\,204\,469\,9, 0.595\,116\,081\,449\,994\,8)

Uncertainty propagation

live ↗
InErfInv(Around(0.5,0.01))\mathrm{ErfInv}(\mathrm{Around}(0.5, 0.01))OutAround(0.476 936 276 204 469 9,0.011 125 848 189 719 498)\mathrm{Around}(0.476\,936\,276\,204\,469\,9, 0.011\,125\,848\,189\,719\,498)

To 30 significant digits, every one correctly rounded

live ↗
InN(ErfInv(12),30)N(\mathrm{ErfInv}(\frac{1}{2}), 30)Out0.476 936 276 204 469 873 381 418 353 6430.476\,936\,276\,204\,469\,873\,381\,418\,353\,643

A 50-digit value of the inverse error function at 0.33

live ↗
InN(ErfInv(33100),50)N(\mathrm{ErfInv}(\frac{33}{100}), 50)Out0.301 332 146 133 705 826 128 502 718 158 394 773 965 824 282 828 530.301\,332\,146\,133\,705\,826\,128\,502\,718\,158\,394\,773\,965\,824\,282\,828\,53

Matrix function of a 2x2 matrix, expanded into entries involving erf−1\mathrm{erf}^{-1} of exact algebraic points

live ↗
InFunctionExpand(MatrixFunction(ErfInv,[[0,1/2],[1,0]]))\mathrm{FunctionExpand}(\mathrm{MatrixFunction}(\mathrm{ErfInv}, \bigl\lbrack\bigl\lbrack0, 1/2\bigr\rbrack, \bigl\lbrack1, 0\bigr\rbrack\bigr\rbrack))Out[[12ErfInv(−21/2/2)+ErfInv(21/2/2)2,142ErfInv(21/2/2)−142ErfInv(−21/2/2)],[122ErfInv(21/2/2)−122ErfInv(−21/2/2),12ErfInv(−21/2/2)+ErfInv(21/2/2)2]]\bigl\lbrack\bigl\lbrack\frac{1}{2}\mathrm{ErfInv}(-2^{1/2}/2)+\frac{\mathrm{ErfInv}(2^{1/2}/2)}{2}, \frac{1}{4}\sqrt{2}\mathrm{ErfInv}(2^{1/2}/2)-\frac{1}{4}\sqrt{2}\mathrm{ErfInv}(-2^{1/2}/2)\bigr\rbrack, \bigl\lbrack\frac{1}{2}\sqrt{2}\mathrm{ErfInv}(2^{1/2}/2)-\frac{1}{2}\sqrt{2}\mathrm{ErfInv}(-2^{1/2}/2), \frac{1}{2}\mathrm{ErfInv}(-2^{1/2}/2)+\frac{\mathrm{ErfInv}(2^{1/2}/2)}{2}\bigr\rbrack\bigr\rbrack

The generalized inverse undoes the generalized erf only up to the plain inverse of erf

live ↗
InErfInv(a,erf⁡(a,z))\mathrm{ErfInv}(a, \operatorname{erf}(a, z))OutErfInv(erf⁡(z))\mathrm{ErfInv}(\operatorname{erf}(z))
live ↗
InFunctionExpand(erf⁡(ErfInv(s)))\mathrm{FunctionExpand}(\operatorname{erf}(\mathrm{ErfInv}(s)))Outss
live ↗
InErfInv(s)=ErfInv(0,s)\mathrm{ErfInv}(s)=\mathrm{ErfInv}(0, s)OutTrue\mathrm{True}
live ↗
InSeries⁡(ErfInv(x),x,0,8)\operatorname{Series}(\mathrm{ErfInv}(x), x, 0, 8)Outxπ2+124x3π3+1960×7x5π5+180 640×127x7π7+O(x9)\frac{x\sqrt{π}}{2}+\frac{1}{24}x^3\sqrt{π}^{3}+\frac{1}{960}×7x^5\sqrt{π}^{5}+\frac{1}{80\,640}×127x^7\sqrt{π}^{7}+O\left(x^9\right)
live ↗
InSeries⁡(ErfInv(z0,s),z0,0,2)\operatorname{Series}(\mathrm{ErfInv}(\mathrm{z0}, s), \mathrm{z0}, 0, 2)OutErfInv(s)+z0eErfInv(s)2+ErfInv(s)z02e2ErfInv(s)2+O(z03)\mathrm{ErfInv}(s)+\mathrm{z0}e^{\mathrm{ErfInv}(s)^2}+\mathrm{ErfInv}(s)\mathrm{z0}^2e^{2\mathrm{ErfInv}(s)^2}+O\left(\mathrm{z0}^3\right)
Applications #

The normal quantile 2 erfinv⁡(2p−1)\sqrt2\,\operatorname{erfinv}(2p - 1) at p=0.975p = 0.975: the 1.96 of a 95% confidence interval

live ↗
In2ErfInv(0.95)\sqrt{2}\mathrm{ErfInv}(0.95)Out1.959 963 984 540 054 235 527 460 400 177 851 935 713 577 921.959\,963\,984\,540\,054\,235\,527\,460\,400\,177\,851\,935\,713\,577\,92
Properties #

Inverse of Erf: erf⁡(erfinv⁡(x))=x\operatorname{erf}(\operatorname{erfinv}(x)) = x. See Erf

live ↗
Inerf⁡(ErfInv(0.5))=0.5\operatorname{erf}(\mathrm{ErfInv}(0.5))=0.5OutTrue\mathrm{True}

Odd: erfinv⁡(−x)=−erfinv⁡(x)\operatorname{erfinv}(-x) = -\operatorname{erfinv}(x) applied symbolically

live ↗
InErfInv(−x)\mathrm{ErfInv}(-x)Out−ErfInv(x)-\mathrm{ErfInv}(x)

ddxerfinv⁡(x)=π2eerfinv⁡(x)2\frac{d}{dx}\operatorname{erfinv}(x) = \frac{\sqrt\pi}{2}e^{\operatorname{erfinv}(x)^2}

live ↗
IndErfInv(x)dx\frac{\mathrm{d}\mathrm{ErfInv}(x)}{\mathrm{d}x}Out12eErfInv(x)2π\frac{1}{2}e^{\mathrm{ErfInv}(x)^2}\sqrt{π}

A two-argument call with a numeric first argument is numeric

live ↗
InIsNumeric(ErfInv(1π,12))\mathrm{IsNumeric}(\mathrm{ErfInv}(\frac{1}{π}, \frac{1}{2}))OutTrue\mathrm{True}

With both limits 0 the generalized inverse is 0

live ↗
InErfInv(0,0)\mathrm{ErfInv}(0, 0)Out00

Known value · Wolfram MathematicalFunctionData, InverseErf:Generalized

The value 1 is the pole of the inverse: infinity

live ↗
InErfInv(0,1)\mathrm{ErfInv}(0, 1)Out∞∞

Known value · Wolfram MathematicalFunctionData, InverseErf:Generalized

With lower limit 1 and value 0 it reduces to erf−1(erf(1))\mathrm{erf}^{-1}(\mathrm{erf}(1))

live ↗
InErfInv(1,0)\mathrm{ErfInv}(1, 0)OutErfInv(erf⁡(1))\mathrm{ErfInv}(\operatorname{erf}(1))

Known value · Wolfram MathematicalFunctionData, InverseErf:Generalized

live ↗
InSolve(ErfInv(x)3+2ErfInv(x)=1,x)\mathrm{Solve}(\mathrm{ErfInv}(x)^3+2\mathrm{ErfInv}(x)=1, x)OutSolve(ErfInv(x)3+2ErfInv(x)=1,x)\mathrm{Solve}(\mathrm{ErfInv}(x)^3+2\mathrm{ErfInv}(x)=1, x)
live ↗
InAttributes(ErfInv)\mathrm{Attributes}(\mathrm{ErfInv})Out[Listable,Protected]\bigl\lbrack\mathrm{Listable}, \mathrm{Protected}\bigr\rbrack
Possible issues #

Outside its real domain [−1,1][-1, 1], compute-engine leaves the call unevaluated rather than returning NaN or a complex value

live ↗
InErfInv(2)\mathrm{ErfInv}(2)OutErfInv(2)\mathrm{ErfInv}(2)
Neat examples #

Blows up near the boundary: erfinv⁡(0.9999)\operatorname{erfinv}(0.9999) is already past 2.7

live ↗
InErfInv(0.999 9)\mathrm{ErfInv}(0.999\,9)Out2.751 063 905 712 060 796 152.751\,063\,905\,712\,060\,796\,15
About
Examples32
Checked againstWolfram Language 28 agree3 differ1 unevaluatedSageMath 13 agree3 differ1 unevaluated1 errorSymPy 14 agree1 differ1 unevaluated3 errormpmath 11 agree3 errorRust 8 agree6 error
CrosswalkWikipediaMathWorld ×2WikidataDLMF ×2Wolfram LanguageSageMathSymPympmathRust

Implementation

mappedsympypackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts
mappedsagepackages/oracle/src/mappings.ts
mappedrustpackages/oracle/src/mappings.ts

See also: Erf, Erfc