Trigonometric functions of real radian angles – HP 15c User Manual
Page 154
154
Appendix: Accuracy of Numerical Calculations
154
numbers. In other words, every complex function f in Level 1C will produce a calculated
complex value F = (1 + ε) f whose small complex relative error ε must satisfy |ε| < 10
-9
. The
complex functions in Level lC are *,÷,x,N,o,,,{,/,
H[, H\, and H]. Therefore, a function like λ(z) = ln(1+z) can be
calculated accurately for all z by the same program given above with the same explanation.
To understand why a complex result's real and imaginary parts might not individually be
correct to 9 or 10 significant digits, consider *, for example: (a + ib) × (c + id) = (a
c
− bd)
+ i(ad + bc) ideally. Try this with a = c = 9.999999998, b = 9.999999999, and d =
9.999999997; the exact value of the product's real part (ac
− bd) should then be
(9.999999998)
2
− (9.999999999)(9.999999997)
= 99.999999980000000004 − 99.999999980000000003
= 10
-18
which requires that at least 20 significant digits be carried during the intermediate
calculation. The HP-15C carries 13 significant digits for internal intermediate results, and
therefore obtains 0 instead of 10
-18
for the real part, but this error is negligible compared to
the imaginary part 199.9999999.
Level 2: Correctly Rounded for Possibly Perturbed Input
Trigonometric Functions of Real Radian Angles
Recall example 3, which noted that the calculator's $
key delivers an approximation to π
correct to 10 significant digits but still slightly different from π, so 0 = sin(π) ≠ sin ($) for
which the calculator delivers
[($) = −4.100000000×10
-10
.
This computed value is not quite the same as the true value
sin($) = −4.10206761537356…×10
-10
.
Whether the discrepancy looks small (absolute error less than 2.1 × 10
-13
) or relatively large
(wrong in the fourth significant digit) for a 10-significant-digit calculator, the discrepancy
deserves to be understood because it foreshadows other errors that look, at first sight, much
more serious.
Consider
10
14
π = 314159265358979.3238462643…
with sin(10
14
π) = 0 and
10
14
Ч $ = 314159265400000