Documente Academic
Documente Profesional
Documente Cultură
Definition 1. The machine numbers represented in the normalized decimal floating-point form
0.d1 d2 . . . dk 10n ,
1 d1 9,
0 di 9 for i = 2, . . . , k,
are called k-digit decimal machine numbers. Consider a number of the normalized decimal form
y = s(0.d1 d2 . . . dk dk+1 . . .) 10n
d1 6= 0.
|pp |
|p | .
Definition 3. Let a (p, p ) > 0 such that |ea (p, p )| a (p, p ) is the (upper) bound for the absolute
error. We write p = p e for |e| a (p, p ) or simply p = p a (p, p ). Likewise, r (p, p ) > 0
such that |er (p, p )| r (p, p ) is the (upper) bound for the relative error, written as p = p (1 ) for
|| r (p, p ) or simply p = p (1 r (p, p )).
Remark: To simplify the notation without confusion of the context, we simply write a , r , ea , er .
Definition 4. The number p is said to approximate p to t significant digits (or figure) if t is the
largest nonnegative integer for which er (p, p ) 5 10t .
Remark: this definition is consistent with the number of decimal digits to be accurate.
Example 2. Let p = 0.12345 . . . and p = 0.123. Since er (p, p ) =
significant digits.
0.45...103
0.12345...
y f lc (y) (0.dk+1 . . .) 10nk
=
er =
y
(0.d1 . . .) 10n
0.5
10k = 5 10k
0.1
which implies that k-digit chopping will keep k significant digits. If dk+1 5, then
er
er
1
10k = 10k+1 < 5 10k+1
0.1
Finite-digit arithmetic
Let , , and
represent machine addition, subtraction, multiplication and division.
xy = f l(f l(x)+f l(y)) x y = f l(f l(x)f l(y)) xy = f l(f l(x)f l(y)) x
y = f l(f l(x)f l(y)).
Example 4. Let x =
2
3
Then
f l(f l(x) f l(y)) = 0.p+1 p+2 . . . k 10np = (0.p+1 . . . k 0.p+1 . . . k ) 10np
x y has at most k p significant digits. In most machines, x y will be assigned k-significant digits
with last p digits either 0 or randomly assigned.
2