
24 Jan
2010
24 Jan
'10
9:32 a.m.
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 change to double t = -(delta*sorted.size()); double tt = -(sorted.size()*delta); (and add the -ffloat-store), then you may get the "naive" result. Cheers, Rutger