Skip to main content
CalcMax

Error Function Calculator

Range: -6 – 6

Result

0.842701

erf(x)

erfc(x)
0.157299

An error function calculator returns erf(x) and its complement erfc(x) for the same input, so the two readings always add up to one. The error function is the integral of the bell-shaped curve from zero out to x, which is why it turns up wherever a gaussian distribution has to be measured: erf(1) is 0.842701, and since erfc(1) is 0.157299, the complementary error function is simply one minus the first reading. The page computes the values from the series definition, since the language it is written in has no built-in error function, and it accepts negative inputs as well as positive ones. Inputs are limited to six in either direction, which is the point past which the curve has nothing left to distinguish.

The error function and its complement at the values people look up

xerf(x)erfc(x)
001
0.250.2763260.7236736
0.50.52050.4795001
0.750.7111560.2888444
10.8427010.1572992
1.50.9661050.03389485
20.9953220.004677735
2.50.9995930.000406952
30.9999780.0000220905

Every row adds to one across the last two columns, which is the definition of a complement and the fastest way to sanity-check any figure here. The upper half of the table is where the complement thins out: at x = 2 it is still four figures, and by x = 3 it has dropped to five decimal places of zero before anything appears. Reading down the middle column shows the curve flattening — the steps from 0 to 0.5 cover half the range, and everything after 2 is the last half a percent. Decimal points are ordinary full stops throughout, since a table cell is not localised.

Formula

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

x
The value being measured, a plain number with no units. It may be negative, in which case the error function is odd and returns the negative of the positive answer: erf(-1) is -0.842701. The practical range is -6 to 6, outside which the curve has flattened so completely that a double cannot tell the value apart from 1.
e^(−t²)
The gaussian bell, the curve being integrated. Its shape is what makes the error function matter: the area under it between two values is a probability, which is why the same integral appears in every normal distribution question and why this page's natural companion is the normal distribution calculator.
√π
The normalising factor in front of the integral, about 1.772454. Without it the whole curve would integrate to √π instead of to 1, and the error function would not run from -1 to 1. It is a constant rather than a variable here, which is worth saying because it looks like one.
erf x
The error function itself, printed to six decimal places. It runs from -1 to 1, crossing zero at the origin, and reaches 0.842701 at x = 1. The value is a genuine area rather than a probability: to turn it into one you add one and halve it, which is how the standard normal distribution function is built out of it.
erfc x
The complementary error function, one minus erf, which starts at 1 for large negative inputs and falls away towards zero. It is reported in scientific notation because it spans an enormous range. It is not a second measurement so much as the same one read from the other end: erfc is the tail area, and the tail is exactly what you want when x is far from zero.

Use this page when the answer you need is the error function or its complement as written. If what you actually want is the probability that a normal variable falls below a given value, the normal distribution calculator takes a mean and a standard deviation and returns that probability directly, which is the same number reached by a shorter route. The error function is the primitive underneath that, and this page is where the primitive itself can be read off.

Worked examples

  1. The value everyone meets first: x = 1

    1. The series is evaluated at x = 1, which converges in a few dozen terms
    2. erf(1) comes out at 0.842701
    3. The complement is one minus that: 1 - 0.842701 = 0.157299
    4. Adding the two readings gives 1.000000, which is the check worth running on any row of this page

    The fact that the two readings sum to one is not a coincidence of rounding, it is the definition of the word complementary. Read as an area, it says that everything under the bell curve is either within one unit of the centre or beyond it. This is also the row that converts most directly into the familiar figure of roughly 68 percent within one standard deviation.

  2. Two, where the tail is getting thin

    1. erf(2) is 0.995322, so the curve has almost finished its climb
    2. The complement is 1 - 0.995322 = 0.0046777, now below half a percent
    3. In scientific notation that tail is written 4.677735 × 10⁻³
    4. The two readings still add to one, with the complement down to four significant figures

    Watch the precision on the complement rather than on the error function. Computing one minus a number very close to one throws away the leading digits, and by this row the complement has already lost most of them — which is why the page reports it in scientific notation with its own significant-figure handling rather than to a fixed number of decimal places.

  3. Four, where the complement starts to run out

    1. The true value of erf(4) is one minus about 1.54 × 10⁻⁸
    2. As a double that is indistinguishable from 1, so the error function column prints exactly 1
    3. The complement is then computed as 1 - erf and returns 1.541726 × 10⁻⁸
    4. The subtraction is where the accuracy goes: the answer has only a handful of good digits left

    This is the honest limit of the page and the reason the input range stops at 6. The complement here is a difference between two numbers that agree to eight decimal places, so it is the small remainder of a cancellation; the true value is 1.5417 × 10⁻⁸ and a few leading digits of it are reliable. By x = 6 the two doubles are equal and the subtraction returns exactly zero where the truth is about 2 × 10⁻¹⁷.

Limitations

The input is limited to 6 in either direction. That is a precision limit rather than a performance one: beyond it the error function is so close to 1 that a double cannot represent the difference, so the page would be printing noise. Even inside the range there is a limit worth knowing about — the complement is computed by subtraction, and once x passes about 4.5 that subtraction cancels most of the significant digits, so erfc values there carry only a few good figures. That is not fixed here, and fixing it would mean a second implementation of the complement rather than a correction to this one. The error function itself is accurate to within one or two units in the last place across the range. Only the two values are given: the standard normal distribution function is not among the outputs, since it is the same information through a different route and the normal distribution calculator reports it as a probability with a mean and a standard deviation to work with. No units are involved anywhere on this page; the input is a pure number. The values are computed from a series written for this page rather than from a platform library, because the language provides none.

Frequently asked questions

What is the error function used for?
Measuring how much of a gaussian curve lies between the centre and a given point, which is the same thing as a probability in a standard normal distribution. The value at x = 1 is 0.842701, and adding one and halving it gives 0.921351, the probability of a standard normal variable falling within one standard deviation of the mean on both sides.
What is erfc and how does it relate to erf?
It is the complementary error function, defined as one minus the error function, so the two readings on this page always sum to exactly 1. It exists as a separate function rather than as an afterthought because it is the one you want for large inputs: at x = 4 the error function has flattened onto 1 and only the complement still carries the information.
Why can I not enter a value larger than six?
Because past six there is nothing left to measure. The true value at x = 6 is 1 minus about 2 × 10⁻¹⁷, and a double cannot tell that apart from 1, so the error function column would print 1 and the complement would print exactly zero. The limit is a statement about what can be represented, not about how hard the calculation is — the series converges in about two hundred terms there.
Why does the complement stop being accurate for large inputs?
Because it is worked out by subtraction. When the error function is 0.99999999999846256, subtracting it from one leaves only a few significant digits, and everything before them is cancellation noise. The true complement at x = 5 is 1.5374598 × 10⁻¹² and this page returns 1.5364 × 10⁻¹². The error function itself does not suffer from this, and it is the main reading for that reason.
Can I get the normal distribution probability here instead?
Not directly, and the page deliberately does not offer it. The standard normal distribution function is built from the error function by adding one and halving, but the normal distribution calculator takes a mean and a standard deviation as well as a value and reports the probability directly — which is a better answer to that question than a standardised figure would be.

References

Related calculators