Patch for expf wrongly returning infinity (bug 3406)
Joseph S. Myers
joseph@codesourcery.com
Sun May 11 12:43:00 GMT 2008
On Sun, 11 May 2008, Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Joseph S. Myers wrote:
> > -o_threshold= 8.8721679688e+01, /* 0x42b17180 */
> > +o_threshold= 8.8722831726e+01, /* 0x42b17217 */
>
> How did you arrive at that value? Mathematically (using bc) the value
> comes out at
>
> 88.722839054
I used MPFR to determine the value (rounded to float precision) of exp of
successive float values, and rounded the value found for the largest float
with output in the range of finite float values to the same number of
decimal places used for the existing constant. The number you give is
between two consecutive float values, the one I give in my patch and the
one given as "himark" in e_expf.c which is the smallest float value whose
expf output should be infinite. Because of how the values are used, the
value in w_expf.c is meant to be the float value before that in e_expf.c.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list