From owner-freebsd-current@freebsd.org Sat Dec 9 01:02:06 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3210E93C46; Sat, 9 Dec 2017 01:02:06 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) 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", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 92B116BB21; Sat, 9 Dec 2017 01:02:06 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id vB9125ea042299 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Dec 2017 17:02:05 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id vB9125mf042298; Fri, 8 Dec 2017 17:02:05 -0800 (PST) (envelope-from sgk) Date: Fri, 8 Dec 2017 17:02:05 -0800 From: Steve Kargl To: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org Subject: [PATCH] Document powl and tgammal kludges Message-ID: <20171209010205.GA42226@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Dec 2017 01:02:06 -0000 The following patch documents the remaining kludges that theraven@ committed in r255294 on 2013-09-06. I have cleaned up all of the others, but powl and tgammal remain. ngie@ seems to have documented the existence of powl with r290605, but did not document the rather poor numerical accuracy of the result. tgammal remains undocumented. As it is unlikely that theraven@ will document the nature of his kludge nor the existence of tgammal, I have have prepared a patch that documents the expected numerical accuracy in BUGS sections, and have also documented tgammal. Index: msun/man/exp.3 =================================================================== --- msun/man/exp.3 (revision 2046) +++ msun/man/exp.3 (working copy) @@ -28,7 +28,7 @@ .\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91 .\" $FreeBSD: head/lib/msun/man/exp.3 290606 2015-11-09 10:41:27Z ngie $ .\" -.Dd November 9, 2015 +.Dd December 8, 2017 .Dt EXP 3 .Os .Sh NAME @@ -180,6 +180,15 @@ then \*(Na**0 = 1 too because x**0 = 1 for all finite and infinite x, i.e., independently of x. .El +.Sh BUGS +To conform with newer C/C++ standards, a stub implementation for +.Nm powl +was committed to the math library, where +.Nm powl +is mapped to +.Nm pow . +Thus, the numerical accuracy is at most that of the 53-bit double +precision implementation. .Sh SEE ALSO .Xr fenv 3 , .Xr ldexp 3 , Index: msun/man/lgamma.3 =================================================================== --- msun/man/lgamma.3 (revision 2046) +++ msun/man/lgamma.3 (working copy) @@ -28,7 +28,7 @@ .\" from: @(#)lgamma.3 6.6 (Berkeley) 12/3/92 .\" $FreeBSD: head/lib/msun/man/lgamma.3 282015 2015-04-26 11:35:07Z bapt $ .\" -.Dd September 12, 2014 +.Dd December 8, 2017 .Dt LGAMMA 3 .Os .Sh NAME @@ -43,7 +43,8 @@ .Nm gammaf , .Nm gammaf_r , .Nm tgamma , -.Nm tgammaf +.Nm tgammaf , +.Nm tgammal , .Nd log gamma functions, gamma function .Sh LIBRARY .Lb libm @@ -76,6 +77,8 @@ .Fn tgamma "double x" .Ft float .Fn tgammaf "float x" +.Ft "long double" +.Fn tgammal "long double x" .Sh DESCRIPTION .Fn lgamma x , .Fn lgammaf x , @@ -106,9 +109,10 @@ but the caller must provide an integer to store the sign of \(*G(x). .Pp The -.Fn tgamma x +.Fn tgamma x , +.Fn tgammaf x , and -.Fn tgammaf x +.Fn tgammal x functions return \(*G(x), with no effect on .Fa signgam . .Pp @@ -166,6 +170,15 @@ For large non-integer negative values, .Fn tgamma will underflow. +.Sh BUGS +To conform with newer C/C++ standards, a stub implementation for +.Nm tgammal +was committed to the math library, where +.Nm tgammal +is mapped to +.Nm tgammal . +Thus, the numerical accuracy is at most that of the 53-bit double +precision implementation. .Sh SEE ALSO .Xr math 3 .Sh STANDARDS @@ -174,8 +187,9 @@ .Fn lgammaf , .Fn lgammal , .Fn tgamma , +.Fn tgammaf , and -.Fn tgammaf +.Fn tgammal functions are expected to conform to .St -isoC-99 . .Sh HISTORY -- Steve