This is the mail archive of the
mailing list for the GCC project.
Re: Fourth Draft "Unsafe fp optimizations" project description.
- To: Kai Henningsen <kaih at khms dot westfalen dot de>
- Subject: Re: Fourth Draft "Unsafe fp optimizations" project description.
- From: Stephen L Moshier <moshier at mediaone dot net>
- Date: Wed, 15 Aug 2001 09:14:50 -0400 (EDT)
- cc: gcc at gcc dot gnu dot org
- Reply-To: moshier at moshier dot ne dot mediaone dot net
>ejr@CS.Berkeley.EDU (Jason Riedy) wrote on 12.08.01 in
>> For a simpler
>> view, does anyone really want to debug programs where
>> you cannot rely on equality?
>If there's one thing I've seen or heard in just about *every*
>discussion of computer floating point, it is that you cannot rely on
>equality. Just about every single one makes the point that with
>floating point, "A == B" is *wrong*, you want "abs(A-B) < some_small_value".
> MfG Kai
IEEE tries to improve on that situation, and the point was that in
flush-to-zero arithmetic comparison of very small numbers is somewhat
problematic. If you take A==B to mean bit-for-bit identity, then you
have many pairs A != B yet A - B == 0. If you take A - B = 0
as the definition of A == B, then there are still many pairs
that are not bit-for-bit identical yet they compare equal.
Whatever the IEEE 754 committee may say about it, however, the fact is
that vendors are going to continue to offer flush to zero machines
because there are good engineering reasons to do so. It would be most
helpful if the committee would seek to determine and codify the
industry practice. It will be much less helpful if the committee
comes out with unpracticed rules that the industry is going to ignore
as it has already done in the past.