Selection of fdlibm or fdlibm replacement functions

In 1999, the C/C++ Runtime Library provided IEEE754 floating-point arithmetic support in support of IBM’s Java™ group. The Java language had a bit-wise requirement for its math library, meaning that all platforms needed to produce the same results as Sun Microsystems’ fdlibm (Freely Distributed LIBM) library. Therefore, Sun Microsystems’ fdlibm code was ported to the C/C++ Runtime Library to provide IEEE754 floating-point arithmetic support. Subsequent to the C/C++ Runtime Library’s 1999 release of IEEE754 floating-point math support, IBM's Java group provided their own support of IEEE754 floating point arithmetic and no longer use the C/C++ Runtime Library for this support.

Beginning in z/OS® V1R9, a subset of the original fdlibm functions are being replaced by new versions that are designed to provide improved performance and accuracy. The new versions of these functions are replaced at the existing entry points. However, as a migration aid, IBM® has provided new entry points for the original fdlibm versions. Applications that take no action will automatically use the updated functions. There are two methods for accessing the original functions. The details about the two methods are as follows:

To access the original fdlibm functions, you can use the following methods:

  1. If the application has not included math.h or uses feature test macro _FP_MODE_VARIABLE, environment variable _EDC_IEEEV1_COMPATIBILITY_ENV can be set to ON in order to access the original versions of the functions. If the environment variable is not set or set to any value other than ON, the new versions of the functions will be used. This method does not require the application to be recompiled. Note that if the application is running in variable mode and was either compiled FLOAT(HEX) or has used __fp_setmode() to switch over to hexadecimal floating-point mode, the hexadecimal versions of the functions will be called no matter the setting of the environment variable.
  2. If the application includes math.h, does not use feature test macro _FP_MODE_VARIABLE, and uses FLOAT(IEEE) compiler option, the application will need to be recompiled with feature test macro _IEEEV1_COMPATIBILITY defined so that the affected math functions can be mapped to the new entry points that provide the old behavior. This method requires the application to be recompiled. See z/OS XL C/C++ Runtime Library Reference for more information on the _IEEEV1_COMPATIBILITY feature test macro.
Note: IBM suggests always including math.h, so it is likely that the application will need to use the previous second method if it is desired to use the old versions of the functions.