Errors in numerical computing

Why every numerical solution is approximate, the two error families (round-off and truncation) and how to measure it: numerical, percentage and iterative error.

Every numerical solution is approximate

Some problems have a simple analytic solution: x2+2x3=0x^2+2x-3=0 is solved by hand and gives x{3,1}x\in\{-3,\,1\}. But others, seemingly harmless, do not: xex=0x-e^{-x}=0 cannot be solved in closed form, even though its solution is near x0.568x\approx 0.568.

When there is no formula, we use numerical methods, which give an approximate solution as good as the available computation allows. Approximation incurs error, and it helps to classify it.

  • Round-off error: from having a finite number of symbols to represent a result.
  • Truncation error: from using a numerical method instead of an exact mathematical procedure.

Numerical and percentage error

The numerical error depends on units: a 1 mm error does not mean the same for a screw as for a bridge. Hence it is complemented by the percentage error, which relativizes it to the size of the true value.

Iterative error

In iterative methods we often lack the true solution, so we cannot use the previous definitions. Instead we measure how much the solution changes between two consecutive iterations.