mailing list of musl libc
 help / color / mirror / code / Atom feed
* catrig
@ 2017-02-12  4:59 James Cloos
  2017-02-12 15:42 ` catrig Szabolcs Nagy
  0 siblings, 1 reply; 2+ messages in thread
From: James Cloos @ 2017-02-12  4:59 UTC (permalink / raw)
  To: musl

There was a recent post on one of the freebsd lists about Stephen
Montgomery-Smith's catrig routines:

  http://faculty.missouri.edu/~stephen/software/#catrig

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,
http://dl.acm.org/citation.cfm?id=275324.

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.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 0x997A9F17ED7DAEA6


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: catrig
  2017-02-12  4:59 catrig James Cloos
@ 2017-02-12 15:42 ` Szabolcs Nagy
  0 siblings, 0 replies; 2+ messages in thread
From: Szabolcs Nagy @ 2017-02-12 15:42 UTC (permalink / raw)
  To: musl

* James Cloos <cloos@jhcloos.com> [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:
> 
>   http://faculty.missouri.edu/~stephen/software/#catrig
> 
> 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,
> http://dl.acm.org/citation.cfm?id=275324.
> 
> 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).


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-12 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-12  4:59 catrig James Cloos
2017-02-12 15:42 ` catrig Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).