Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29261 Discussions

Different results in Debug and Release

morph27
Beginner
524 Views
I have written a code to solve four simultaneos NL equations using a Newton-Raphson method. The code compiles and runs with no errors in Debug and Release. However, the output results from the release version and the debug version are different for the same input file. I do not understand why this should be. Any ideas?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
524 Views
The release version is optimized, and this can change floating point results slightly due to different order of instructions, use of extended precision registers, etc.
0 Kudos
morph27
Beginner
524 Views
Is this still true if optimization is disabled under the project properties?
If there is code optimization that is still occurring, which mode, debug or release, would produce a more accurate solution? Or is neither more accurate than the other. Is there a way to move the two methods to a common solution?
0 Kudos
Steven_L_Intel1
Employee
524 Views
If optimization is disabled, then it is disabled. But there are other project options, such as array bounds checking or generation of debug symbol information, that could cause differences in an incorrect program. You can certainly experiment with making the two configurations more alike until you find what makes the difference.

In general, the optimized/release version is more accurate. There are compiler options to enhance "floating point consistency" at the expense of performance and accuracy.
0 Kudos
Reply