Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id o5G7Ad99026127 for ; Wed, 16 Jun 2010 09:10:40 +0200 Received: (qmail 21052 invoked by alias); 16 Jun 2010 07:10:34 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 16 Jun 2010 07:10:33 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx084) with SMTP; 16 Jun 2010 09:10:33 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o5G78dTZ016840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2010 09:08:40 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id o5FM159m020186; Wed, 16 Jun 2010 09:08:26 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 433543 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 16 Jun 2010 09:08:26 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id o5G78QDq032699 for ; Wed, 16 Jun 2010 09:08:26 +0200 Received: from ueamailgate01.uea.ac.uk (ueamailgate01.uea.ac.uk [139.222.131.184]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o5G78KaJ016548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 16 Jun 2010 09:08:24 +0200 Received: from ueams01.uea.ac.uk (ueams01.uea.ac.uk [139.222.131.78]) by ueamailgate01.uea.ac.uk (8.13.8/8.13.8) with ESMTP id o5G78BEY028256 for ; Wed, 16 Jun 2010 08:08:11 +0100 Received: from [139.222.202.234] by ueams01.uea.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1OOmjK-0000bw-MJ for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 16 Jun 2010 08:08:10 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 References: <4C17EAC4.60705@morningstar2.co.uk> <4C181F6A.2060308@earthlink.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Bayes-Prob: 0.996 (Score 5, tokens from: @@RPTN, outgoing) X-CanIt-Geo: ip=139.222.131.78; country=GB; region=I9; city=Norwich; latitude=52.6333; longitude=1.3000; http://maps.google.com/maps?q=52.6333,1.3000&z=6 X-CanItPRO-Stream: UEA:outgoing (inherits from UEA:default,base:default) X-Canit-Stats-ID: 51939399 - 82fd75fb37fc - 20100616 X-Scanned-By: CanIt (www . roaringpenguin . com) on 139.222.131.184 Message-ID: <4C18785B.4030600@morningstar2.co.uk> Date: Wed, 16 Jun 2010 08:08:11 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: l3fp: A floating point unit for expl3 To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <4C181F6A.2060308@earthlink.net> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p77e5KAPs1l6v/Sb97LojnDtMgfETrECMLUO9erHzOJe+OynZRhvlGqvET/J 3dm2vHWnQHIuidpgLhS+P7NNYz+zyHLMY9yCwGoTDtboDaDPUTmYi5shhPJySBzZnboYr4mQK+ZF NwOSQ==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6337 On 16/06/2010 01:48, peter wilson wrote: > At one point, many tears (a Freudian slip --- I meant to write `years') > ago, I needed to manipulate large numbers within LaTeX and wrote a > package to do so. I never released it and it has gone the way of several > computer upgrades. In any case, it handled mantissas in the range 0 -- > 1,000,000,000 with exponents in the range of +/- 0 -- 1,000,000,000. > Would you consider extending your basic l3fp module to include > exponents, perhaps, if necessary by being able to switch between the > current 18 significant digits to 9 significant digits + exponent. > > Peter W. My first plan had been to do everything internally in exponent form, but I realised it would be very inefficient for the large number of cases where it was not needed. Thinking about it some more, I wonder about the following: - Input without exponent: calculate as currently, and shift result to exponent form if there is an overflow. - Input in exponent form: calculate with exponents, shift result either to appropriate exponent form or drop exponent if not needed. That should still be reasonably fast (there are just a few extra checks for input which is not exponent-containing), and I think not too hard to do. Certainly not as hard as working out how to do sin, cos, etc. (I'm currently reading about the CORDIC method for this: probably need to do some speed tests. The fp package does not explain the algorithm it uses, so I may have to work it all out by hand.) -- Joseph Wrigh