From owner-freebsd-numerics@FreeBSD.ORG Sat Nov 2 22:48:26 2013 Return-Path: Delivered-To: freebsd-numerics@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB172579; Sat, 2 Nov 2013 22:48:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1C12CFE; Sat, 2 Nov 2013 22:48:26 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 1F0FF1041C06; Sun, 3 Nov 2013 09:48:22 +1100 (EST) Date: Sun, 3 Nov 2013 09:48:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Steve Kargl Subject: Re: MUSL math functions In-Reply-To: <20131102173011.GB95769@troutmask.apl.washington.edu> Message-ID: <20131103092848.C1004@besplex.bde.org> References: <20131031133352.GA59918@troutmask.apl.washington.edu> <20131101072032.P1002@besplex.bde.org> <20131102173011.GB95769@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=1RzFHNT0_LQA:10 a=Gz7s5_CCAAAA:8 a=xXTXSSQ9EgiccQTh1nAA:9 a=CjuIK1q_8ugA:10 a=j5_VlLaHV7UA:10 Cc: "freebsd-numerics@FreeBSD.org" , David Chisnall , Bruce Evans X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2013 22:48:26 -0000 On Sat, 2 Nov 2013, Steve Kargl wrote: > On Fri, Nov 01, 2013 at 07:52:27AM +1100, Bruce Evans wrote: >> cerfl (not in C99) is apparently amazingly complicated. There is a >> whole library libcerf for it on the net. > > openlibm includes http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package > I haven't looked into the quality. The webpage claims 13 significant > digits, which is not quite good enough for double. This might be the same (I remember the NOST web page and libcerf mentioning something like Faddeev's algorithm). I thought it was better. >> erf support is very patchy in calculators. See the list in the NIST >> web pages that update Abramowicz and Stegun. I find it hard to test >> since it is not in pari. > > MPFR has implementations for erf and erfc. Testing on flame is > extremely slow due to this. I think that I've only tested > around 50000 values in the non-asymptotic range. I hoped mpfr wouldn't be so (relatively) slow on flame (old/terminanal sparc64). pari does everything using fixed point so it doesn't notice long doubles being slower. Numerical integration of exp(-x^2) to give erf() is only 1000 times slower than exp() in pari (5ms/call vs 5us/call for 28 decimal digits on freefall) so it might be usable. It is just ~100000 times slower than FreeBSD libm erf(). gamma() is native and is 3 times slower than exp() in pari. Bruce