Use of C99 extra long double math functions after r236148
Peter Jeremy
peter at rulingia.com
Sun Aug 12 23:12:28 UTC 2012
On 2012-Jul-22 17:07:29 -0500, Stephen Montgomery-Smith <stephen at missouri.edu> wrote:
>I tested out the casinh program. After a small tweek, the worst case
>ULP is about 2.5 or 3. Edge cases close to I do very well, with a ULP
>of about 0.5. I am very pleased with how well it performs.
That's excellent. I think the exception handling in clog() needs some
work - in particular, input NaNs should be returned, rather than
returning new default NaNs.
>I looked at Peter Jeremy's code for catanh, and I notice that he hasn't
>yet worked to get optimal ULP, since he has concentrated on the handling
>of the edge cases.
As I've previously mentioned, I believe handling the exception cases
can be done completely independently of handling the "normal" cases
and I was focussing on the former since it is just a (simple) matter
of implementing the text in n1256 G.6.2.3.
>If Peter is OK with me butting in, I'll could try to work on getting
>optimal ULP for catanh. I think it will be easier to analyze than
>casinh, since no csqrts need to be involved. I anticipate that the hard
>case will be when z is close to the imaginary axis, and moderately large
>(like 1e-5 + 10*I).
The "normal" cases are (algorithmetically with '^' as exponentiation):
catanh(z) = clog((1+z)/(1-z))/2
= (clog(1+z) - clog(1-z))/2
catanh(x+I*y) = log((y^2 + (1+x)^2)/(y^2 + (1-x)^2))/4 + I*atan2(y^2, 1-x^2-y^2)/2
None of these approaches behave cleanly when |z| is close to 1. If
you have some insights, feel free to work on it.
--
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-numerics/attachments/20120812/2b4eecd0/attachment-0001.pgp
More information about the freebsd-numerics
mailing list