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

Fred J. Tydeman tydeman at tybor.com
Sun Aug 25 18:11:32 PDT 2019


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.

>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.

>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.

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


---
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.



More information about the Cfp-interest mailing list