Level 1c: complex level 1, Keystrokes display – HP 15c User Manual

Page 153

Advertising
background image

Appendix: Accuracy of Numerical Calculations

153

Keystrokes

Display

-

011- 30

Calculates u − 1 when u≠1.

÷

012- 10

Calculates x/(u − 1) or 1/1.

*

013- 20

Calculates λ(x).

|n

014- 43 32

The calculated value of u, correctly rounded by the HP-15C, is u=(1+ε)(1+x), where |ε|
<5×10

-10

. If u=1, then

|x| = |1/(1+ε)-1| ≤ 5×10

-10

too, in which case the Taylor series λ(x) = x (1 − ½ x + ⅓ x

2

− ... ) tells us that the correctly

rounded value of λ(x) must be just x. Otherwise, we shall calculate x λ (u 1)/(u − 1) fairly
accurately instead of λ (x). But λ(x)/x = 1 − ½ x + ⅓ x

2

−... varies very slowly, so slowly that

the absolute error λ (x)/ x λ (u − 1)/(u − 1) is no worse than the absolute error
x - (u − 1) = −ε(1+ x), and if x≤1, this error is negligible relative to λ (x)/x. When x> 1, then
u − 1 is so nearly x that the error is negligible again; λ (x) is correct to nine significant digits.

As usual in error analyses, the explanation is far longer than the simple procedure being
explained and obscures an important fact: the errors in ln(u) and u − 1 were ignored during
the explanation because we knew they would be negligible. This knowledge, and hence the
simple procedure, is invalid on some other calculators and big computers! Machines do exist
which calculate ln(u) and/or 1 − u with small absolute error, but large relative error when u is
near 1; on those machines the foregoing calculations must be wrong or much more
complicated, often both. (Refer to the discussion under Level 2 for more about this.)

Back to Susan's sum. By using the foregoing simple procedure to calculate
λ (i/n) = ln(1 + i/n) = 3.567351591× 10

-9

, she obtains a better value:

119072257

.

1

1

n

i

n

e

n

n

i

from which the correct total follows.

To understand the error in 3

201

, note that this is calculated as e

201ln(3)

= e

220.821...

. To keep the

final relative error below one unit in the 10th significant digit, 201 ln(3) would have to be
calculated with an absolute error rather smaller than 10

-10

, which would entail carrying at

least 14 significant digits for that intermediate value. The calculator does carry 13 significant
digits for certain intermediate calculations of its own, but a 14th digit would cost more than
it's worth.

Level 1C: Complex Level 1

Most complex arithmetic functions cannot guarantee 9 or 10 correct significant digits in each
of a result's real and imaginary parts separately, although the result will conform to the
summary statement about functions in Level 1 provided f, F, and ε are interpreted as complex

Advertising