[Cfp-interest] AI about underflow and extraordinary roundoff error

Fred J. Tydeman tydeman at tybor.com
Wed Feb 21 11:36:47 PST 2018


On Wed, 21 Feb 2018 09:40:51 -0800 Jim Thomas wrote:
>
>C11 7.12.1 says
>
>> The result underflows if the magnitude of the mathematical result is so small that the mathematical result cannot be represented, without extraordinary roundoff error, in an object of the specified type.232)
>
>> 232) The term underflow here is intended to encompass both ''gradual underflow'' as in IEC 60559 and also ''flush-to-zero'' underflow.
>
>
>
>This characterization of underflow doesn't match current IEC 60559. IEC 60559 specifies that underflow is signaled if the result is tiny, even if exact (hence no roundoff error). If the result is tiny then the underflow flag is raised if and only if the result is inexact, even if the roundoff error is the same as it would have been if the full 
>(normal) precision of the type were available (hence no extraordinary roundoff error).
>
>Here's a rewording for consideration:
>
>The result underflows if the magnitude of the mathematical result is so small that the mathematical result cannot be represented with the full precision of the specified type in an object of the specified type.232)

I am fine with this.

>Then the footnote is ok.
>
>A possible objection to the change is that it broadens the C definition of underflow (by not requiring extraordinary, or even any, roundoff error). However, a range error is optional when underflow occurs, so implementations would not be invalidated.

I disagree with no roundoff error still being underflow.
  float f = FLT_MIN / FLT_RADIX;
requires only one digit to represent, so is not underflow (by either current C11 words or your words).

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