[Cfp-interest 3159] Re: When errors "may occur"

Jim Thomas jaswthomas at sbcglobal.net
Mon Aug 5 14:26:08 PDT 2024



> On Jul 28, 2024, at 2:36 PM, Jerome Coonen <jcoonen at gmail.com> wrote:
> 
> 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.

A domain error for fadd and fsub occurs only when both arguments are infinite. fma can have a domain error for fma(inf, 0, z), fma(0, inf, z), and fma(inf, 1, -inf) and variants thereof, but not if just the third argument is infinite.

- Jim Thomas

> 
> 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 <mailto:jcoonen at gmail.com>_______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20240805/bb2d5758/attachment.htm>


More information about the Cfp-interest mailing list