Re: Floating point optimizations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 5, 2008 at 9:06 AM, NightStrike <nightstrike@xxxxxxxxx> wrote:
>  Wait, so are things like "c - (c - a)" optimized down to "a" or not?  I
>  use a lot of that in very time-intensive c++ code.
>

I think only if you tell it to be loose with requirements for applying
floating-point math optimizations (-ffast-math and related), since
DBL_MAX - (DBL_MAX-1) is, to the best of my knowledge, 0 --- not 1 ---
in IEEE math.

On the other hand, I managed to get >1 by adding DBL_EPSILON/10 to 1.0
repeatedly (though only on 1 of 4 computers on which I tried it) so my
intuitions could all be wrong.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux