Scientific Computing

This module demonstrates the tradeoff between rounding error and
truncation error when using finite-precision, floating-point arithmetic.
The specific problem is computing the change in the surface area *A*
of the Earth if its radius *r* = 6371 km*Δr*. Two different formulas are used, one
from geometry,
*ΔA* = 4 *π* (*r + Δr*)^{2}
− 4 *π r* ^{2}*exact* (assuming perfect real arithmetic), and the other a simple
*approximation* derived from calculus,
*ΔA* ≈ 8 *π r Δr*

The user first selects the precision to be used in the calculation, from one to sixteen decimal digits, and then selects an amount by which the Earth's radius is changed by dragging or clicking on the vertical scale. The number of correct digits in the results produced by the two formulas is indicated by the red (exact) and blue (approximate) bars.

**Reference:** Michael T. Heath,
*Scientific Computing,
An Introductory Survey*, 2nd edition, McGraw-Hill, New York,
2002. See Section 1.2, especially Example 1.1 on page 5 and Exercise
1.9 on page 43.

**Developers:** Nicholas Exner, Michael Ham, and Michael Heath