Denote by RD(f) and RU(f) the computed approximation obtained by evaluating the function f in floating-point arithmetic with rounding downwards and rounding upwards, respectively.
Assume we know from rounding error analysis that
| RD(f)- f | < E, and
| RU(f)- f | < E
What is the bound for the difference between RD(f) and RU(f),
| RD(f)- RU(f) | < E, or
| RD(f)- RU(f) | < 2E ?
[UPD] In addition to the comments:
Consider a "toy" decimal floating point system with p = 4
(precision, the total number of digits in the significand, including one digit to the left of the radix point) and with an unbounded exponent. For this system, the unit roundoff, u
, is defined as follows:
u = 1/2 * 10^{1-4} = 0.0005
for round to-nearest-mode,
u = 10^{1-4} = 0.001
for any of the directed rounding modes.
Let us suppose f = (1.324/1.567 + 1.641/1.878)
needs to be computed in the such system.
Exact value of f
is 1.7187285282921926...
.
The error analysis shows that
| RD (f) - f | <= E
, and
| RU (f) - f | <= E
,
where E = n * u * (|1.324/1.567| + |1.641/1.878|)
,
and, as noted above, u = 0.001
.
So,
E = 2 * 0.001 * 1.7187285282921926 = 0.0034374570565843852
(this is a bit rough estimate, because f
was rounded).
Let us now calculate RD(f)
and RF(f)
:
RD(f) = RD(0.8449266113592853 + 0.8738019169329073) = RD(0.844 + 0.873) = 1.717
RU(f) = RU(0.8449266113592853 + 0.8738019169329073) = RU(0.845 + 0.874) = 1.719
So,
|RD(f) - f| = 0.0017285282921926
|RU(f) – f| = 0.0002714717078074
and
|RD(f) - RU(f)| = 0.002 < 0.0034374570565843852
From this I suppose that |RD(f) - f| = E
only if |RU(f) – f| = 0
, and vice versa. Thus,
|RD(f) - RU(f)| <= E.
Or is something wrong in this example?
a/b
where the quotient is in [1/10, 1) is u / 10, not u, since the quotients have a lower exponent than 1 does. Additionally, it appears only the two division operations have been considered, but the addition has a rounding error too, particularly since the sum has a larger exponent (0) than the two things being added (both −1). Also, one cannot simply multiply the number of operations n by the “unit roundoff” u, since the “unit roundoff” varies with the result exponent. – Eric Postpischil