I am using the ifort compiler for windows from command line (without Visual Studio). I wrote my own makefile and I compile with the following options:
/fast #-ipo -O3 -no-prec-div -xHost
In this way the code executes much faster but sometimes I get different results due to a loss of precision
So my question is the following: is there a way to still improve the speed but keeping precision? So that the compiler would still optimize loops etc but not the precision
https://software.intel.com/sites/default/files/managed/de/a1/FP_Consistency_091117.pdf is a good read.
For more complete information about compiler optimizations, see our Optimization Notice.