HP 15c User Manual

Page 174

Advertising
background image

174

Appendix: Accuracy of Numerical Calculations

174

The results of several cases are summarized below.

Case 1

Case 2

Case 3

Case 4

c

3

4

1

654,321

b

2

0

1

654,322

a

1

1

10

-13

654,323

Roots

Real

Complex

Real

Real

3

0 ± 2i

2 × 10

13

0.9999984717

1

0.5

0.9999984717

Case 5

Case 6

c

46,152,709

12,066,163

b

735,246

987,644

a

11,713

80,841

Roots

Real

Complex

62.77179203

12.21711755 ± i0.001377461

62.77179203

The last three cases show how severe are the results of perturbing the 10th significant digit of
any coefficient of any quadratic whose roots are nearly coincident. The correct roots for these
cases are

Case 4:

1 and 0.9999969434

Case 5:

62.77179203 ± i 8.5375×10

-5

Case 6:

12.21711755 ± i 0.001374514

Despite errors in the fifth significant digit of the results, subroutine "A" suffices for almost
all engineering and scientific applications of quadratic equations. Its results are correct to
nine significant digits for most data, including c, b, and a representable exactly using only
five significant digits; and the computed roots are correct to at least five significant digits in
any case because they cannot be appreciably worse than if the data had been entered with
errors in the 10th significant digit. Nonetheless, some readers will feel uneasy about results
calculated to 10 significant digits but correct to only 5. If only to simplify their understanding
of the relationship between input data and output results, they might still prefer roots correct
to nine significant digits in all cases.

Programs do exist which, while carrying only 10 significant digits during arithmetic, will
calculate the roots of any quadratic correctly to at least nine significant digits regardless of
how nearly coincident those roots may be. All such programs calculate d = b

2

ac by some

trick tantamount to carrying 20 significant digits whenever b

2

and ac nearly cancel, so those

programs are a lot longer and slower than the simple subroutine "A" provided above.

Advertising