From owner-freebsd-numerics@FreeBSD.ORG Mon Aug 13 20:59:45 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A99A7106566B for ; Mon, 13 Aug 2012 20:59:45 +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 679DF8FC0C for ; Mon, 13 Aug 2012 20:59:45 +0000 (UTC) Received: from [127.0.0.1] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.5/8.14.5) with ESMTP id q7DKxiiT026457 for ; Mon, 13 Aug 2012 15:59:44 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <50296AC0.2040509@missouri.edu> Date: Mon, 13 Aug 2012 15:59:44 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-numerics@freebsd.org References: <20120805030609.R3101@besplex.bde.org> <501D9C36.2040207@missouri.edu> <20120805175106.X3574@besplex.bde.org> <501EC015.3000808@missouri.edu> <20120805191954.GA50379@troutmask.apl.washington.edu> <20120807205725.GA10572@server.rulingia.com> <20120809025220.N4114@besplex.bde.org> <5027F07E.9060409@missouri.edu> <20120814003614.H3692@besplex.bde.org> <50295887.2010608@missouri.edu> <20120813201626.GA54144@troutmask.apl.washington.edu> <502965FC.1040203@missouri.edu> In-Reply-To: <502965FC.1040203@missouri.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Complex arg-trig functions X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 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, 13 Aug 2012 20:59:45 -0000 On 08/13/2012 03:39 PM, Stephen Montgomery-Smith wrote: > On 08/13/2012 03:16 PM, Steve Kargl wrote: >> On Mon, Aug 13, 2012 at 02:41:59PM -0500, Stephen Montgomery-Smith wrote: >>> >>> Also, you made the comment that in the float version, all the 0.5 should >>> become 0.5F. Two questions: >>> 1. Doesn't the compiler do this conversion for me? >> >> float x, y; >> y = 0.5 * x; >> >> The conversion is effectively 'y = 0.5 * (double)x' where >> now the rhs is evaluated in double (53-bit precision). If >> you have 'y = 0.5f * x', then the rhs side is evaluate >> in float (24-bit precision). For a more complicated, >> expression whether one computes in 53 rather than 24 bits >> can have an effect on the outcome. >> > > > Thanks for the clarification. > > I made the changes in catrigf.c adding "F"s as needed. It shaved 5% of the computation time on my system (which means that the float versions are still slower than the double versions. To do hundred million casinh's double: about 18s. float (new): about 19s. float (old): about 20s.