This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Floating point problems (accuracy).



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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]