Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Aug 2012 10:52:57 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Stephen Montgomery-Smith <stephen@missouri.edu>
Cc:        freebsd-numerics@freebsd.org
Subject:   Re: Status of expl logl
Message-ID:  <20120814175257.GA69865@troutmask.apl.washington.edu>
In-Reply-To: <502A8CCC.5080606@missouri.edu>
References:  <502A8CCC.5080606@missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120814175257.GA69865>