Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jul 2012 18:16:56 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Stephen Montgomery-Smith <stephen@missouri.edu>
Cc:        freebsd-bugs@freebsd.org
Subject:   Re: bin/170206: complex arcsinh, log, etc.
Message-ID:  <20120728173811.Y1960@besplex.bde.org>
In-Reply-To: <201207280540.q6S5eAh2074533@freefall.freebsd.org>
References:  <201207280540.q6S5eAh2074533@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 28 Jul 2012, Stephen Montgomery-Smith wrote:

> Yes, everywhere I said "double precision" I meant "doubled precision."
>
> I think the papers by Hull et al were perfectly happy with a ULP of
> around 4.
>
> I have been trying to do a little better, but like you I am noticing
> that log1p isn't that good either.

Mine is :-).  It has 6-10 extra bits of precision internally.  Someday
the internals should be exposed.  There is also the old BSD libm
__log__D() which already does this.  Old BSD libm pow() uses this
internally to get much better accuracy 20 years ago than now.
Unfortunately, neither of these takes an extra-precision arg.
log1p() sort of does, and clog() already uses it for other reasons
and gets some accuracy benefits from this.  Old BSD libm __exp__()
has the opposite limiation of taking an extra-precision arg but
only returning float precision.

> I have tried some other things.  I am attaching this example which gets
> a ULP a little over 2.  I simulate high precision arithmetic by
> expanding everything out into integers.  I certainly didn't aim for a
> speedy program.

In pari, I did sort of the opposite -- cut down its large decimal
precision to produce all the precisions used in clog(), using function
calls for all operations, and the doubled precision faked as in C.
This is painful to use, but easier than reimplementing a specialized
Dekkers algorithm every time you need one.  fdlibm is full of
uncommented specialized Dekkers algorithms, optimized so that they are
barely recognizable and probably known before Dekkers.

Bruce



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