From owner-freebsd-numerics@FreeBSD.ORG Tue May 28 17:37:10 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0208ED9D for ; Tue, 28 May 2013 17:37:10 +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 DF6F0A95 for ; Tue, 28 May 2013 17:37:09 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.6/8.14.6) with ESMTP id r4SHb9mm051666 for ; Tue, 28 May 2013 10:37:09 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.6/8.14.6/Submit) id r4SHb9LG051665 for freebsd-numerics@freebsd.org; Tue, 28 May 2013 10:37:09 -0700 (PDT) (envelope-from sgk) Date: Tue, 28 May 2013 10:37:09 -0700 From: Steve Kargl To: freebsd-numerics@freebsd.org Subject: Re: Patches for s_expl.c Message-ID: <20130528173709.GA51603@troutmask.apl.washington.edu> References: <20130528172242.GA51485@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130528172242.GA51485@troutmask.apl.washington.edu> User-Agent: Mutt/1.5.21 (2010-09-15) 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: Tue, 28 May 2013 17:37:10 -0000 On Tue, May 28, 2013 at 10:22:42AM -0700, Steve Kargl wrote: > Here are two patches for ld80/s_expl.c and ld128/s_expl.c. > Instead of committing the one large patch that I have spent > hours testing, I have split it into two. One patch fixes/updates > expl(). The other patch is the implementation of expm1l(). I forgot to send the 3rd patch, which updates documentations, deals with 53-bit long double targets, and math.h. Yes, there is some cruft in the diff, which I'll disentangle when I do the commit. -- steve Index: Symbol.map =================================================================== --- Symbol.map (revision 251062) +++ Symbol.map (working copy) @@ -250,4 +250,7 @@ ctanh; ctanhf; expl; + expm1l; + logl; + sincos; }; Index: man/exp.3 =================================================================== --- man/exp.3 (revision 251062) +++ man/exp.3 (working copy) @@ -41,6 +41,7 @@ .Nm exp2l , .Nm expm1 , .Nm expm1f , +.Nm expm1l , .Nm pow , .Nm powf .Nd exponential and power functions @@ -64,6 +65,8 @@ .Fn expm1 "double x" .Ft float .Fn expm1f "float x" +.Ft long double +.Fn expm1l "long double x" .Ft double .Fn pow "double x" "double y" .Ft float @@ -88,9 +91,10 @@ .Fa x . .Pp The -.Fn expm1 -and the -.Fn expm1f +.Fn expm1 , +.Fn expm1f , +and +.Fn expm1l functions compute the value exp(x)\-1 accurately even for tiny argument .Fa x . .Pp Index: src/math.h =================================================================== --- src/math.h (revision 251062) +++ src/math.h (working copy) @@ -405,6 +405,7 @@ long double cosl(long double); long double exp2l(long double); long double expl(long double); +long double expm1l(long double); long double fabsl(long double) __pure2; long double fdiml(long double, long double); long double floorl(long double); @@ -419,6 +420,7 @@ long long llrintl(long double); long long llroundl(long double); long double logbl(long double); +long double logl(long double); long lrintl(long double); long lroundl(long double); long double modfl(long double, long double *); /* fundamentally !__pure2 */ @@ -440,6 +442,11 @@ long double truncl(long double); #endif /* __ISO_C_VISIBLE >= 1999 */ + +#if __BSD_VISIBLE +void sincos(double, double *, double *); +#endif /* __BSD_VISIBLE */ + __END_DECLS #endif /* !_MATH_H_ */ @@ -462,12 +469,10 @@ long double coshl(long double); long double erfcl(long double); long double erfl(long double); -long double expm1l(long double); long double lgammal(long double); long double log10l(long double); long double log1pl(long double); long double log2l(long double); -long double logl(long double); long double powl(long double, long double); long double sinhl(long double); long double tanhl(long double); Index: src/s_expm1.c =================================================================== --- src/s_expm1.c (revision 251062) +++ src/s_expm1.c (working copy) @@ -216,3 +216,7 @@ } return y; } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(expm1, expm1l); +#endif