The advice about enabling -ffast-math is dangerous. Be advised that the fpclassify() family of functions (e.g. checking for NaN or infinity) no longer work as expected. If you really want to go into that territory, be sure to read the compiler documentation: -ffast-math is an option that in fact enables a number of other flags, and you may want to be a bit more picky in which ones you choose.