HP -15C Advanced Functions Handbook page 195

Hide thumbs Also See for HP-15C:
Table of Contents

Advertisement

Appendix: Accuracy of Numerical Calculations
193
has no singularity at x — 0 even though its constituents 1 — cos x
and x
2
(actually, their logarithms) do behave singularly as x
approaches 0. The constituent singularities cause trouble for the
program that calculates c(x). Most of the trouble is neutralized by
the choice of a better formula
if x 72^0
otherwise.
Now the singularity can be avoided entirely by testing whether
x/2 = 0 in the program that calculates c(x).
Backward error analysis complicates singularities in a way that is
easiest to illustrate with the function X(^) = ln(l + x) that solved
the savings problem in example 2. The procedure used there
calculated u = I + x (rounded) = 1 + x + Ax. Then
x
if u — 1
ln(u) x / ( u — 1)
otherwise.
This procedure exploits the fact that \(x)/x has a removable
singularity at x = 0, which means that \(x)/x varies continuously
and approaches 1 as x approaches 0. Therefore, K(x)/x is relatively
closely approximated by \(x + A x ) / ( x + Ax) when | Ax\ 10~
9
, and
hence
\(x) — x(\(x)/x)« x(\( x + A x ) / ( x + Ax)) = x(\n(u)/(u- 1)),
all calculated accurately because |LN| is in Level 1. What might
happen if | LN [were in Level 2 instead?
If | LN | were in Level 2, then "successful" backward error analysis
would show that, for arguments u near 1, | LN \(u) = \n(u + 8u) with
\du\ 1CT
9
. Then the procedure above would produce not
x(ln( u + 5u)/(u- 1)) = xk(x + AJC + 8u)/(x + Ax)
= x(\(x + Ax + 8u)/(x + Ax + du))
x + Ax
x(\(x)/x)(l + d u / ( x + Ax))

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents