Numerical Linear Algebra

floating-point arithmetic

On paper a real number can have infinitely many digits. A computer cannot store that, so it keeps only a fixed number of significant digits and an exponent — like scientific notation in binary. The result is floating point: each number is rounded to the nearest representable value, and there are gaps between consecutive representable numbers. This is why computed linear algebra is never quite the same as exact linear algebra.

The key constant is machine epsilon, often written eps or u, the gap between 1 and the next representable number (for IEEE double precision, eps is about 2.2e-16, giving roughly 16 decimal digits). Each elementary operation obeys fl(a op b) = (a op b)(1 + delta) with |delta| <= u: every individual addition, multiplication, or division is computed to nearly full relative accuracy, but the tiny errors accumulate across an algorithm.

Two consequences shape everything downstream. First, floating-point addition is not associative — (a + b) + c can differ from a + (b + c) — so the order of operations matters. Second, subtracting two nearly equal numbers causes catastrophic cancellation: the leading digits agree and cancel, exposing previously hidden rounding noise as the leading digits of the answer.

The practical lesson is humility. A computed answer x-hat is not the exact answer x; the gap is governed by how many operations you do, how they are arranged, and how sensitive the problem is (its condition number). Good numerical algorithms are designed so that this unavoidable rounding does as little damage as possible.

fl(a op b) = (a op b)(1 + delta), |delta| <= u, u ~ 1.1e-16 (double)

The standard model of floating-point arithmetic: each operation is exact up to a tiny relative perturbation bounded by the unit roundoff u.

Machine epsilon is about representation, not about how big errors get. A single algorithm can lose many digits even though each step is accurate to within eps — the losses come from cancellation and from an ill-conditioned problem, not from a single rounding.

Also called
machine arithmeticIEEE 754 arithmetic