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

Difference in the evaluation of trigonometric function in CVF and IVF

tlahydrema_com
Beginner
674 Views

I've just bought IVF and is moving my code from CVF 6.6.B to IVF 10.1. The two programs are giving small difference in the output. Is it possible that the two compilers evaluate trigonometric functions different?

i.e. I use asin, cos and acos til calculate three variables, which all is used in a equation containing sin.

I have checked initialisation for all variables, which I have figured out, that IVF is much more sensitiv to initialisation (var = 0.0D0). I use double precision in my code (real(double) :: xx).

Anybody who have experiende same behavior moving code from CVF til IVF?

/Regards Thomas Langer

0 Kudos
4 Replies
Les_Neilson
Valued Contributor II
674 Views
It could be due to a difference in optimisation;but it could also be due to your initialisations.
For example x = 0.1 is not the same as x = 0.1d0
(The first one gives an internal representation of x'3FB99999A0000000'
the second is x'3FB999999999999A)

Les

0 Kudos
TimP
Honored Contributor III
674 Views
Quoting - tlahydrema.com

I've just bought IVF and is moving my code from CVF 6.6.B to IVF 10.1. The two programs are giving small difference in the output. Is it possible that the two compilers evaluate trigonometric functions different?

i.e. I use asin, cos and acos til calculate three variables, which all is used in a equation containing sin.

I have checked initialisation for all variables, which I have figured out, that IVF is much more sensitiv to initialisation (var = 0.0D0). I use double precision in my code (real(double) :: xx).

Anybody who have experiende same behavior moving code from CVF til IVF?

/Regards Thomas Langer

0 Kudos
TimP
Honored Contributor III
674 Views

Math functions in CVF take advantage of x87 extra precision for improved accuracy, while ifort SSE2 libraries would use extra precision only where necessary for stability. To increase likelihood of identical results, you would need to set float consistency option in CVF and /assume:protect_parens and no SSE options in 32-bit ifort.

0 Kudos
g_f_thomas
Beginner
674 Views


IIRC, fp arithmetic is supposed to be done the same way acrossI32 - IA64. Q4 of

http://developer.intel.com/technology/itj/archive/1999.htm

might be of interest.

Gerry

0 Kudos
Reply