Statistics · special functions
Inverse Error Function (erfinv): Formula, Calculator Method and Table of Values

Computed in your browser with a rational starting value and two Newton steps on erf.
The inverse error function, written erfinv(x) or erf⁻¹(x), answers one question: for which number y does the error function erf(y) equal x? The error function itself is erf(y) = (2/√π) ∫ e−t² dt, with the integral running from 0 to y. It rises from 0 toward 1 as y grows, so its inverse is defined for x strictly between −1 and 1, takes the value 0 at x = 0, and climbs without limit as x approaches 1.
No closed formula in elementary functions exists for erfinv, so every calculator, library and spreadsheet computes it numerically. This page gives the series formula, a short calculator procedure that you can follow by hand with a pocket device, a cheap approximation, and a table of values for checking your own code.
Definition, formula and basic properties
Start from y = erfinv(x), which means erf(y) = x. Because erf is an odd function, so is its inverse: erfinv(−x) = −erfinv(x). The derivative follows from the rule for inverse functions. Since the slope of erf at y is (2/√π)e−y², the slope of erfinv at x is (√π/2)ey² with y = erfinv(x). That slope grows quickly for large y, which explains why the function becomes steep near 1. A useful landmark is erf(1) = 0.842701, so any argument below that value gives an erfinv result smaller than 1 in magnitude, while larger arguments push the result past 1.
Near zero the function is almost linear. The leading term of its power series is (√π/2)x ≈ 0.8862x, and the series continues as
erfinv(x) = (√π/2)·(x + (π/12)x³ + (7π²/480)x⁵ + (127π³/40320)x⁷ + …)
The series converges for |x| < 1, but slowly as x approaches 1. For x = 0.1 the first three terms give 0.088856, matching the true value to six places. For x = 0.5 three terms give 0.4761 and four terms give 0.4768, against the true 0.476936. That is why series are used only for small arguments.
The link to normal quantiles
The inverse error function is a rescaled normal quantile function. If Φ is the standard normal distribution function, then Φ⁻¹(p) = √2 · erfinv(2p − 1). Read in the other direction, erfinv(x) = Φ⁻¹((1 + x)/2) / √2.
This is the reason statisticians meet the function. A two-sided 95 percent interval for a normal variable uses the point 1.959964, and indeed erfinv(0.95) = 1.385904 and 1.385904 × √2 = 1.959964. Software that offers a normal quantile but not erfinv, or the other way round, can supply either through this identity. The inverse normal distribution page treats the quantile side, and the normal probability density page covers the bell curve underneath both.
A calculator method: erfinv by Newton’s method
The best general-purpose method is Newton’s iteration on the equation erf(y) − x = 0. With the derivative above, each step is
ynew = y − (erf(y) − x) / ((2/√π)·e−y²).
Worked example: find erfinv(0.5), starting from the guess y = 0.5. A calculator gives erf(0.5) = 0.520500, so the residual is 0.020500. The slope is (2/√π)·e−0.25 = 1.128379 × 0.778801 = 0.878783. The step is 0.020500 / 0.878783 = 0.023328, and the new estimate is 0.476672.
Repeat once. Now erf(0.476672) = 0.499763, the residual is −0.000237, and the correction is +0.000264, which gives 0.476936. A third evaluation changes nothing in the sixth decimal place. The error fell from 0.023 to 0.00026 to below 0.0000005, the roughly squared pattern you expect from Newton’s method when the guess is already close.
The starting value matters. The guess y = x is adequate for modest x. Near 1 the same guess converges only slowly, since the true answer is far to the right and the error function is flat there, so begin from the approximation in the next section.
A closed-form approximation
A well-known approximation avoids iteration. With a ≈ 0.147, set L = ln(1 − x²) and t = 2/(πa) + L/2. Then
erfinv(x) ≈ sign(x) · √( √(t² − L/a) − t ).
For x = 0.5: L = −0.287682, t = 4.18691, t² = 17.5302, and −L/a = 1.95702, so the inner root is √19.4872 = 4.41443. Subtract t to get 0.22752, and the square root is 0.47700. The true value is 0.476936, so the error is about 0.00006. At x = 0.99 the formula returns 1.8190 against the true 1.8214, an error near 0.13 percent. Use it as a starting point for Newton, or when four digits are enough.
Table of values
The values below are rounded to six decimal places. They are a good test set for any implementation.
| x | erfinv(x) |
|---|---|
| 0 | 0 |
| 0.1 | 0.088856 |
| 0.25 | 0.225312 |
| 0.5 | 0.476936 |
| 0.75 | 0.813420 |
| 0.9 | 1.163087 |
| 0.95 | 1.385904 |
| 0.99 | 1.821386 |
| 0.999 | 2.326754 |
The growth near 1 is visible: moving from 0.99 to 0.999 adds about 0.5 to the result, though x itself changed by under 0.01.
Using it in code
In a program the function is a short loop around the Newton step, started from the closed-form guess, with a fixed number of iterations or a tolerance on the step size:
y = approx(x) % closed-form start
repeat 3 times
y = y - (erf(y) - x) / (2/sqrt(pi) * exp(-y*y))
return y
A typical use is random number generation by inversion. Draw u uniformly between 0 and 1, then z = √2 · erfinv(2u − 1) is a standard normal sample. With u = 0.975 the result is 1.959964, and with u = 0.75 it is √2 × 0.476936 = 0.674490, the third quartile of the standard normal distribution. A few iterations reach double precision in the central range when the start comes from the approximation above, and a test against the table below catches a wrong sign or a missing factor of √2 immediately.
Accuracy near the ends
In floating point, an argument such as 0.9999999999 carries a rounding error of about the size of 1 − x itself, so erfinv of such a number is poorly determined. Libraries therefore offer an inverse of the complementary function, erfcinv, defined by erfcinv(1 − x) = erfinv(x). Pass it the small number 1 − x directly and the tail values stay accurate. The error function is a special case of the incomplete gamma function, covered on the incomplete gamma page, and the statistics section lists related functions. A glossary entry explains quantile and related terms.
Questions about the inverse error function
What is the formula for the inverse error function?
There is no elementary closed form. The power series erfinv(x) = (√π/2)(x + πx³/12 + 7π²x⁵/480 + …) converges for |x| < 1, and Newton’s method on erf(y) = x gives any precision you need.
How do I calculate erfinv(0.5) by hand?
Start at y = 0.5, then iterate y ← y − (erf(y) − 0.5)/((2/√π)e−y²). Two steps give 0.476672 and 0.476936. A third confirms six digits.
What is the relation between erfinv and the inverse normal CDF?
Φ⁻¹(p) = √2 · erfinv(2p − 1). The two differ only by a rescaling of the argument and the output.
What is the domain of erfinv?
The open interval from −1 to 1. At the endpoints the value is ±∞, and outside the interval it is undefined for real numbers.
Is erfinv the same as 1/erf?
No. The reciprocal 1/erf(x) is a different function. The superscript in erf⁻¹ marks the inverse function, not a reciprocal.