From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 26 21:50:25 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7B801065670 for ; Sun, 26 Aug 2012 21:50:25 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id 93C038FC0C for ; Sun, 26 Aug 2012 21:50:25 +0000 (UTC) Received: from [127.0.0.1] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.5/8.14.5) with ESMTP id q7QLoIv2016237 for ; Sun, 26 Aug 2012 16:50:19 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <503A9A1A.1050004@missouri.edu> Date: Sun, 26 Aug 2012 16:50:18 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-numerics@freebsd.org References: <5017111E.6060003@missouri.edu> <501C361D.4010807@missouri.edu> <20120804165555.X1231@besplex.bde.org> <501D51D7.1020101@missouri.edu> <20120805030609.R3101@besplex.bde.org> <501D9C36.2040207@missouri.edu> <20120805175106.X3574@besplex.bde.org> <501EC015.3000808@missouri.edu> <20120805191954.GA50379@troutmask.apl.washington.edu> <20120807205725.GA10572@server.rulingia.com> <20120809025220.N4114@besplex.bde.org> <5027F07E.9060409@missouri.edu> <20120814003614.H3692@besplex.bde.org> <50295F5C.6010800@missouri.edu> <20120814072946.S5260@besplex.bde.org> <50297CA5.5010900@missouri.edu> <50297E43.7090309@missouri.edu> <20120814201105.T934@besplex.bde.org> <502A780B.2010106@missouri.edu> <20120815223631.N1751@besplex.bde.org> <502C0CF8.8040003@missouri.edu> <503265E8.3060101@missouri.edu> <5036EFDB.3010304@missouri.edu> In-Reply-To: <5036EFDB.3010304@missouri.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Complex arg-trig functions X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 26 Aug 2012 21:50:25 -0000 On 08/23/2012 10:07 PM, Stephen Montgomery-Smith wrote: > I just found out that the boost libraries implement the complex asin > function. I think their implementation is more faithful to the paper by > Hull et al than my implementation is. It does seem to have a BSD style > license. The only problem with it is that it is written in C++. > > http://www.boost.org/doc/libs/1_43_0/boost/math/complex/asin.hpp It turns out that this version of asin.hpp had a bug. Look instead at http://www.boost.org/doc/libs/1_51_0/boost/math/complex/asin.hpp Their acos is a bit buggier. Their atanh is quite a lot buggier. Here are bugfixes: https://svn.boost.org/trac/boost/ticket/7290 https://svn.boost.org/trac/boost/ticket/7291 Their asin seems to be about 10-15% faster than mine. Their error is slightly higher (4.5 ULP instead of 4ULP). The algorithm they used will work directly for float, whereas my algorithm needed adjustments from the double to the float version. From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 26 22:25:28 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B28B61065670 for ; Sun, 26 Aug 2012 22:25:28 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 6D0678FC08 for ; Sun, 26 Aug 2012 22:25:28 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q7QMPMv5068392; Sun, 26 Aug 2012 15:25:22 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q7QMPMXE068391; Sun, 26 Aug 2012 15:25:22 -0700 (PDT) (envelope-from sgk) Date: Sun, 26 Aug 2012 15:25:22 -0700 From: Steve Kargl To: Stephen Montgomery-Smith Message-ID: <20120826222522.GA68366@troutmask.apl.washington.edu> References: <20120814072946.S5260@besplex.bde.org> <50297CA5.5010900@missouri.edu> <50297E43.7090309@missouri.edu> <20120814201105.T934@besplex.bde.org> <502A780B.2010106@missouri.edu> <20120815223631.N1751@besplex.bde.org> <502C0CF8.8040003@missouri.edu> <503265E8.3060101@missouri.edu> <5036EFDB.3010304@missouri.edu> <503A9A1A.1050004@missouri.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <503A9A1A.1050004@missouri.edu> User-Agent: Mutt/1.4.2.3i Cc: freebsd-numerics@freebsd.org Subject: Re: Complex arg-trig functions X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 26 Aug 2012 22:25:28 -0000 On Sun, Aug 26, 2012 at 04:50:18PM -0500, Stephen Montgomery-Smith wrote: > On 08/23/2012 10:07 PM, Stephen Montgomery-Smith wrote: > >I just found out that the boost libraries implement the complex asin > >function. I think their implementation is more faithful to the paper by > >Hull et al than my implementation is. It does seem to have a BSD style > >license. The only problem with it is that it is written in C++. > > > >http://www.boost.org/doc/libs/1_43_0/boost/math/complex/asin.hpp > > It turns out that this version of asin.hpp had a bug. Look instead at > http://www.boost.org/doc/libs/1_51_0/boost/math/complex/asin.hpp > > Their acos is a bit buggier. Their atanh is quite a lot buggier. Here > are bugfixes: > https://svn.boost.org/trac/boost/ticket/7290 > https://svn.boost.org/trac/boost/ticket/7291 > > Their asin seems to be about 10-15% faster than mine. Their error is > slightly higher (4.5 ULP instead of 4ULP). The algorithm they used will > work directly for float, whereas my algorithm needed adjustments from > the double to the float version. I don't know others opinion on C++ and libm, but I would much prefer to keep libm sources based in C. First, I don't C++ so can't work on the source as either a reviewer or debugging. Second, does this then mean that one needs to link with libc++? Finally, the start of the file is #ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED # include #endif #ifndef BOOST_MATH_LOG1P_INCLUDED # include #endif #include So, we would need to include three additional files. -- Steve From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 26 22:30:51 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 958E5106564A for ; Sun, 26 Aug 2012 22:30:51 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id 1C1AF8FC14 for ; Sun, 26 Aug 2012 22:30:51 +0000 (UTC) Received: from [127.0.0.1] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.5/8.14.5) with ESMTP id q7QMUo0J018842; Sun, 26 Aug 2012 17:30:50 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <503AA39A.1070203@missouri.edu> Date: Sun, 26 Aug 2012 17:30:50 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Steve Kargl References: <20120814072946.S5260@besplex.bde.org> <50297CA5.5010900@missouri.edu> <50297E43.7090309@missouri.edu> <20120814201105.T934@besplex.bde.org> <502A780B.2010106@missouri.edu> <20120815223631.N1751@besplex.bde.org> <502C0CF8.8040003@missouri.edu> <503265E8.3060101@missouri.edu> <5036EFDB.3010304@missouri.edu> <503A9A1A.1050004@missouri.edu> <20120826222522.GA68366@troutmask.apl.washington.edu> In-Reply-To: <20120826222522.GA68366@troutmask.apl.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-numerics@freebsd.org Subject: Re: Complex arg-trig functions X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 26 Aug 2012 22:30:51 -0000 On 08/26/2012 05:25 PM, Steve Kargl wrote: > On Sun, Aug 26, 2012 at 04:50:18PM -0500, Stephen Montgomery-Smith wrote: >> On 08/23/2012 10:07 PM, Stephen Montgomery-Smith wrote: >>> I just found out that the boost libraries implement the complex asin >>> function. I think their implementation is more faithful to the paper by >>> Hull et al than my implementation is. It does seem to have a BSD style >>> license. The only problem with it is that it is written in C++. >>> >>> http://www.boost.org/doc/libs/1_43_0/boost/math/complex/asin.hpp >> >> It turns out that this version of asin.hpp had a bug. Look instead at >> http://www.boost.org/doc/libs/1_51_0/boost/math/complex/asin.hpp >> >> Their acos is a bit buggier. Their atanh is quite a lot buggier. Here >> are bugfixes: >> https://svn.boost.org/trac/boost/ticket/7290 >> https://svn.boost.org/trac/boost/ticket/7291 >> >> Their asin seems to be about 10-15% faster than mine. Their error is >> slightly higher (4.5 ULP instead of 4ULP). The algorithm they used will >> work directly for float, whereas my algorithm needed adjustments from >> the double to the float version. > > I don't know others opinion on C++ and libm, but I would much > prefer to keep libm sources based in C. I wouldn't recommend using these files "as is." But converting them all to C would be a fairly easy thing to do. And of course, I would prefer to use my catrig functions. From owner-freebsd-numerics@FreeBSD.ORG Mon Aug 27 00:09:41 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC666106564A for ; Mon, 27 Aug 2012 00:09:41 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id 88A718FC12 for ; Mon, 27 Aug 2012 00:09:41 +0000 (UTC) Received: from [127.0.0.1] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.5/8.14.5) with ESMTP id q7R09eqc025232 for ; Sun, 26 Aug 2012 19:09:40 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <503ABAC4.3060503@missouri.edu> Date: Sun, 26 Aug 2012 19:09:40 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-numerics@freebsd.org References: <5017111E.6060003@missouri.edu> <501C361D.4010807@missouri.edu> <20120804165555.X1231@besplex.bde.org> <501D51D7.1020101@missouri.edu> <20120805030609.R3101@besplex.bde.org> <501D9C36.2040207@missouri.edu> <20120805175106.X3574@besplex.bde.org> <501EC015.3000808@missouri.edu> <20120805191954.GA50379@troutmask.apl.washington.edu> <20120807205725.GA10572@server.rulingia.com> <20120809025220.N4114@besplex.bde.org> <5027F07E.9060409@missouri.edu> <20120814003614.H3692@besplex.bde.org> <50295F5C.6010800@missouri.edu> <20120814072946.S5260@besplex.bde.org> <50297CA5.5010900@missouri.edu> <50297E43.7090309@missouri.edu> <20120814201105.T934@besplex.bde.org> <502A780B.2010106@missouri.edu> <20120815223631.N1751@besplex.bde.org> <502C0CF8.8040003@missouri.edu> <503265E8.3060101@missouri.edu> <5036EFDB.3010304@missouri.edu> <503A9A1A.1050004@missouri.edu> In-Reply-To: <503A9A1A.1050004@missouri.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Complex arg-trig functions X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 27 Aug 2012 00:09:41 -0000 On 08/26/2012 04:50 PM, Stephen Montgomery-Smith wrote: > On 08/23/2012 10:07 PM, Stephen Montgomery-Smith wrote: >> I just found out that the boost libraries implement the complex asin >> function. I think their implementation is more faithful to the paper by >> Hull et al than my implementation is. It does seem to have a BSD style >> license. The only problem with it is that it is written in C++. >> > http://www.boost.org/doc/libs/1_51_0/boost/math/complex/asin.hpp > Their asin seems to be about 10-15% faster than mine. Their error is > slightly higher (4.5 ULP instead of 4ULP). But the speed improvement are because they use their own log1p function. When I replace it with the standard log1p, it goes 5% slower than mine.