[Cfp-interest 1360] Re: Range errors

Jim Thomas jaswthomas at sbcglobal.net
Sat Jul 20 09:01:48 PDT 2019



> On Jul 19, 2019, at 9:10 PM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> On Wed, 17 Jul 2019 12:09:58 -0500 Rajan Bhakta wrote:
>> 
>>   Fred: Write a paper to make the range error for small nonzero x
>> consistent for expm1, logp1, log10p1's other base functions.
> 
> Attached is a first pass.
> 
> 
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com <mailto:tydeman at tybor.com>      Testing, numerics, programming
> +1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com <http://www.tybor.com/>
> Savers sleep well, investors eat well, spenders work forever.
> 
> 
> Submitter:Fred Tydeman
> Submission Date: 2019-07-??
> Document: WG14 Nxxxx
> Reference Documents:
> 
> Summary
> 
> The standard has a few incorrect or missing statements about range errors in some of the math functions. Also, f(infinity) is infinity NOT being a range error is covered by 7.12.1#5 about overflows; therefore, "finite" is not needed in some places.
> 
> Possible Technical Corrigendum:
> 
> The asin functions
> Add to 7.12.4.2#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The atan functions
> Add to 7.12.4.3#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The atan2 functions
> Add to 7.12.4.4#2
> 
> A range error occurs if x is positive and the magnitude of nonzero y/x is too small.
> The sin functions
> Add to 7.12.4.6#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The tan functions
> Add to 7.12.4.7#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The sinpi functions
> Add to 7.12.4.13#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The tanpi functions
> Add to 7.12.4.14#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The asinh functions
> Add to 7.12.5.2#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The atanh functions
> Add to 7.12.5.3#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The sinh functions
> Change 7.12.5.5#2 from
> 
> A range error occurs if the magnitude of x is too large.
> to
> 
> A range error occurs if the magnitude of x is too large or if the magnitude of nonzero x is too small..
> The tanh functions
> Add to 7.12.5.6#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The exp10 functions
> Change 7.12.6.2#2 from
> 
> A range error occurs if the magnitude of finite x is too large.
> to
> 
> A range error occurs if the magnitude of finite x is too large.

I don’t think saying “finite” hurts. It's true, and the reader might think this statement has precedence over 7.12.1#5, or view them as contradictory.
> The exp10m1 functions
> Change 7.12.6.3#2 from
> 
> A range error occurs if finite x is too large or if the magnitude of nonzero x is too small.
> to
> 
> A range error occurs if finite positive x is too large or if the magnitude of nonzero x is too small.
See above regarding “finite”. This says x, not the magnitude of x, is too large. We refer to the magnitude of x when the sign is to be ignored. No need to say “positive”. -2 is not larger than 1, and we should assume the reader understands that. 
> 
> The exp2m1 functions
> Change 7.12.6.5#2 from
> 
> A range error occurs if the magnitude of x is too large or if the magnitude of nonzero x is too small.
> to
> 
> A range error occurs if the magnitude of positive x is too large or if the magnitude of nonzero x is too small.
No need for positive.
> The expm1 functions
> Change 7.12.6.6#2 from
> 
> A range error occurs if positive x is too large.252)
Remove “positive". Same problem in erfc and lgamma.

- Jim
> to
> 
> A range error occurs if positive x is too large or if the magnitude of nonzero x is too small.252)
> The log1p and logp1 functions
> Add to 7.12.6.14#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The log2p1 functions
> Add to 7.12.6.16#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The erf functions
> Add to 7.12.8.1#2
> 
> A range error occurs if the magnitude of nonzero x is too small.
> The fmod functions
> Add to 7.12.10.1#2
> 
> A range error may occur if both x and y are nonzero and the magnitude of either is too small.
> The remainder functions
> Add to 7.12.10.2#2
> 
> A range error may occur if both x and y are nonzero and the magnitude of either is too small.
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net <mailto:Cfp-interest at oakapple.net>
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest <http://mailman.oakapple.net/mailman/listinfo/cfp-interest>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20190720/4ea50e99/attachment-0001.html 


More information about the Cfp-interest mailing list