Error Function Calculator

Error Function Calculator

Evaluate the error function erf(x), the complementary error function erfc(x) and the inverse error function to high precision, with their link to normal probabilities.

erf(x) = (2/√π) ∫₀ˣ e^(−t²) dt

Enter a value

What Is the Error Function?

The error function, erf(x), is the area under the bell curve e^(−t²) from 0 to x, scaled so that it runs from −1 to 1. It has no formula in elementary functions, so it's computed numerically.

In statistics it is the normal distribution in disguise: the chance a normal value lies within ±z standard deviations of the mean is erf(z/√2). The name comes from its origins in the theory of measurement errors.

In physics and engineering it describes diffusion. How far heat soaks into a cold block, or carbon into steel, follows the complementary error function erfc(x) = 1 − erf(x).

Error Function Formulas

As given in the NIST Digital Library of Mathematical Functions, chapter 7. See Sources.

1. Definition

erf(x) = (2/√π) ∫₀ˣ e^(−t²) dt · erfc(x) = 1 − erf(x)

2. Link to the normal distribution

Φ(z) = ½(1 + erf(z/√2)) · P(|Z| < z) = erf(z/√2)

3. Inverse

erf⁻¹(y) = Φ⁻¹((1 + y)/2) ÷ √2

This page computes erf through the regularised incomplete gamma function, P(½, x²), which keeps erfc accurate even when it's tiny.

Worked Example: Carbon Diffusing Into Steel

Given:
Steel is carburised for 10 hours with a diffusion coefficient of 1 × 10⁻¹¹ m²/s (illustrative). How much of the surface carbon level is reached 0.5 mm deep?
Step 1:
Diffusion length:
2√(Dt) = 2√(1 × 10⁻¹¹ × 36,000) = 1.2 mm
Step 2:
Argument:
x = 0.5 ÷ 1.2 = 0.4167
Step 3:
Concentration ratio:
C/C₀ = erfc(0.4167) = 0.5557
Result:
About 56% of the surface level

Doubling the depth to 1 mm drops it to 24%. Because depth scales with √t, reaching the same level twice as deep takes four times as long.

Error Function Table

Values of erf and erfc with the matching normal range
xerf(x)erfc(x)Normal ±z (z = x√2)
0.10.1124630.887537±0.141
0.250.2763260.723674±0.354
0.50.52050.4795±0.707
0.70710.6826890.317311±1
10.8427010.157299±1.414
1.50.9661050.033895±2.121
20.9953220.004678±2.828
30.9999782.209e-5±4.243

Common Error Function Mistakes

  • Forgetting the √2. erf(1) = 0.843 is the chance of being within ±1.414 SDs, not ±1 SD. For ±1 SD use erf(1/√2) = 0.683.
  • Using 1 − erf(x) for large x. Subtracting two numbers near 1 loses precision. Use erfc directly; this page does.
  • Confusing erf with Φ. erf runs from −1 to 1 and is centred on 0; Φ runs from 0 to 1 and Φ(0) = 0.5.
  • Inverting values of ±1. erf⁻¹(1) is infinite; inputs must lie strictly between −1 and 1.

Error Function FAQs

What is erf(1)?

About 0.842701.

Is erf odd or even?

Odd: erf(−x) = −erf(x). erfc(−x) = 2 − erfc(x).

How accurate is this calculator?

To at least 10 significant figures across the range, using a series and continued fraction for the incomplete gamma function.

What is erfc used for?

Tail probabilities, diffusion and heat conduction, and bit-error rates in communications.

How do I get normal probabilities from erf?

Φ(z) = ½(1 + erf(z/√2)). The z-score and normal distribution calculators do this for you.

What is the inverse error function?

The x that gives erf(x) = y. It is used to turn a probability into a number of standard deviations.

Why is it called the error function?

J. W. L. Glaisher named it in 1871 because of its role in the theory of observational errors.

Does Excel have it?

Yes: ERF, ERFC, ERF.PRECISE and ERFC.PRECISE. Excel has no inverse, but NORM.S.INV can be rescaled.

Sources

Related Tools