Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: fwd from Jim Demmel: More on repeatability



On 08/18/2011 02:39 PM, Vincent Lefevre wrote:
On 2011-08-18 08:21:11 -0400, Michel Hack wrote:
With regard to correctly-rounding sin/cos/tan, Vincent Lef1vre wrote:
I know, but there isn't much choice if for instance, realmax ~ 2^64.

Well, realmax is much bigger than that: 2?127 for float, 2?1023 for double,
and an alarming 2?16383 for long double.  (Or did I misinterpret?)

I've sent a followup to correct that. It should have been
realmax ~ 2^(2^64), e.g. with a format where the exponent
is represented in a 64-bit word.

Note that it will still rather "slow" even for 2^1023 and even more
for 2^16383, but one may find this acceptable for most programs: the
individual operation takes a fraction of second, and it shouldn't
occur often in the program, so that the total running time shouldn't
be affected.

The case of 2^(2^64) is much more serious as the individual operation
isn't even computable in practice.

A user-definable threshold for backing off to max range seems appropriate
if we go in this direction.

Machine-independent reproducibility would require optimal rounding,
unless you specify an arbitrary threshold above which [-1,1] should be returned.

Environment-dependent reproducibility (which is what I advocate) can leave the issue open.