From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 107079,183ebe04e93f0506 X-Google-Attributes: gid107079,public X-Google-Thread: 103376,183ebe04e93f0506 X-Google-Attributes: gid103376,public From: William A Whitaker Subject: Re: fixed point vs floating point Date: 1997/11/26 Message-ID: <347BC553.136A@erols.com>#1/1 X-Deja-AN: 292771584 References: <65846t$4vq$1@gonzo.sun3.iaf.nl> <65c58j$1302@mean.stat.purdue.edu> X-Complaints-To: abuse@erols.com X-Trace: winter.news.erols.com 880526776 27147 207.172.146.98 (26 Nov 1997 06:46:16 GMT) Organization: Erol's Internet Services Reply-To: whitaker@erols.com Newsgroups: comp.lang.ada,sci.math.num-analysis Date: 1997-11-26T00:00:00+00:00 List-Id: Joe Gwinn wrote: > snip > > In one recent example, Square Root was taking 60 microseconds on a 50-MHz > 68060; this should take no more than 2 uS. Where did the time go? Etc. Same kind of > story with the transcendental functions, only worse. One needs to read > the generated assembly code to know what a given compiler is up to. > > We only need a few functions, specifically Sine, Cosine, Arc Tangent, and > Square Root, speed is very much of the essence, and we need only 10e-4 to > 10e-5 (16-bit) accuracy anyway. So, we will write our own versions of > these functions, in Ada, C, or even assembly, as determined by performance > tests. > > > > As for the polynomial approximations, the bible is to this day is > "Approximations for Digital Computers"; Cecil Hastings, Jr.; Princeton > University Press; 1955. This has been a classic since its publication. > In those days, the computers were small, so the programmers had to be very > focused on performance. For computation of polynomials in real systems, > convert the published polynomials into Horner's form. This is discussed > in many texts on numerical methods. In short, a + bX + cX^2 becomes a + > X(b+cX), which is faster to compute, and has better numerical properties > than the standard power-series form. > > Joe Gwinn I remember working hard to get an exponential in 3.7 microseconds, using a self-generated "Hasty Approximation" (in honor of Hastings who was the father of them all). This was 30 years ago. Bill Whitaker