InfyCalculator
➗

Error Function Calculator: erf(x), erfc(x) and the Inverse Error Function

Calculate the error function erf(x), the complementary error function erfc(x), and their inverses to 15 digits, with erfcx, the matching normal probability and the steps.

Calculate
x
y
Significant digits
Loading calculator…

How it works

erf(x) = (2/√π) ∫₀ˣ e^(−t²) dt · erfc(x) = 1 − erf(x) = (2/√π) ∫ₓ^∞ e^(−t²) dt · erf(−x) = −erf(x) · erfcx(x) = e^(x²)·erfc(x) · Φ(z) = ½[1 + erf(z/√2)] · erf⁻¹(y) = x such that erf(x) = y · erfc⁻¹(y) = erf⁻¹(1 − y)

The error function erf(x) is the area under the bell curve e^(−t²) from 0 to x, scaled so that erf(∞) = 1. It rises from −1 to 1, is odd (erf(−x) = −erf(x)), and erf(x) is the chance that a normal variable with mean 0 and variance ½ lands within ±x. The complementary error function erfc(x) = 1 − erf(x) is the tail beyond x; it appears in heat conduction and diffusion (the temperature or concentration in a semi-infinite solid follows erfc(x / 2√(αt))), in bit-error rates and in the normal distribution, where Φ(z) = ½[1 + erf(z/√2)]. This calculator sums the power series 2/√π·e^(−x²)·Σ 2ⁿx^(2n+1)/(1·3·…·(2n+1)) for |x| ≤ 2.5, where every term is positive so no digits cancel, and switches to the Laplace continued fraction for erfc above 2.5. Working with ln erfc means tiny tails such as erfc(10) = 2.088 × 10⁻⁴⁵ keep all their digits instead of rounding to 0. The inverse functions start from Winitzki’s closed-form approximation and polish it with Newton’s method, and the result is checked by plugging it back in. Use the normal distribution calculator when you have a mean, standard deviation and a value; use this page when a formula is written with erf, erfc or erf⁻¹ directly, as in physics, engineering and signal processing. Each result also shows the derivative, the scaled function erfcx and the matching normal z and Φ(z).

Worked example

With the default x = 0.5: x² = 0.25 and e^(−0.25) = 0.77880078. The series gives erf(0.5) = 1.1283792 × 0.77880078 × (0.5 + 0.08333333 + 0.00833333 + …) = 0.5204998778, so erfc(0.5) = 1 − 0.5204998778 = 0.4795001222. The derivative is (2/√π)·e^(−0.25) = 0.8787825789, erfcx(0.5) = e^(0.25) × 0.4795001222 = 0.6156903442, and the matching normal value is z = 0.5 × √2 = 0.7071067812 with Φ(z) = (1 + 0.5204998778)/2 = 0.7602499389.

Sources: NIST DLMF §7.2: Definitions of erf, erfc and their limits · Omni Calculator: Error function (modes and table of erf values) · Analyze Math: Error function calculator (erf and the normal CDF)

Frequently asked questions

What is erf(1)?

erf(1) = 0.8427007929 and erfc(1) = 0.1572992071. So about 84.3% of the area under e^(−t²) lies between −1 and 1. Other common values: erf(0.5) = 0.5204998778, erf(2) = 0.9953222650 and erf(3) = 0.9999779095.

How is the error function related to the normal distribution?

The standard normal CDF is Φ(z) = ½[1 + erf(z/√2)], and the probability of landing within ±k standard deviations is erf(k/√2). For example erf(1/√2) = 0.6827, the 68% of the 68–95–99.7 rule. Going the other way, erf(x) = 2Φ(x√2) − 1.

What is the difference between erf and erfc?

erfc(x) = 1 − erf(x). They carry the same information, but for large x erf(x) is so close to 1 that subtracting loses every digit, while erfc(x) keeps them: erf(5) rounds to 1.000000000 at 10 significant digits, but erfc(5) = 1.537459794 × 10⁻¹². Use erfc for tail probabilities and diffusion problems.

What is the inverse error function used for?

erf⁻¹(y) answers “for which x is erf(x) = y?”. It turns a probability into a critical value: the z-score for a two-sided confidence level C is √2·erf⁻¹(C), e.g. √2 × erf⁻¹(0.95) = √2 × 1.3859 = 1.96. It is only defined for −1 < y < 1; erfc⁻¹(y) = erf⁻¹(1 − y) takes 0 < y < 2.

Can erf(x) be greater than 1?

Not for real x: erf(x) always lies between −1 and 1 and only approaches them as x goes to ±∞. erfc(x) ranges from 0 to 2. Values outside these ranges are a sign of a typing or rounding error.

How do I calculate erf(x) by hand?

For small x use the Taylor series erf(x) = (2/√π)(x − x³/3 + x⁵/10 − x⁷/42 + …). For x = 0.1 the first two terms already give 0.11246. For large x use erfc(x) ≈ e^(−x²)/(x√π), which is within 6% once x ≥ 3 and within 2% once x ≥ 5.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.