Home All Groups Group Topic Archive Search About
Author
16 Oct 2005 5:59 PM
Jacquelin Hardy
Hell group

Can someone tell me if LookUpTables for Trigonometry value (sine, cosine)
are still useful today with CPU working in Gigahertz, when speed is of prime
concern.

Thank you

Author
16 Oct 2005 6:34 PM
Charles Krug
On Sun, 16 Oct 2005 13:59:14 -0400, Jacquelin Hardy
<jacha***@videotron.ca> wrote:
> Hell group
>
> Can someone tell me if LookUpTables for Trigonometry value (sine, cosine)
> are still useful today with CPU working in Gigahertz, when speed is of prime
> concern.
>

Yes. 

Take a look here:

http://www.ti.com/graychip/GC1012A/GC1012A.html

Also any other item in the Graychip line.  These puppies have a built-in
cosine table because they MUST do calculations continuously at high
speed.

Try this little excercise:

Implement an algorithm to calculate sine and cosine functions.

Now implement an algorithm to look up sine and cosine functions.

Which is simpler?  Which do you suppose executes faster?

It is almost always possible to trade execution speed for memory.  This
is a great example of that.
Author
16 Oct 2005 9:23 PM
Duane Bozarth
Jacquelin Hardy wrote:
>
> Hell group
>
> Can someone tell me if LookUpTables for Trigonometry value (sine, cosine)
> are still useful today with CPU working in Gigahertz, when speed is of prime
> concern.
>

In addition to the most excellent response :) of Charles, I'll add it
also depends on the numerical precision required and the rest of the
application needs.  Note that w/ VB, on is by definition speaking of
Winders on Intel-compatible hardware w/ FPP hardware which has sin/cos
instructions which are pretty good performance-wise. 

I've not looked at VB-generated code specfically to see the
implementation but I'll note that if one needs better floating point
computation speed w/ VB, one possible alternative is to write the
computation code in Fortran and call it in a DLL.  I do this routinely
and depending on the application can see significant speed enhancements.