What this calculator does
The error function erf(x) is the area under a bell curve between −x and x, rescaled so that it runs from 0 up to 1 as x goes from 0 to infinity. It has no closed form, which is why it gets a name and a symbol of its own rather than being written out each time.
It carries the awkward name for historical reasons, from its use in the theory of measurement errors, but it turns up far more widely than that suggests. Diffusion, heat conduction and any problem whose solution involves a spreading Gaussian profile end up expressed in terms of erf, and erfc, its complement, is what appears whenever the quantity of interest is the tail rather than the middle.
The formula
The error function is the integral of e to the power of minus t squared, from 0 to x, scaled by 2 over the square root of π. That integral has no elementary antiderivative, so it is evaluated through its relationship to the standard normal distribution: erf(x) equals 2·Φ(x√2) − 1, where Φ is the normal cumulative distribution function. The complement erfc(x) is simply 1 − erf(x), reported separately because it keeps its precision far better than a subtraction would in the far tail.
| Term | Meaning |
|---|---|
| erf(x) | The error function, the scaled area under a Gaussian between −x and x. It runs from 0 at x = 0 towards 1 as x grows. |
| erfc(x) | The complementary error function, 1 − erf(x), which is the remaining tail area. |
| Φ | The standard normal cumulative distribution function, which erf is a rescaling of. |
| Odd symmetry | The property erf(−x) = −erf(x), so a negative argument simply flips the sign. |
The inputs explained
| Field | What to enter |
|---|---|
| x | The upper limit of the integral. Any real number works, and a negative value gives the negative of the result at the matching positive value. |
When to use it
Converting between erf and normal probabilities
Statistical tables give normal probabilities while physics and engineering texts give erf. Having both sides available makes it straightforward to move a result from one convention to the other without rederiving it.
Solving a diffusion or heat conduction problem
The standard solution for one-dimensional diffusion from a step change in concentration or temperature is written directly as an error function of position divided by the square root of time. Evaluating erf is the last step of getting a number out of it.
Estimating a tail probability
erfc is the tail, and it falls extremely fast. Reading it directly rather than subtracting erf from 1 keeps the significant figures intact for the small values that matter most in a tail.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How quickly does the error function approach 1?
The error function and its complement at a spread of values from 0 outwards.
| x | erf(x) | erfc(x) = 1 − erf(x) |
|---|---|---|
| 0 | 0 | 1.0000 |
| 0.5 | 0.520500 | 0.479500 |
| 1 | 0.842701 | 0.157299 |
| 1.5 | 0.966105 | 0.033895 |
| 2 | 0.995322 | 0.004678 |
| 3 | 0.999978 | 0.00002211 |
Questions
What is the relationship between erf and the normal distribution?
erf(x) equals 2·Φ(x√2) − 1, where Φ is the standard normal cumulative distribution. Read the other way, the probability that a standard normal value falls within z standard deviations of the mean is erf(z/√2). The familiar 68.27% figure for one standard deviation is erf(0.7071).
Why is it called the error function?
From its origins in the theory of observational errors, where the distribution of measurement error is taken to be Gaussian and this integral gives the probability that an error falls within some bound. The name stuck long after the function outgrew that one use.
What does erf give for a negative argument?
The negative of the value at the matching positive argument, since erf is an odd function. erf(−1) is −0.842701. erfc does not share that symmetry: it runs from 2 down to 0 as x goes from negative to positive infinity.
Why report erfc separately instead of just subtracting?
Because subtraction destroys precision when erf is close to 1. At x = 3, erf is 0.999978 and erfc is 0.00002211. Computing the second from the first would lose most of the significant digits, so it is calculated on its own terms.
For numerically integrating a function that has no closed form, see the trapezoidal rule calculator. For the gamma function, another named integral that appears throughout the same distributions, see the gamma function calculator.