From owner-freebsd-current@FreeBSD.ORG Wed Jul 25 17:27:51 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C0ED106566B; Wed, 25 Jul 2012 17:27:51 +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 EF8388FC0A; Wed, 25 Jul 2012 17:27:50 +0000 (UTC) Received: from [128.206.184.213] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.5/8.14.5) with ESMTP id q6PHRhQe043153; Wed, 25 Jul 2012 12:27:43 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <50102C8F.2080901@missouri.edu> Date: Wed, 25 Jul 2012 12:27:43 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Rainer Hurling References: <4FC43C8F.5090509@missouri.edu> <20120529045612.GB4445@server.rulingia.com> <20120708124047.GA44061@zim.MIT.EDU> <210816F0-7ED7-4481-ABFF-C94A700A3EA0@bsdimp.com> <20120708233624.GA53462@troutmask.apl.washington.edu> <4FFBF16D.2030007@gwdg.de> <2A1DE516-ABB4-49D7-8C3D-2C4DA2D9FCF5@bsdimp.com> <4FFC412B.4090202@gwdg.de> <20120710151115.GA56950@zim.MIT.EDU> <4FFC5E5D.8000502@gwdg.de> <20120710225801.GB58778@zim.MIT.EDU> <50101EDE.6030509@gwdg.de> In-Reply-To: <50101EDE.6030509@gwdg.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Schultz , freebsd-current@freebsd.org, Bruce Evans , Steve Kargl Subject: Re: Use of C99 extra long double math functions after r236148 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 25 Jul 2012 17:27:51 -0000 On 07/25/12 11:29, Rainer Hurling wrote: > Many thanks to you three for implementing expl() with r238722 and r238724. > > I am not a C programmer, but would like to ask if the following example > is correct and suituable as a minimalistic test of this new C99 function? > > > //----------------------------------- > #include > #include > > int main(void) > { > double c = 2.0; > long double d = 2.0; > > double e = exp(c); > long double f = expl(d); > > printf("exp(%f) is %.*f\n", c, 90, e); > printf("expl(%Lf) is %.*Lf\n", d, 90, f); > > return 0; > } > //----------------------------------- > > > Compiled with 'c99 -o math_expl math_expl.c -lm' and running afterwards > it gives me: > > exp(2.000000) is > 7.389056098930650406941822438966482877731323242187500000000000000000000000000000000000000000 > > expl(2.000000) is > 7.389056098930650227397942675366948606097139418125152587890625000000000000000000000000000000 > Just as a point of comparison, here is the answer computed using Mathematica: N[Exp[2], 50] 7.3890560989306502272304274605750078131803155705518 As you can see, the expl solution has only a few digits more accuracy that exp.