From owner-freebsd-numerics@FreeBSD.ORG Sun Sep 14 21:58:26 2014 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 ESMTPS id 8E352742 for ; Sun, 14 Sep 2014 21:58:26 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 51DADC2E for ; Sun, 14 Sep 2014 21:58:25 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 78DFDD621F0; Mon, 15 Sep 2014 07:36:50 +1000 (EST) Date: Mon, 15 Sep 2014 07:36:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Steve Kargl Subject: Re: lgammal[_r] patch In-Reply-To: <20140913193634.GA2323@troutmask.apl.washington.edu> Message-ID: <20140915072530.T6209@besplex.bde.org> References: <20140913193634.GA2323@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=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=idpLQEjTYo0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=IA8RstZcDPKuw5DDDAkA:9 a=CjuIK1q_8ugA:10 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: Sun, 14 Sep 2014 21:58:26 -0000 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. You even matched the fdlibm style bugs almost perfectly :-). Do you know agree that copying a reasonable method is easiest? > 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. > 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. > + > __END_DECLS > > #endif /* !_MATH_H_ */ Bruce