|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5.
Rounding and truncation
|
|
|
|
ä |
Let
fl(x) be the floating point representation of
|
|
|
the
real value x
|
|
|
|
ä |
fl(
x ) = x (1 + epsilon), where epsilon is a small
|
|
error
multiplier, that depends on the exponent
|
|
|
|
ä |
Consider
an n bit effective mantissa
|
|
|
|
ä |
Truncation
|
|
|
|
ä |
-2-n <= epsilon <= 0
|
|
|
|
|
|
ä |
Note
error is always negative
|
|
|
|
ä |
Rounding
|
|
|
|
ä |
-2-(n+1) <= epsilon <= 2-(n+1)
|
|
|
|
|
|
ä |
Error
is sometimes -ve, sometimes +ve
|
|
|
6.
Comparison
|
|
|
|
ä |
Truncation
error can be twice as large and
|
|
|
always
negative (bad - results are skewed)
|
|
|
|
ä |
Rounding
errors may even out over calculations
|
|