Odd gfortran result with atan

Very true, and we had a recent demonstration of this in a thread here. The compiler’s built-in intrinsic function index had a bug, but the Gfortran RTL intrinsic index worked correctly. Whether the bug was visible or not depended on the optimization level specified to the compiler. At low optimization levels, the compiler may choose the RTL routine, but at a higher optimization level it may do the evaluation of a constant expression at compile time using the built-in library routine.

1 Like