EasyManua.ls Logo

HP HP-15C

HP HP-15C
224 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Appendix:
Accuracy
of
Numerical
Calculations
195
for
the
figure
shown below. Engineering
and
scientific calculations
often
require
that
the
angle
6
be
calculated
from
given values
p,
q,
and r for the
length
of the
triangle's
sides.
This
calculation
is
feasible
provided
0
<p^q
+ r,
0<q^p
+ r,
andO
^
r^p
+
q,
and
then
cos-\((p2
+
q2)
-
otherwise,
no
triangle
exists with those side lengths,
or
else
Q
= 0/0
is
indeterminate.
The
foregoing formula
for
6
defines
a
function
6
f(p,q,r)
and
also
in a
natural way,
a
program F(p,q,r) intended
to
calculate
the
function.
That
program
is
labeled
"A"
below,
with results
FA(p,q,r)
tabulated
for
certain inputs
p, q, and r
corresponding
to
sliver-shaped
triangles
for
which
the
formula
suffers
badly
from
roundoff.
The
numerical unreliability
of
this
formula
is
well
known
as is
that
of the
algebraically equivalent
but
more reliable formula
6
=
f(p,q,r)
2
ian~l\fab/(cs),
where
s = (p + q +
r)/2,
a
s
p,
b
=
s
q, and c = s
r.
Another program
F(p,q,r)
based upon
this
better
formula
is
labeled
"B"
below,
with results
FB(p,q,r)
for
selected
inputs. Apparently
FB
is not
much more reliable
than
FA.
Most
of the
poor results could
be
explained
by
backward error
analysis
if we
assume
that
the
calculations yield F(p,q,r)
f(p
+
6p,q
+
8q,r
+ 8r) for
unknown
but
small perturbations
satisfying
\5p\
10~9|p|
,
etc. Even
if
this
explanation were true,
it
would
have perplexing
and
disagreeable consequences, because
the
angles
in
sliver-shaped triangles
can
change relatively drastically
when
the
sides
are
perturbed relatively slightly; f(p,q,r)
is
relatively
unstable
for
marginal inputs.
Actually
the
preceding explanation
is
false.
No
backward error
analysis
could
account
for the
results tabulated
for
FA
and
FB
under
case
1
below
unless perturbations
8p,
8q, and
8r
were
allowed
to
corrupt
the
fifth
significant digit
of the
input, changing
1 to
1.0001
or
0.9999
.
That
much
is too
much noise
to
tolerate
in a
10-digit
calculation.
A
better program
by far is
Fc,
labeled
"C" and
explained
shortly afterwards.

Table of Contents

Other manuals for HP HP-15C

Related product manuals