[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Transcendental function tables: comments welcome!
On 2007-05-28 22:27:36 +0000, Michel Hack wrote:
Actually, I just realised that the CF expansion of pi or e is pretty
irrelevant unless there is a partial convergent whose denominator
is a power of the base -- which is highly unlikely ...
On Tue, 29 May 2007 14:13:14 +0200, you replied:
I don't think so. You need to be close to a *multiple* of pi/2.
But you also need to take the exponent into account.
You're right, my argument does not apply directly to periodic functions.
But by looking closer, it appears that extreme formats are not the issue
either -- what matters is the slope relative to the value of pi/2, and
whether there is an applicable partial quotient that exceeds this ratio
(1.5, in this case). Oh, it also depends on 0 <= emax+emin <= 1, which
is required for IEEE-sanctioned formats.
We are looking for small cos(x), i.e. x close to (2n+1)pi/2.
Let y = |x - (2n+1)pi/2| -- then |cos(x)| is close to y.
How small can y be? Well, if x is large it is an integer, and
y is smallest when x/(2n+1) is a partial convergent of pi/2.
Note that x = B*2^b, so there may not be a partial convergent
of that type, in which case y > pi/4x ... ok, so that's not quite
enough to prove underflow can't happen, as it could for x > Nmax/2.
However, except for very high precisions relative to exponent range,
the possible values of x are widely spaced. Suppose t is an integer
such that t/(2m+1) is within 1/2(2m+1)^2 of pi/2, and x is the nearest
floating-point integer to t. Then the next-best approximation will
be about |x-t| times bigger, and we are already within a factor of two
of the underflow threshold. So underflow is possible only if there
are best approximations whose numerator has a factor of 2^(emax-p) --
i.e. a large power of two except for outrageously unbalanced formats.
This is still close to my original argument, but it is not iron-clad.
Michel.
Sent: 2007-05-30 19:59:35 UTC