Date: Fri, 27 Jul 2012 21:00:20 GMT From: Stephen Montgomery-Smith <stephen@missouri.edu> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/170206: complex arcsinh, log, etc. Message-ID: <201207272100.q6RL0Kio005634@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/170206; it has been noted by GNATS.
From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Bruce Evans <brde@optusnet.com.au>
Cc: Stephen Montgomery-Smith <stephen@freebsd.org>,
FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: bin/170206: complex arcsinh, log, etc.
Date: Fri, 27 Jul 2012 15:50:14 -0500
On 07/27/2012 09:26 AM, Bruce Evans wrote:
> VC> > For clog, the worst case that I've found so far has x^2+y^2-1 ~=
> 1e-47:
> VC> >
> VC> > x =
> 0.999999999999999555910790149937383830547332763671875000000000
> VC> > y =
> VC> > 0.0000000298023223876953091912775497878893005143652317201485857367516
> VC> > (need high precision decimal or these rounded to 53 bits
> binary)
> VC> > x^2+y^2-1 = 1.0947644252537633366591637369e-47
> VC> VC> That is exactly 2^(-156). So maybe triple quad precision really
> is enough.
Furthermore, if you use the computation (x-1)*(x+1)*y*y (assuming as you
do x>y>0), only double precision is necessary. This is proved in the
paper "Implementing Complex Elementary Functions Using Exception
Handling" by Hull, Fairgrieve, Tang, ACM Transactions on Mathematical
Software, Vol 20, No 2, 1994. They give a bound on the error, which I
think can be interpreted as being around 3.9 ULP.
And I think you will see that your example does not contradict their
theorem. Because in your example, x-1 will be rather small.
So to get reasonable ULP (reasonable meaning 4 rather than 1), double
precision is all you need.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207272100.q6RL0Kio005634>
