This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: fpu/e_expl.c for i686
- To: Andreas Jaeger <aj at suse dot de>
- Subject: Re: fpu/e_expl.c for i686
- From: Stephen L Moshier <moshier at mediaone dot net>
- Date: Mon, 7 May 2001 15:23:59 -0400 (EDT)
- cc: libc-alpha at sources dot redhat dot com
- Reply-To: moshier at moshier dot ne dot mediaone dot net
> +__ieee754_expl (long double x)
> ...
> + "fldl2e\n"
> + "fmulp\n" /* x * log2(e) */
> + "fld %%st\n"
> + "frndint\n" /* int(x *> log2(e)) */
> + "fsubr %%st,%%st(1)\n" /* fract(x * log2(e)) */
This code seems adequate for double precision but it has poor
accuracy for long double, due to error amplification over the
wider domain of the long double function. For example, expl(1000)
is off by roughly 460 ulps. I would suggest improving the range reduction
method here, but since that entails three or four more multiplications
you might not want to make the speed sacrifice. What would your
policy be about this tradeoff of speed versus accuracy?