From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,2cb1c7dcdf4349e1 X-Google-Attributes: gid111c93,public From: cbbrowne@news.hex.net (Christopher Browne) Subject: Re: sin() on alpha. Date: 1998/05/23 Message-ID: <6k59a0$1cq$1@blue.hex.net>#1/1 X-Deja-AN: 355724843 References: <3565295F.7367C07E@dirac.phys.uwm.edu> Organization: Hex.Net Superhighway, DFW Metroplex 817-329-3182 Reply-To: cbbrowne@hex.net Newsgroups: comp.os.linux.alpha On Fri, 22 May 1998 02:29:35 -0500, Bruce Allen wrote: >> With a good co-processor of alpha, how much does it take to calcuate >> sin() in comparison with simple + or * operations ? Should I suppress >> the use of sin() to reduce computation as much as possible ? Should I >> use Taylor expanded polynomials ? > >NO! Use min/max (Chebyshev) polynomials to evaulate sin(x). See Numerical >Recipes in C, section 5.8 or to save time use Abramowitz and Stegun >4.3.96-103 for all standard trig functions. If you don't need to do range >reduction of x to [0,pi/2] this will be significantly faster than most >libraries. 'Tis been a while since I've calculated trig values; are there any processes where you start with an estimate, and then iterate to refine it? In that case, you would start with an interpolation table (probably linear) involving some "small-but-useful" set of values to get the initial estimate, and then iterate to improve precision. A 1024 entry linear interpolation table is going to get one *fairly* close; I don't recall offhand what identities would be used to do "function point iteration," but no doubt there's something useful. A higher-order polynomial interpolation table would surely give somewhat better results, at somewhat higher cost, to be sure. If the best such methods provide slow convergence, feel free to tell me I'm making a stupid suggestion... -- "Linux: the operating system with a CLUE... Command Line User Environment". (seen in a posting in comp.software.testing) cbbrowne@hex.net -