J3/05-132r2 To: J3 From: Dan Nagle Subject: libm math functions Date: 2005 Feb 09 Most Fortran vendors also support C/C++ compilers, or utilize C/C++ RTLs to supply low-level services. The C/C++ libm contains a few mathematical routines which would be of use to Fortran programs. Standardizing names for these routines aids portability of Fortran programs. This is J3/04-246 at M167, where the Hate .. Love vote was 0 - 3 - 6 - 0 Number: Title: C libm functions as Fortran intrinsics Submitted By: J3 Status: For Consideration References: C99 7.12 Mathematics page 211 et seq. Unix Programmer's Manual, Volume 2, System calls and Library Routines (3m) Basic Functionality: Add the Bessel functions, hypot, and error functions to the Fortran intrinsic function set for real arguments. Rationale: Fortran is mainly used for numerical problems, supplying mathematical functions of proven utility will assist Fortran is continuing as the premier mathematical programming language in the world today. Estimated Impact: The estimated impact at 167 was 4 on the John Reid scale. These are proposed intrinsic functions, no other feature is affected. Impact on vendors is minimal, as most vendors support these functions anyway for their C/C++ compilers. Detailed Specification: Add subsections to Section 13 detailing the Fortran names for these procedures. (The C names should not be used due to the common usage, in Fortran, of names such as j0 etc.) The functions are (the C names): Bessel functions (j0, j1, jn, y0, y1, yn) Error Functions (erf, erfc) Hypotenuse (hypot) Gamma and log gamma (tgamma, lgamma) The detailed mathematical specification of these procedures is given in the references above. The intention is to allow the vendor to use the procedure supplied by libm, so the exact specification is left to libm, which is most likely what the applications programmer wants. Since Fortran does not support the concept of external variables, the signgam variable of lgamma may be defined as an optional intent(out) argument. Edits would include adding to the list in 13.5.2: BESSEL_J0 BESSEL_J1 BESSEL_JN BESSEL_Y0 BESSEL_Y1 BESSEL_YN COMP_ERROR_FUNC ERROR_FUNC GAMMA_FUNC HYPOT LOG_GAMMA_FUNC History: J3/04-246 at M167, J3/05-132 at M171