Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 12 Feb 2017 16:42:19 +0100
From: Szabolcs Nagy <>
Subject: Re: catrig

* James Cloos <> [2017-02-11 23:59:46 -0500]:
> There was a recent post on one of the freebsd lists about Stephen
> Montgomery-Smith's catrig routines:
> which is based on the paper "Implementing the complex arcsine and
> arccosine functions using exception handling" by T. E. Hull, Thomas
> F. Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on
> Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335,
> It looks to be the most accurate catrig code availalbe.  Stephen writes
> that tests indicate that both the real and imaginary parts of the
> results are good to within 4 ULP, that catrigl.c supports both 80 bit and
> 128 bit long double but that the float version is occasionally slightly
> worse that 4 ULP.
> I don't know how much interest the musl community has in better accuracy
> for libm, but in case there is interest Stephen's code looks like a good
> choice.
> And I see musl already uses freebsd libm code for some of the complex trig.

glibc and freebsd have precise complex math,
i think musl should do it too, but i dont yet
have the testing infrastructure

musl has slightly different tradeoffs than freebsd
so we cannot take the code as is: i prefer to do
bithacks in a more explicit way, volatile hacks are
not allowed and code size matters so unnecessary
optimization/special case branches should be pruned.

it was low prio because i dont know of any actual
users of these functions (for a long time glibc
and bsd implementations were bad so nobody could
rely on the precision of these functions).

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.