From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11031 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: catrig Date: Sun, 12 Feb 2017 16:42:19 +0100 Message-ID: <20170212154219.GE12395@port70.net> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1486914157 3125 195.159.176.226 (12 Feb 2017 15:42:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Feb 2017 15:42:37 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) To: musl@lists.openwall.com Original-X-From: musl-return-11046-gllmg-musl=m.gmane.org@lists.openwall.com Sun Feb 12 16:42:30 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1ccwIH-0000F9-W8 for gllmg-musl@m.gmane.org; Sun, 12 Feb 2017 16:42:30 +0100 Original-Received: (qmail 15706 invoked by uid 550); 12 Feb 2017 15:42:32 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 15682 invoked from network); 12 Feb 2017 15:42:31 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11031 Archived-At: * 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: > > 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).