Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2012 15:50:14 -0500
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-bugs@freebsd.org, FreeBSD-gnats-submit@freebsd.org, Stephen Montgomery-Smith <stephen@freebsd.org>
Subject:   Re: bin/170206: complex arcsinh, log, etc.
Message-ID:  <5012FF06.4030501@missouri.edu>
In-Reply-To: <20120727233939.A7820@besplex.bde.org>
References:  <201207270247.q6R2lkeR021134@wilberforce.math.missouri.edu> <20120727233939.A7820@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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?5012FF06.4030501>