Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!uunet!mcsun!hp4nl!phigate!ehviea!leo From: leo@ehviea.ine.philips.nl (Leo de Wit) Newsgroups: comp.sys.atari.st.tech Subject: Re: Re: Floating Pt. Math with a 68881 not always faster Message-ID: <887@ehviea.ine.philips.nl> Date: 10 Sep 90 11:21:51 GMT References: <8387@ncar.ucar.edu> Reply-To: leo@ehviea.UUCP (Leo de Wit) Organization: Philips I&E Eindhoven Lines: 28 In article <8387@ncar.ucar.edu> moses@hao.ucar.edu (Julie Moses) writes: | Having looked at the Alcyon 68881 assembly source code, there |does not seem to be much one can do to further optimize the F.P. |routines. Prospero's are probably based on Alcyons. The TT's copressor |will probably run circles around any single precision done by a 68xxx |CPUs (I hope). If you're looking for fast math, you could perhaps make use of representation of real numbers by integer quotients; this is a common technique when precision and/or range allow it (which is the case for a lot of real-life applications). Each real (or float if you want) is represented by a pair of integers (choose either longs or shorts), whose quotient is the real (approximately). Especially in cases where shorts can be used for the representation (low precision), and on a processor that prefers integers to floats this can boost up calculations dramatically. Another way to possibly increase performance is to put often calculated function values in an array, e.g. for sin(x) calculate sin(i*pi/180) for i = 0..90. Intermediate values can be found - for example - by linear interpolation. For an example of quotient calculation, you can take a look at the sources of the 3D demo program I wrote a while ago. Cheers, Leo.