Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2007 16:18:39 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        David Schultz <das@FreeBSD.org>
Cc:        freebsd-standards@FreeBSD.org, Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject:   Re: Implementation of expl()
Message-ID:  <20071210153413.W3836@delplex.bde.org>
In-Reply-To: <20071209223918.GA9920@VARK.MIT.EDU>
References:  <20071103001305.GA82775@troutmask.apl.washington.edu> <20071209212505.GA9698@VARK.MIT.EDU> <20071209213450.GA95726@troutmask.apl.washington.edu> <20071209223918.GA9920@VARK.MIT.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 9 Dec 2007, David Schultz wrote:

> Some minor fixes (mostly whitespace) are below.
>
> Also, don't you lose precision when you do stuff like this?
> 	z.e = 1 / z.e;
>
> In any case, if you can get me the appropriate constants for the
> 128-bit format, I'll clean everything up and check it in, which
> will make a lot of ports maintainers happy. That will pave the way
> to other stuff (e.g., MD versions of this) as well. We can worry
> about subnormals later.

Why not convert the fdlibm algorithm for exp() as is done for expf()?
It is much better (*), doesn't need to be debugged (except for the
conversion), and would be easier to maintain.

Better algorithms exist, like someone named das@ used for exp2(), but
would be harder to debug and maintain.

amd64 should probably use hardware for expl(), since long doubles are
much harder to handle efficiently than doubles.  Thus the software
algorithm is needed mainly for ia64 and sparc64.

(*) Starting with the transformation of exp(x) to x*(exp(x)+1)/(exp(x)-1).
The power series for the latter converges much faster and has better
numeric properties.  Polynomial approximations inherit these properties.

Bruce



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