Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: cbbrowne@news.hex.net (Christopher Browne)
Subject: Re: sin() on alpha.
Date: 1998/05/23	[thread overview]
Message-ID: <6k59a0$1cq$1@blue.hex.net> (raw)
In-Reply-To: 3565295F.7367C07E@dirac.phys.uwm.edu


On Fri, 22 May 1998 02:29:35 -0500, Bruce Allen
<ballen@dirac.phys.uwm.edu> 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 -  <http://www.hex.net/~cbbrowne/lsf.html>



  parent reply	other threads:[~1998-05-23  4:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-22  4:00 sin() on alpha Dong-Woon Park
1998-05-22  4:00 ` Bruce Allen
1998-05-22  4:00   ` Greg Lindahl
1998-05-23  4:00   ` Dong-Woon Park
1998-05-23  4:00     ` Bruce Allen
1998-05-24  4:00       ` Joachim Wesner
1998-05-24  4:00     ` Joachim Wesner
1998-05-23  4:00   ` Christopher Browne [this message]
1998-05-23  4:00     ` Linus Torvalds
1998-05-23  4:00       ` Andi Kleen
1998-05-23  4:00       ` Greg Lindahl
1998-05-24  4:00         ` sin() on alpha / Cray libm Joachim Wesner
1998-05-23  4:00     ` sin() on alpha Michal Jaegermann
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox