User Manual

145
Appendix:
Accuracy of Numerical Calculations
Misconceptions About Errors
Error is not sin, nor is it always a mistake. Numerical error is merely the difference between
what you wish to calculate and what you get. The difference matters only if it is too big.
Usually it is negligible; but sometimes error is distressingly big, hard to explain, and harder
to correct. This appendix focuses on errors, especially those that might be largehowever
rare. Here are some examples.
Example 1: A Broken Calculator. Since
xx
2
)(
whenever x ≥ 0, we expect also
2
2
2
2
)(
xxf
should equal x too.
A program of 100 steps can evaluate the expression f(x) for any positive x. When x = 10 the
HP-15C calculates 1 instead. The error 10 1 = 9 appears enormous considering that only
100 arithmetic operations were performed, each one presumably correct to 10 digits. What
the program actually delivers instead of f(x) = x turns out to be
,10for0
1for1
)(
x
x
xf
which seems very wrong. Should this calculator be repaired?
Example 2: Many Pennies. A corporation retains Susan as a scientific and engineering
consultant at a fee of one penny per second for her thoughts, paid every second of every day
for a year. Rather than distract her with the sounds of pennies dropping, the corporation
proposes to deposit them for her into a bank account in which interest accrues at the rate of
11¼ percent per annum compounded every second. At year's end these pennies will
accumulate to a sum
ni
ni
n
11
)payment(total
50
roots
50
squares