[PATCH] Update sparc ULPs.

Joseph S. Myers joseph@codesourcery.com
Sat Nov 17 22:24:00 GMT 2012


On Sat, 17 Nov 2012, David Miller wrote:

> diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
> index 112a8f3..7ee4731 100644
> --- a/sysdeps/ieee754/ldbl-128/e_j0l.c
> +++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
> @@ -831,6 +831,8 @@ long double
>        return -HUGE_VALL + x;
>      }
>    xx = fabsl (x);
> +  if (xx < 0x2p-27)
> +    return TWOOPI * __ieee754_logl (x);

The logic in the double version is:

 *         Note: For tiny x, U/V = u0 and j0(x)~1, hence
 *              y0(tiny) = u0 + (2/pi)*ln(tiny), (choose tiny<2**-27)

Note (a) 2**-27 is 0x1p-27 not 0x2p-27, (b) the relevant property is that 
the square of x is < 2**(-MANT_DIG-1) (since most of the terms for Bessel 
functions are in terms of x^2), so it should be 0x1p-57L here, (c) there 
is a missing addition of u0 (= (2/pi)*(log(1/2)+gamma) = -0.073804...; the 
ldbl-128 code doesn't currently appear to have a long double version of 
this constant).  Maybe more testcases are needed in the testsuite for a 
range of small arguments (e.g. a range of values from 0x1p-10 to 0x1p-120) 
to show the problems in this version of the patch....

> +  if (xx < 0x2p-54)
> +    return -TWOOPI / x;

The analogue of 2**-54 is 0x1p-114L.  Again, maybe more testcases are 
needed....

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list