To: J3 J3/23-234r1
From: Brad Richardson
Subject: IEEE-754 Recommended Math Functions
Date: 2023-October-24
#Reference: 23-111r1
Introduction
============
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, it is proposed that additional intrinsic functions be
considered for inclusion into the language. Fortran already has many of
the operations available, and tables are 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.
Table of Operations Already Provided
====================================
IEEE-754 Operation | Fortran Operation | Function
--------------------------------------------------
exp(x) | EXP(X) | exp(x)
exp2(x) | 2**X | 2**x
exp10(x) | 10**X | 10**x
log(x) | LOG(X) |
log10(x) | LOG10(X) |
hypot(x,y) | HYPOT(X,Y) | sqrt(x**2+y**2)
pown(x,n) | X**N | x**n
pow(x,y) | X**Y | x**y
sin(x) | SIN(X) |
cos(x) | COS(X) |
tan(x) | TAN(X) |
sinPi(x) | SINPI(X) | sin(pi*x)
cosPi(x) | COSPI(X) | cos(pi*x)
tanPi(x) | TANPI(X) | tan(pi*x)
asin(x) | ASIN(X) |
acos(x) | ACOS(X) |
atan(x) | ATAN(X) |
atan2(y,x) | ATAN2(Y,X) | atan(y/x)
asinPi(X) | ASINPI(X) | asin(x)/pi
acosPi(X) | ACOSPI(X) | acos(x)/pi
atanPi(X) | ATANPI(X) | atan(x)/pi
atan2Pi(y,x) | ATAN2PI(Y,X) | atan(y/x)/pi
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
============================
IEEE-754 Operation | Fortran Operation | Function
--------------------------------------------------
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) |
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)
powr(x,y) | powr(x,y) | exp(y*log(x))