From owner-freebsd-numerics@FreeBSD.ORG Mon Sep 15 00:11:05 2014 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92A57711 for ; Mon, 15 Sep 2014 00:11:05 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 73680A7A for ; Mon, 15 Sep 2014 00:11:05 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id s8F0Ax2l007366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 14 Sep 2014 17:10:59 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id s8F0AxX8007365; Sun, 14 Sep 2014 17:10:59 -0700 (PDT) (envelope-from sgk) Date: Sun, 14 Sep 2014 17:10:59 -0700 From: Steve Kargl To: Bruce Evans Subject: Re: lgammal[_r] patch Message-ID: <20140915001058.GA7352@troutmask.apl.washington.edu> References: <20140913193634.GA2323@troutmask.apl.washington.edu> <20140915072530.T6209@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140915072530.T6209@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-numerics@freebsd.org X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.18-1 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, 15 Sep 2014 00:11:05 -0000 On Mon, Sep 15, 2014 at 07:36:49AM +1000, Bruce Evans wrote: > On Sat, 13 Sep 2014, Steve Kargl wrote: > > > Following my .sig is a patch that contains the ld80 and ld128 > > implementations of lgamma[_r](). It also contains an update > > to lgammaf_r() and lgamma_r(). Specifically, it has > > Looks good. It passed all my tests so far. I haven't tested ld128 > or compared ld80 with more than d64. I tested ld128 on flame, but it is far from exhaustive (during development, 10000, 20000, or 1000000 values in an interval. :-) > You even matched the fdlibm style bugs almost perfectly :-). Do you > know agree that copying a reasonable method is easiest? It was painful. I tend to now try to conform to style(9). But, having contribute to gfortran for years, I got use to GNU style. fdlibm style is just different. > > Index: ld80/e_lgammal_r.c > > =================================================================== > > --- ld80/e_lgammal_r.c (revision 0) > > +++ ld80/e_lgammal_r.c (working copy) > > @@ -0,0 +1,343 @@ > > +/* @(#)e_lgamma_r.c 1.3 95/01/18 */ > > +/* > > + * ==================================================== > > + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. > > + * > > + * Developed at SunSoft, a Sun Microsystems, Inc. business. > > + * Permission to use, copy, modify, and distribute this > > + * software is freely granted, provided that this notice > > + * is preserved. > > + * ==================================================== > > + */ > > + > > +#include > > +__FBSDID("$FreeBSD"); > > +/* > > + * See s_lgamma_r.c for complete comments. > > + * > > + * Converted to long double by Steven G. Kargl. > > + */ > > +#include > > +#ifdef __i386__ > > +#include > > +#endif > > Missing blank line before the include here and in most other > places. OK. I'll fix this before I commit. > > Index: src/math.h > > =================================================================== > > --- src/math.h (revision 271479) > > +++ src/math.h (working copy) > > @@ -496,8 +496,12 @@ > > long double tanl(long double); > > long double tgammal(long double); > > long double truncl(long double); > > +#endif /* __ISO_C_VISIBLE >= 1999 */ > > > > -#endif /* __ISO_C_VISIBLE >= 1999 */ > > +#if __BSD_VISIBLE > > +long double lgammal_r(long double, int *); > > +#endif /* __BSD_VISIBLE */ > > This comment has extra indentation and is not needed. Only larger > sections or more complicated conditionals need a comment on #endif. > The rest of the file mostly follows this rule. One large section > is missing a comment. > > The BSD extras aren't very well sorted. Neither are the float and > double sections. It was only useful to keep the float and double > functions in separate sections in 1990 when they weren't standard. OK. I'll delete the comment. Note, this section will grow when sincosl, j0l, j1l, etc are added. I'm inclined to coalesce and sort the various __BSD_VISIBLE sections into one. -- Steve