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

53-bit to 64-bit precision

cvnravi
Beginner
608 Views
Hi,

I am porting fortran code from fortran power station(version 4.0) to fortran 11(2003) version. old compiler(power station) is a 53-bit precision. While porting into new compiler 11, it is not giving proprer/exact values to real/float variables. I hope the new compiler is 64-bit precision. So I need to change fpu(floating point unit) from 53-bit to 64-bit precision. Is this correct? If so please tell me how to change 53-bit to 64-bit precision from properties of new compiler?
otherwise tell me how to do it for new compiler(11).

Thanks in adavance.
0 Kudos
2 Replies
Steven_L_Intel1
Employee
608 Views

The new compiler is giving you proper and exact values - Microsoft Fortran PowerStation gave you more precision, sometimes, than you asked for. This is not predictable and a program that depends on it is, in my view, broken.

You can try adding the /arch:ia32 option (Use extended instruction set > No extended instructions) and you should get closer to the Microaoft compiler, with a tradeoff of performance.
0 Kudos
TimP
Honored Contributor III
608 Views

The new compiler is giving you proper and exact values - Microsoft Fortran PowerStation gave you more precision, sometimes, than you asked for. This is not predictable and a program that depends on it is, in my view, broken.

You can try adding the /arch:ia32 option (Use extended instruction set > No extended instructions) and you should get closer to the Microaoft compiler, with a tradeoff of performance.
As Steve implies, the expectation is that you are looking for the effect of double precision evaluation of single precision expressions. Even with /arch:ia32 you don't get 64-bit precision mode (other than in built-in math functions) unless you specify it, for example by /pc80
If your program uses parentheses carefully, /fp:source will require the compiler to heed them, and removes some optimizations which may give different numerical results from your previous expectation. It's possible this option will help reconcile your results without setting /arch:ia32
0 Kudos
Reply