- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I have a question regarding how to get the most accurate result when doing floating-point calculations.
In the documentation for the Intel Fortran Compiler it says: "Improved floating-point consistency is not enabled. This setting provides better accuracy and run-time performance at the expense of less consistent floating-point results."
It feels a bit ambiguous to say that with -fltconsistency off it provides better accuracy but less consistent floating-point results. Doesn't improved consistency mean better accuracy in the floating-point calculations? Or doesn't the floating-point consistency have anything to do with the most accurate calculation result?
So the question is: Should the compiler option -fltconsistency be used to get the most accurate results when doing floating-point calculations?
Thanks!
Best regards,
Andreas
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-fltconsistency (now replaced with -fp-model precise) tells the compiler to store to memory more often, making results more consistent at the loss of the extended accuracy.
When using SSE registers for floating point, as you would with -xW, none of this matters as all is done in declared precision. So I would suggest enabling -xW or the highest mode available for your processor to get both the best performance (SSE is faster) and the most consistent results. Accuracy will be a bit less than it might be, but will be more in line with what non-IA-32 processors do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The default (-fp-model fast), unfortunately, allows the compiler to ignore parentheses in some situations during evaluation of parentheses. In x87 code, this was sometimes needed in order to optimize poorly written code, and often could be accepted in view of the extra precision compensating for changed order of evaluation.
ifort 10.0 has introduced the option -assume protect_parens, which requires the compiler to observe parentheses, without removing other performance optimizations. In properly written code, this can help give both best accuracy and performance.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page