more Re: [std-interval] list of functions for intervals
Guillaume Melquiond
guillaume.melquiond at ens-lyon.fr
Mon Jun 5 23:01:52 PDT 2006
Le lundi 05 juin 2006 à 14:43 -0500, R. Baker Kearfott a écrit :
> Picking up on your "digression," I don't see how multiplying four positive
> intervals and getting an interval containing negative numbers as
> a result is related to cset arithmetic. Isn't this related to
> the definition of interval multiplication, which, for finite intervals,
> is the same as the old-fashioned definition of multiplication
> of intervals? That is, isn't this a quality of implementation issue?
> (Lower bounds that are positive but rounded down should be rounded
> down to exactly zero, and a result that is exactly zero shouldn't
> be rounded down. Isn't that what IEEE-754 does?) Otherwise, are
> you thinking of an example with infinite end points that I missed?
Yes, an infinite end-point is involved. But this is unfortunately easy
to obtain because of rounding. For example,
interval<double>
a(1.3e-200, 5), b(2.7e-150, 8), c(0.8, 4.2e100), d(17, 7.3e250),
e = (a * b) * (c * d);
The lower bound of a * b is rounded to zero and the upper bound of c * d
is rounded to infinity in double precision floating-point arithmetic. As
a consequence, their product e will contain negative values. Indeed the
cset of 0*inf contains -inf; hence e is forced to include the whole
extended real line. Without rounding (e.g. with rational bounds),
interval e would have contained only positive and finite values. With
rounding and without cset, interval e would have been [0,+inf).
By reverting the bounds, it is possible to distinguish between
overflowed infinities and real infinities (I think there is a paper by
Hickey on this subject) and hence prevent this issue. But interval
computations will get a bit expensive because of this trick.
Best regards,
Guillaume
More information about the Std-interval
mailing list