From a C++/JS benchmark

bearophile bearophileHUGS at lycos.com
Sat Aug 6 17:34:30 PDT 2011


Walter:

> On 8/6/2011 4:46 PM, bearophile wrote:
> > Walter is not a lover of that -ffast-math switch.
> 
> No, I am not. Few understand the subtleties of IEEE arithmetic, and breaking 
> IEEE conformance is something very, very few should even consider.

I have read several papers about FP arithmetic, but I am not an expert yet on them. Both GDC and LDC have compilation switches to perform those unsafe FP optimizations, so even if you don't like them, most D compilers today have them optional, and I don't think those switches will be removed.

If you want to simulate a flock of boids (http://en.wikipedia.org/wiki/Boids ) on the screen using D, and you use floating point values to represent their speed vector, introducing unsafe FP optimizations will not harm so much. Video games are a significant purpose for D language, and in them FP errors are often benign (maybe some parts of the game are able to tolerate them and some other part of the game needs to be compiled with strict FP semantics).

Bye,
bearophile


More information about the Digitalmars-d mailing list