bin/170206: complex arcsinh, log, etc.
Stephen Montgomery-Smith
stephen at missouri.edu
Fri Jul 27 20:50:16 UTC 2012
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.
More information about the freebsd-bugs
mailing list