Re: Floating point problems (accuracy).

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

 




James E Wilson wrote:
Phil Prentice wrote:
We are having a few problems regarding floating point inaccuracies under Linux. Please see the code below.

This is PR 323 in our bug database. One of our most commonly reported problems. We call this the excess precision problem.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323

This problem has been known for about 15 years now, and hasn't been fixed yet. My suspicion is that it never will be.

Another option is that you can try out the LLVM compiler (http://llvm.org). The CVS version of LLVM supports a --disable-excess-fp-precision flag, which causes it to emit the extra rounding operations needed to give "correct" 32 and 64-bit FP results, even when using the X86 floating point stack.


Note that this is severely slow down your code if it is FP intensive, but it will produce correct results. As James mentions, using SSE is a much better approach if possible.

-Chris

--
http://nondot.org/sabre/
http://llvm.org/

[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