HuntsvilleEngineers mark
HE Reference Shelf — huntsvilleengineers.com
The Reference Shelf · Analysis & Transforms

Error function

The error function is the running area under a bell curve — hand it a distance from center in the right units and it hands back the probability of landing inside that distance.

Also known as: erf · erfc · complementary error function · Q-function · Gaussian integral

The formula

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

Read: integrate the Gaussian bump from zero out to x, scaled so the answer runs from 0 at x = 0 to 1 as x → ∞ [1].

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

Read: the leftover tail — the probability mass beyond x. Small when x is large, and the number you usually actually want.

Q(x) = ½ · erfc(x/√2)

Read: the comm-engineer's version. Q(x) is the probability a standard-normal variable exceeds x sigma; the √2 converts between the mathematician's units and sigma units.

P(|X| ≤ k·σ) = erf(k/√2)

Read: the two-sided version. Plug in k = 1, 2, 3 and you get 68.27%, 95.45%, 99.73% — the numbers on the wall of every quality office.

Where you meet it

  • BER on the bench. BPSK in additive white Gaussian noise has bit-error rate BER = Q(√(2·Eb/N0)) [3][4]. At Eb/N0 = 9.6 dB that comes out to 9.7·10⁻⁶ — the reason "9.6 dB for 10⁻⁵" is muscle memory for anyone who's run a BERT against a satellite modem. Every waterfall curve in a link-budget review is an erfc in disguise.
  • Tolerance yield at the review board. A dimension centered in its tolerance band with the limits k sigma out yields erf(k/√2) good parts. The famous Six Sigma figure of 3.4 defects per million is just Q(4.5) = 3.4·10⁻⁶ — six sigma of design margin minus the conventional 1.5-sigma allowance for long-term process drift.
  • Transient heating of a thick part. Slap a sudden surface temperature T_s onto a semi-infinite solid initially at T_i and the interior follows (T(x,t) − T_s)/(T_i − T_s) = erf( x / (2·√(α·t)) ) where α is thermal diffusivity [8]. If you've ever estimated how long a test article's bondline stays cool during a thermal soak, you've used this whether you knew its name or not.
  • False-alarm thresholds. Set a threshold n sigma above the noise floor on a real Gaussian-distributed sample — a baseband anomaly monitor, a limit check on a telemetry channel — and the false-alarm probability is Q(n) per sample [3]. One caution before you quote that at a radar review: an envelope detector sees the magnitude of complex Gaussian noise, which is Rayleigh, and there Pfa = e^(−n²/2) — at n = 4 that is 3.4·10⁻⁴, an order of magnitude worse than Q(4) = 3.2·10⁻⁵. The erfc form governs before detection; either way, the threshold argument at the design review is an argument about where to sit on a Gaussian tail.

How it works

The Gaussian e^(−t²) has no elementary antiderivative — no combination of polynomials, exponentials, and trig functions integrates it. That is not a gap in your calculus; it is a theorem. So the integral got a name instead of a formula, the same move that gave us sin and log. Every normal-distribution probability you have ever computed came from a series, a rational approximation, or a table wearing erf's name.

Behavior in brief: erf is odd (erf(−x) = −erf(x)), passes through zero with slope 2/√π ≈ 1.128, and saturates fast. erf(1) = 0.8427, erf(2) = 0.99532, and by x = 3 you are at 0.99998. All the engineering action is in the tail, which dies like e^(−x²) — faster than any exponential. That double-exponent decay is why one more dB of link margin or one more sigma of tolerance buys orders of magnitude, not percent.

For hand estimates the two ends are:

small x:  erf(x) ≈ (2/√π)·(x − x³/3 + x⁵/10 − ...)
large x:  erfc(x) ≈ e^(−x²) / (x·√π)

The small-x series is honest: at x = 0.1 the first term alone gives 0.11284 against a true 0.11246. The large-x form is a diverging asymptotic series cut at its first term — at x = 3 it reads 5% high (2.32·10⁻⁵ vs 2.21·10⁻⁵), at x = 2 about 10% high. Fine for sizing margin, not for quoting a spec.

Two mistakes account for most erf-related grief:

  1. The √2 problem. erf's natural variable is not sigma. The probability of being within k sigma is erf(k/√2), not erf(k). Type erf(1) expecting 68% and you get 84% — a wrong yield number that survives review because it looks plausible. If your tool offers Q(x) or normcdf, use those and let the library keep track of the √2.
  2. Computing 1 − erf(x) at large x. In double precision erf(6) rounds to exactly 1, so 1 − erf(6) returns zero — when the true tail is 2.15·10⁻¹⁷. Your predicted BER becomes 0, which is a number no honest link budget contains. Every serious math library ships erfc as a separate function precisely so the tail is computed directly. Call it.

One more caution: the clean Gaussian tail is a model, and real hardware tails are usually fatter — burst interference, quantization, temperature drift. erfc tells you the floor your noise budget permits, not the floor your system will achieve. When measured BER flattens above the theoretical waterfall, the math is not wrong; the noise just stopped being Gaussian.

History

The curve came first and the name came a century and a half later. Abraham de Moivre found the bell shape in 1733 while approximating binomial probabilities for very many coin flips — a computational shortcut, published in a Latin pamphlet, that turned out to be the shape of measurement error itself [6][7]. Laplace and Gauss built the theory of errors on it, and Gauss's 1809 orbit-fitting work fixed the exact integral ∫ e^(−x²) dx = √π in print [7].

The christening happened in 1871 — and it happened backwards. J. W. L. Glaisher — Trinity College Cambridge, second wrangler, son of a balloonist meteorologist who calibrated instruments against that same error law — published "On a Class of Definite Integrals" in the Philosophical Magazine, argued that this particular unintegrable integral deserved to graduate to a named function, and proposed "Error-function," written Erf, for its connection to the theory of errors [2][5]. But his original Erf was the bare tail, ∫ₓ^∞ e^(−t²) dt — the shape we now call erfc — while his "Error-function complement," Erfc, was the integral from 0 to x, the two summing to √π/2 [5]. Glaisher himself soon conceded the notation "was not well chosen," since it is the 0-to-x integral that actually arises in the theory of errors, and interchanged the two symbols shortly afterward [5]. The 2/√π normalization that makes erf run from 0 to 1 came later still — older texts show the bare integral [2][5]. Within a few years Glaisher was applying his function to Francis Galton's "ogive" of ranked human measurements, putting an analytical spine under early statistics [5]. The Q-function arrived in the twentieth century as the communications trade's repackaging of the same tail [3].

Related tools

Sources

  1. https://dlmf.nist.gov/7.2
  2. https://en.wikipedia.org/wiki/Error_function
  3. https://en.wikipedia.org/wiki/Q-function
  4. https://en.wikipedia.org/wiki/Bit_error_rate
  5. https://galton.org/Pritchard/Early_History_of_the_Ogive.pdf
  6. https://mathshistory.st-andrews.ac.uk/Biographies/De_Moivre/
  7. https://en.wikipedia.org/wiki/Gaussian_integral
  8. https://dlmf.nist.gov/7.21

Written by HE in our own words from the cited sources — engineering judgment included, your stamp still required. All entries →

★ The Reference Shelf

Reading is free. The shelf is for cardholders.

Your library card is an email address: pin it to your shelf, print the card, take the FE/PE quick-reference pack, read the Huntsville history. The shelf remembers what you reach for.

Already on the list? Enter with your subscribed email →