Status of expl logl
Steve Kargl
sgk at troutmask.apl.washington.edu
Tue Aug 14 17:52:59 UTC 2012
On Tue, Aug 14, 2012 at 12:37:16PM -0500, Stephen Montgomery-Smith wrote:
> Are people working on expl, logl and log1pl?
>
Yes. I have expl and expm1l written. Need to fix a few issues
that Bruce pointed out, and need to write an ld128/expm1l.
Bruce has multiple versions of logl and log1pl. I have a copy
of one of his ld80/logl, which I've been testing/using for a
a few years.
> I was trying to brainstorm ideas. If one had an expl, one could create
> a logl as follows:
>
> long double logl(long double x)
> {
> long double y;
>
> y = log(x);
> y -= 1 - x*expl(-y);
> }
>
> Of course you would need prechecks to make sure log(x) doesn't overflow,
> etc.
>
> But my thinking is this. Use log(x) as a starting value for Newton's
> Method. Since Newton's Method roughly doubles the number digits of
> precision, only one iteration is needed.
>
> It doesn't work so well if 1/e < x < e.
>
> Anyway, just throwing out an idea.
>
It is much easier to read Tang's papers, and implement his
algorithms. Then, you send the code to Bruce and watch
the optimization machine churn over the code. :-)
PTP Tang, "Table-Driven Implementation of the Expml Function In IEEE
Floating-Point Arithmetic," ACM Trans. Math. Soft., 18, 1992,
211-222.
PTP Tang, "Table-Driven Implementation of the Exponential Function
in IEEE Floating-Point Arithmetic," ACM Trans. Math. Soft., 15, 1989,
144-157.
PTP Tang, "Table-Driven Implementation of the Logarithm Function in IEEE
Floating-Point Arithmetic," ACM Trans. Math. Soft., 16, 1990, 378-400.
--
Steve
More information about the freebsd-numerics
mailing list