[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reproducibility of tininess detection for binary formats



Here is another reason to prefer "before rounding" as the reproducible
method:  conversions.  It boils down to a simple range test that need
not take current rounding mode into account.



One extreme definition of exponent spill is:
the magnitude of a non-zero finite unrounded result is larger than
the largest normalized number in the destination format
or smaller than the smallest normalized number in the destination format.

The opposite extreme definition is:
the numerical result rounded to the destination format differs from the
numerical result rounded to a hypothetical format with the same precision
as the destination format but unbounded exponent range.


It's a matter of taste which one could be called "broader" and which
"narrower."     The second one defines a subset of every definition that 754R
has ever considered.     The first one contains every definition that
754R has ever considered, and a bit more.      Very few programs would
ever notice the difference unless designed specifically to do so.


But the first one depends only on the magnitude of the unrounded exact
result.     The second one also depends on the current rounding mode.
Neither one will satisfy everybody all the time, but I prefer the first
because it's easier to undo an unwanted exception when it is signaled than to 
test for a unsignaled exception on every operation where it might have been
signaled.


But the odds of 754R converging on a specification which precludes efficient
implementation on the bulk of existing hardware seem slight.

754 | revision | FAQ | references | list archive