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

different results on compilers

mbehzad
Beginner
771 Views
Hi all,
I compiled a fortran code on the vista 64-bit by Intel VF and also on a xp 32-bit by Lahey compiler. I got totally different results.
I checked out the code. I guess it is because a function called fran, since this function seems to be based on the machine. The code is very huge and I could not find exactly what would be the reason for it. I attached the function fran. I am wondering if any one could give me a hand on this problem.
thank you in advance
c portable pseudo-random number generator, from tony warnock,

c cray research institute.

c use double precision on short word length machines.

c qq must be given to machine significance (=5.9604644775390625e-8)

c if 2.**(-24) won't compile on cdc, use 16704000000000000000b

c fran is called by: break, colide, inject, and pmovtv

include 'comkiva.i'

parameter (pp=2.**24, qq=2.**(-24), gb=1., gs=14390069.)

a=gs*rans+1.

b=gb*rans+gs*ranb+int(a*qq)

ranb=b-int(b*qq)*pp

rans=a-int(a*qq)*pp

fran=(ranb*pp+rans)*2.**(-48)

return

end

0 Kudos
1 Reply
TimP
Honored Contributor III
771 Views
If you have ignored the advice to set double precision, it might not be surprising if the results came out entirely different according to the options you may have set for each compiler. The Lahey 32-bit compiler, like the Intel one. probably has an option (default?) for double precision evaluation of single precision expressions.
0 Kudos
Reply