This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fpu/e_expl.c for i686



> +__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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]