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

Issue with exp for double precision complex numbers with ifort and ifx

DmitryKopelevich
Beginner
4,031 Views

I'm using

ifort  2021.10.0 20230609
and

ifx 2023.2.0 20230721

I've ran into the following issue: Programs compiled with ifort and ifx incorrectly compute exponentials of double-precision complex numbers and return Infinity or 0 instead of the actual value. Below is a simple test code:

program test
        double complex :: x = (0.d0, 0.d0)
        print *, exp(x)
end program test

If I compile this code with ifort, the output is

(Infinity,0.000000000000000E+000)

If I compile the code with ifx, the output is different, but is still wrong:

 (0.000000000000000E+000,0.000000000000000E+000)

The issue appears to only arise with double precision complex numbers; the results are correct for single precision complex, double precision real etc.

Is this a known issue with these compilers?

0 Kudos
1 Solution
Ron_Green
Moderator
3,425 Views

For the Intel compilers, let's turn off our libimf and libsvml.  Use this option

 

-no-intel-lib=libimf,libsvml

 

 

View solution in original post

0 Kudos
21 Replies
Barbara_P_Intel
Employee
249 Views

The wrong answers with cexp is fixed in both ifx and ifort in the release that was published this week. Please give it a try!

 

 

0 Kudos
Reply