From owner-freebsd-numerics@FreeBSD.ORG Mon Dec 17 13:30:49 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1107AD8 for ; Mon, 17 Dec 2012 13:30:49 +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 B3C528FC15 for ; Mon, 17 Dec 2012 13:30:49 +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 qBHDUlb2090001; Mon, 17 Dec 2012 07:30:48 -0600 (CST) (envelope-from stephen@missouri.edu) Message-ID: <50CF1E87.7030803@missouri.edu> Date: Mon, 17 Dec 2012 07:30:47 -0600 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: complex arc-trig etc References: <50CE9D0C.8080901@missouri.edu> <20121217191324.T1277@besplex.bde.org> In-Reply-To: <20121217191324.T1277@besplex.bde.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-numerics@freebsd.org 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: Mon, 17 Dec 2012 13:30:49 -0000 On 12/17/2012 02:38 AM, Bruce Evans wrote: > On Sun, 16 Dec 2012, Stephen Montgomery-Smith wrote: > >> Hey guys, my complex arc-trig functions at >> http://people.freebsd.org/~stephen/ have been sitting there a long time. >> Anyone want to commit them? > > I was sort of waiting for the next rounds of changes: > > 1. update the template to give similar code for float and long double > 2. make it work for i386 using ENTERI() > 3. test (2) > 4. fix some style bugs. It would be easy for me to run it through > indent(1) and get large diffs, but I want you to do it. > 5. decide what to do for atanhl(). I would prefer a version that is a > direct translation of e_atanh.c including style bugs and the filename > prefix but not the comment, unless you change the algorithm. > 6. decide what to do with the template and/or the generation from it > that strips comments. > > I haven't done (2), (3) or (6) for clog*() either. For (6), instead of > a template and stripped comments, I have all the functions in the same > file and all comments duplicated, and have to split the file manually > to compare the functions. > > I only have these local patches. They correspond to (1) and (5). Also, > keep up with the API change in LD80C(). > > % --- /home/stephen/public_html/catrigf.c 2012-09-22 > 21:13:50.000000000 +0000 > % +++ catrigf.c 2012-09-22 21:35:51.287614000 +0000 > % @@ -353,12 +353,7 @@ > % } > % % - if (ax == 1 && ay < FLT_EPSILON) { > % -#if 0 > % - if (ay > 2*FLT_MIN) > % - rx = - logf(ay/2) / 2; > % - else > % -#endif > % - rx = - (logf(ay) - m_ln2) / 2; > % - } else > % + if (ax == 1 && ay < FLT_EPSILON) > % + rx = - (logf(ay) - m_ln2) / 2; > % + else > % rx = log1pf(4*ax / sum_squares(ax-1, ay)) / 4; > % % --- /home/stephen/public_html/catrigl.c 2012-09-22 > 21:14:24.000000000 +0000 > % +++ catrigl.c 2012-09-28 19:39:47.799585000 +0000 > % @@ -60,6 +60,6 @@ > % #if LDBL_MANT_DIG == 64 > % static const union IEEEl2bits > % -um_e = LD80C(0xadf85458a2bb4a9b, 1, 0, > 2.71828182845904523536e0L), > % -um_ln2 = LD80C(0xb17217f7d1cf79ac, -1, 0, > 6.93147180559945309417e-1L); > % +um_e = LD80C(0xadf85458a2bb4a9b, 1, 2.71828182845904523536e+0L), > % +um_ln2 = LD80C(0xb17217f7d1cf79ac, -1, 6.93147180559945309417e-1L); > % #define m_e um_e.e > % #define m_ln2 um_ln2.e > % @@ -348,5 +348,5 @@ > % % if (y == 0 && ax <= 1) > % - return (cpackl(atanhl(x), y)); /* XXX need atanhl() */ > % + return (cpackl(atanh(x), y)); /* XXX need atanhl() */ > % % if (x == 0) > % @@ -369,12 +369,7 @@ > % } > % % - if (ax == 1 && ay < LDBL_EPSILON) { > % -#if 0 > % - if (ay > 2*LDBL_MIN) > % - rx = - logl(ay/2) / 2; > % - else > % -#endif > % - rx = - (logl(ay) - m_ln2) / 2; > % - } else > % + if (ax == 1 && ay < LDBL_EPSILON) > % + rx = - (logl(ay) - m_ln2) / 2; > % + else > % rx = log1pl(4*ax / sum_squares(ax-1, ay)) / 4; > % > > You also need log*l() be committed before catrigl() can work. > > Bruce > > OK, I didn't realize it needed this much work (which I admit isn't that much but...). So maybe I'll sit on these things for a while. I am not swamped like Steve is. But I do have other projects that should take priority for now. Thanks, Stephen