[Cfp-interest 1392] Re: Math functions & range errors

Jim Thomas jaswthomas at sbcglobal.net
Mon Aug 26 15:40:33 PDT 2019



> On Aug 25, 2019, at 6:11 PM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> Thanks for reviewing.
> 
> On Sun, 25 Aug 2019 15:15:34 -0700 Jim Thomas wrote:
>> 
>>> Some implementations consider f(infinity) as a range error based upon the text: A range error occurs if [the magnitude
>> of] x is too
>>> 
>> Consider changing to: "Some implementations incorrectly treat ".
> 
> Done.
> 
>>> 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.
>> I recall David suggesting this be "A range error occurs if the magnitude of finite positive x is too large ." but am not sure
>> what we agreed to.
> 
> I also do not recall what we agreed to.

As Rajan points out, the resolution is in the minutes. 

> 
>> With that change we'd be saying "magnitude" wherever talking about too large or too small. Without
>> that change we'd be saying "magnitude"  just where needed for correctness.
> 
>>> The compoundn functions
>>> Change 7.12.7.2#2 from
>>> 
>>> A range error may occur if n is too large, depending on x.
>>> to
>>> 
>>> A range error may occur if n is too large, depending on finite x.
>> Do we mean if the magnitude of n is too large?
> 
> Yes.  Changed.
> 
>>> The tgamma functions
>>> Change 7.12.8.4#2
>>> 
>>> A range error occurs if the magnitude of x is too large and may occur if the magnitude of x is too small.
>>> to:
>>> 
>>> A range error occurs if the magnitude of finite x is too large and may occur if the magnitude of non-zero x is too small.
>> How is there a range error if the magnitude of negative x is too large?
> 
> With the FP systems still in use that I know about, all large FP values are integers.  So, large negative values would
> be integers, so would be domain or pole errors.
> 
>> Can't there be range errors for moderate magnitude
>> negative x?
> 
> Yes.  I think "moderate negative x" could still be considered "too large".  But, I am open to
> other wording.

How about: "A range error occurs if the magnitude of finite positive x is too large and for some negative finite x and …”?
> 
>> A general question: What does "may occur" mean?
> 
> Does not always happen.  For example, on IBM S/360 hex FP, there are no subnormal numbers,
> so underflows will not happen for many functions, that do happen when subnormals are supported.

Do we have consistent wording around this? sinpi has "A range error occurs if the magnitude of nonzero x is too small”, but range errors occur for sinpi only for subnormal input. I thought this was ok, because if the implementation didn’t support subnormals, |x| would never be too small and the statement would be vacuously true.

> 
> An alternative wording:  A range errors occurs for some finite arguments.

That approach might be better in some cases. Instances of “may occur” might need more consideration.

- Jim Thomas
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> 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
> Savers sleep well, investors eat well, spenders work forever.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20190826/43ded1a2/attachment.html 


More information about the Cfp-interest mailing list