Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Aug 2012 23:12:28 -0000
From:      Peter Jeremy <peter@rulingia.com>
To:        Stephen Montgomery-Smith <stephen@missouri.edu>
Cc:        Diane Bruce <db@db.net>, Bruce Evans <brde@optusnet.com.au>, John Baldwin <jhb@freebsd.org>, David Chisnall <theraven@freebsd.org>, Bruce Evans <bde@freebsd.org>, Steve Kargl <sgk@troutmask.apl.washington.edu>, David Schultz <das@freebsd.org>, Warner Losh <imp@bsdimp.com>
Subject:   Re: Use of C99 extra long double math functions after r236148
Message-ID:  <20120722231300.GA8033@server.rulingia.com>
Resent-Message-ID: <20120812231221.GS20453@server.rulingia.com>
In-Reply-To: <500C79A1.6080809@missouri.edu>
References:  <20120721032448.X5744@besplex.bde.org> <5009BD6C.9050301@missouri.edu> <20120721123522.T877@besplex.bde.org> <500A2565.9090009@missouri.edu> <20120721181204.A1702@besplex.bde.org> <500B594D.1020305@missouri.edu> <20120722125300.P2246@besplex.bde.org> <500C1B1A.5070107@missouri.edu> <20120723015912.K5029@besplex.bde.org> <500C79A1.6080809@missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--uAKRQypu60I7Lcqm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2012-Jul-22 17:07:29 -0500, Stephen Montgomery-Smith <stephen@missouri.e=
du> wrote:
>I tested out the casinh program.  After a small tweek, the worst case=20
>ULP is about 2.5 or 3.  Edge cases close to I do very well, with a ULP=20
>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=20
>yet worked to get optimal ULP, since he has concentrated on the handling=
=20
>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=20
>optimal ULP for catanh.  I think it will be easier to analyze than=20
>casinh, since no csqrts need to be involved.  I anticipate that the hard=
=20
>case will be when z is close to the imaginary axis, and moderately large=
=20
>(like 1e-5 + 10*I).

The "normal" cases are (algorithmetically with '^' as exponentiation):

catanh(z) =3D clog((1+z)/(1-z))/2
          =3D (clog(1+z) - clog(1-z))/2
catanh(x+I*y) =3D 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.

--=20
Peter Jeremy

--uAKRQypu60I7Lcqm
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlAMiPwACgkQ/opHv/APuIe48ACgpA3iF4khaKiaOrVgd6KWaWnn
pg0AoL+hqCD6aZuaoPj85qSJZ1hX3bgX
=L1Wx
-----END PGP SIGNATURE-----

--uAKRQypu60I7Lcqm--



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