Keystrokes display – HP 15c User Manual

Page 167

Advertising
background image

Appendix: Accuracy of Numerical Calculations

167

Keystrokes

Display

¤

085- 11

*

086- 20

l0

087- 45 0

|:

088- 43 1

|~

089- 43 20

÷

090- 10

®

091- 34

v

092- 36

+

093- 40

|n

094- 43 32

The results F

C

(p, q , r) are correct to at least nine significant digits. They are obtained from a

program "C" that is utterly reliable though rather longer than the unreliable programs "A" and
"B". The method underlying program "C" is:

1. If p < q, then swap them to ensure p ≥ q.

2. Calculate b=(pq)+r, c=(pr)+q, and s=(p+r)+q.

3. Calculate

exists).

triangle

(no

otherwise

0

if

)

(

0

if

)

(

0

Error

q

r

r

p

q

r

q

q

p

r

a

4. Calculate F

C

(p, q, r) = 2 tan

-1

(

cs

ab

).

This procedure delivers F

C

(p, q, r) = θ correct to almost nine significant digits, a result surely

easier to use and interpret than the results given by the other better-known formulas. But this
procedure's internal workings are hard to explain; indeed, the procedure may malfunction on
some calculators and computers.

The procedure works impeccably on only certain machines like the HP-15C, whose
subtraction operation is free from avoidable error and therefore enjoys the following
property: Whenever y lies between x/2 and 2x, the subtraction operation introduces no
roundoff error into the calculated value of x y. Consequently, whenever cancellation might
leave relatively large errors contaminating a, b, or c, the pertinent difference (p q) or (p r)
turns out to be free from error, and then cancellation turns out to be advantageous!

Cancellation remains troublesome on those other machines that calculate (x +δx) − (y + δy)
instead of x y even though neither δx nor δy amounts to as much as one unit in the last
significant digit carried in x or y respectively. Those machines deliver F

C

(p, q, r) = f(p + δp,

q + δq, r + δr) with end-figure perturbations δp , δq, and δr that always seem negligible from
the viewpoint of backward error analysis, but which can have disconcerting consequences.
For instance, only one of the triples (p, q, r) or (p + δp, q + δq, r + δr), not both, might

Advertising