Re: optimization of movable parts

New Message Reply Date view Thread view Subject view Author view

Rob Mace (mace++at++lum.esd.sgi.com)
Sat, 5 Nov 1994 01:51:54 GMT


lance R. Marrou wrote:
> On Thu, 3 Nov 1994, Jim Helman wrote:
>
> > Use pfSinCos; it's fast. According to the current author
> > dog/flight, it beats some table lookup code.
>
> I don't see how this is possible, but it definitely would be more accurate.
> I would think it would take longer for the function call to pfSinCos (without
> actually doing the SinCos calcs) than the simple table addressing. Anyways,
> its irrelevant for my case since I need more accuracy than lookup tables.

Being the person Jim was referring to I can assure you that pfSinCos is
faster. The table lookup routine in question had a table of 901 floats,
90 degrees at 1/10th of a degree accuracy. It has to do a lookup for both
sin and cos and for each of these it has to calculate the address to use
and the sign of the result.

pfSinCos takes takes about 61% of the time that my table driven version
takes. The reason is that where as my table driven version does less
calculations it does a lot more branching. In a real app, and not a
benchmark, my table driven version would probably be even slower because
of cache behavior.

Rob Mace


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:39 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.