To: J3 J3/25-143 From: Brandon Cook Subject: US19 Reqs/specs for additional IEEE-754 math functions Date: 2025-June-11 #Reference: J3/23-111r1, J3/23-234r2, WG5/N-2239 1. Introduction. ================ Addition of more IEEE-754 math functions was approved for further work by WG5 at the June 2024 WG5 meeting. IEEE-754 provides a table of recommended operations that languages should provide. Specifically it states: > Language standards should define, to be implemented according to > this subclause, as many of the operations in Table 9.1 as is > appropriate to the language. In an effort to make Fortran as fully compliant with IEEE-754 as possible, the intrinsic functions listed in this paper are proposed as additions to the standard. Fortran already has many of the operations available, and a table is provided to illustrate which are already available and which are missing. Of note however: > the names of the operations in Table 9.1 do not necessarily > correspond to the names that any particular programming language > would use. 2. Requirements. ================ Fortran shall define intrinsic functions corresponding to each of the functions that IEEE-754 recommends that a language provide. 3. Specifications. =================- The following tables describe the currently available operations and the required additional operations to be added. Table of Operations Already Provided ==================================== IEEE-754 Operation | Fortran Operation ---------------------------------- exp(x) | EXP(X) exp2(x) | 2**X exp10(x) | 10**X log(x) | LOG(X) log10(x) | LOG10(X) hypot(x,y) | HYPOT(X,Y) pown(x,n) | X**N powr(x,y) | X**Y sin(x) | SIN(X) cos(x) | COS(X) tan(x) | TAN(X) sinPi(x) | SINPI(X) cosPi(x) | COSPI(X) tanPi(x) | TANPI(X) asin(x) | ASIN(X) acos(x) | ACOS(X) atan(x) | ATAN(X) atan2(y,x) | ATAN2(Y,X) asinPi(X) | ASINPI(X) acosPi(X) | ACOSPI(X) atanPi(X) | ATANPI(X) atan2Pi(y,x) | ATAN2PI(Y,X) sinh(x) | SINH(X) cosh(x) | COSH(X) tanh(x) | TANH(X) asinh(x) | ASINH(X) acosh(x) | ACOSH(X) atanh(x) | ATANH(X) Table of Operations Proposed ============================ The Expression column indicates what the proposed function in the Fortran Operation column will compute mathematically, possibly with higher precision or performance. IEEE-754 Operation | Fortran Operation | Expression -------------------------------------------------- expm1(x) | EXPM1(X) | exp(x)-1 exp2m1(x) | EXP2M1(X) | 2**x-1 exp10m1(x) | EXP10M1(X) | 10**x-1 log2(x) | LOG2(X) | log(x)/log(2.) logp1(x) | LOGP1(X) | log(1+x) log2p1(x) | LOG2P1(X) | log2(1+x) log10p1(x) | LOG10P1(X) | log10(1+x) rsqrt(x) | RSQRT(X) | 1/sqrt(x) compound(x,n) | COMPOUND(X,N) | (1+x)**n rootn(x,n) | ROOTN(X,N) | x**(1./n) pow(x,y) | POW(x,y) | x**y