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

Jim Thomas jaswthomas at sbcglobal.net
Tue Aug 27 09:43:18 PDT 2019



> On Aug 27, 2019, at 6:44 AM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> On Mon, 26 Aug 2019 15:40:33 -0700 Jim Thomas wrote:
>> 
>>>> 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 "?
> 
> Actually, tgamma() overflows both binary 128 and decimal 128 by +2200,
> and underflows both of those formats by -2200.5
> So, the numbers do not have to be very big.

“Too large” doesn’t imply very large. 

The problem with just saying “if the magnitude of finite x is too large” is that seems to imply once a range error occurs at some x then any y with greater magnitude than x would also cause a range error, which isn’t the case for tgamma for negative x. Other functions, e.g., exp(), have the same basic problem (though in a more subtle way), in the sense that the range error threshold does not depend solely on the magnitude, but also on the sign of x.

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




More information about the Cfp-interest mailing list