Métodos Numéricos (Freitas) VIII: Erros de Arredondamento e PropagaçãoTextbook
Motivation
Every numerical computation is performed in a finite arithmetic: a real number is stored with a fixed number of decimal digits, and each stored value carries an error. Before any method is analysed, a course in numerical methods has to say how large that error can be and how it grows when approximate values are combined. The answers are the two rounding bounds — for truncation and for symmetric rounding with digits — and the propagation formulas for sums, products and quotients.
This mission is the eighth in a series formalizing the lecture notes Métodos Numéricos by Sergio Roberto de Freitas (UFMS, 2000). It covers Chapter 2, Erros.
Setting
Every nonzero real can be written in normalized decimal form with retained digits,
where is the decimal exponent of and its normalized mantissa.
Truncated rounding keeps , discarding the tail; the error is .
Symmetric rounding keeps when and when ; this is the familiar school rule of rounding the -st digit up when it is at least .
If approximates and approximates , the absolute errors are and , and the chapter computes the error of the four arithmetic operations in terms of them.
Target
The goal theorem is Proposição 2.4.3: with symmetric rounding to digits, the relative error of a stored positive number satisfies
The milestones are the companion bound for truncated rounding, (Proposição 2.4.2), and the propagation identities of §2.5.1 for the sum and difference, for the product and for the quotient.
Significance
These bounds are the unit of account for every later error analysis: the machine epsilon of a -digit decimal arithmetic is exactly the constant appearing in the goal, and the factor two between truncation and symmetric rounding is the reason the latter is the default. The propagation identities explain the two classical failure modes of floating-point computation — cancellation in a difference of nearly equal numbers, where the absolute errors survive while the result shrinks, and the amplification of a relative error by division by a small number.
Difficulty
The difficulty is entirely in the normalization. The bounds follow from two facts about the decimal decomposition — that the discarded part is at most one unit in the last retained place, and that the retained part is at least — and both have to be derived from the definition of the decimal exponent through the floor function and the logarithm, including the boundary case where is an exact power of ten and the case where symmetric rounding carries into a new leading digit. The propagation statements, by contrast, are algebraic identities.
Formalization scope
The decimal exponent is defined as , and the two roundings are defined by scaling by , applying the floor function (with an added in the symmetric case, so that halves round up) and scaling back. This is a total definition for every real number; the theorems are stated for and , which is the situation the source describes, and no claim is made about negative arguments or about .
Two points of deviation should be checked by the auditor. First, the source states both bounds with a strict inequality; for symmetric rounding equality is attained when the discarded tail is exactly one half unit in the last place, so the formal statement uses a non-strict inequality, while the truncation bound remains strict. Second, the propagation formulas for the product and the quotient are stated here as exact identities: the source's versions drop the second-order term and the higher terms of a geometric series, which is a legitimate approximation but not an equality.
Selected references
- S. R. Freitas, Métodos Numéricos, Departamento de Computação e Estatística, Universidade Federal de Mato Grosso do Sul, 2000. Chapter 2, Erros, pp. 17–31. (Course notes supplied with this mission.)