Subject: Re: [boost] floating point FUD
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-01-24 04:32:33
Thomas Klimpel wrote:
> You spotted one of the bugs, very good. This bug is actually one of my
> favorites. I tend to fix this bug by writing "std::abs".
I guess your case has to do with 80 bits precision in the registers vs. 64
bits precision in memory. Please try the -ffloat-store option.
In addition, with the t/tt test, it states
-double*integer vs -integer*double
where -integer gets converted to double, and in the other case integer gets
converted to double, which, as you know, may give different results. If you
double t = -(delta*sorted.size());
double tt = -(sorted.size()*delta);
(and add the -ffloat-store), then you may get the "naive" result.