[Cfp-interest 3156] When errors "may occur"
Jerome Coonen
jcoonen at gmail.com
Sun Jul 28 14:36:21 PDT 2024
At the July meeting, I agreed to summarize the situations in which a
domain, range, or pole error "may occur", in the language of the standard.
This table is based on working draft n3220. The table below is sent in
fixed-width font; if it arrives in a proportional font, just copy/paste to
a program editor to make it presentable.
This effort originated with a review of the errors for lgamma() and
tgamma(). It has led to discussion of why it is that some exceptions are
noted by the system while others are just optionally noted.
Two details that struck me are:
(1) llogb() differs from logb() in not having the optional domain or range
error when the result is out of range.
(2) The usage, "a domain error may occur for infinite arguments," in fadd()
and fsub(), with a similar phrase for fma(), is not great. A phrase like,
"if any argument is infinite," is more specific and works for all three
functions.
Section Func Domain Range Pole Reason
-------- ----- ------ ----- ---- --------------
7.12.4.4 atan2 * x = 0 & y = 0
7.12.4.11 atan2pi * x = 0 & y = 0
7.12.4.14 tanpi * x = half-integer
7.12.5.3 atanh * x = ±1
7.12.6.8 ilogb * * x = 0,inf,NaN
ilogb * * result out of range
7.12.6.10 llogb * * x = 0,inf,NaN
llogb no error???? result out of range
7.12.6.11 log * x = 0
7.12.6.12 log10 * x = 0
7.12.6.13 log10p1 * x = -1
7.12.6.14 log1p * x = -1
7.12.6.15 log2 * x = 0
7.12.6.16 log2p1 * x = -1
7.12.6.17 logb * * x = 0
7.12.7.2 compoundn * x = -1 & n < 0
7.12.7.5 pow * x = 0 & y = 0
pow * * x = 0 & y < 0
7.12.7.6 pown * x = 0 & n < 0
7.12.7.7 powr * x = 0 & finite y < 0
7.12.7.8 rootn * x = 0 & n < 0
7.12.7.9 rsqrt * x = 0
7.12.8.3 lgamma * x = 0 or neg int
7.12.8.4 tgamma * * x = 0 or neg int
7.12.9.5 (l)lrint * * result too big
7.12.9.7 (l)lround * * result too big
7.12.14.1 fadd * "for infinite args"
7.12.14.2 fsub * "for infinite args"
7.12.14.5 fma * "for an infinite arg"
Hope this helps.
-Jerome Coonen
650.996.4738
jcoonen at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20240728/3925cef3/attachment.htm>
More information about the Cfp-interest
mailing list