> Incidentally, the reason one needs only x \in (0,PI/2) is that the
> trigonometric
> functions' shapes are just tesselations of the shapes of their curves
> in said restricted interval (0,PI/2).
From the perspective of numerical stability, it turns out that the most
satisfactory treatment of cos() reduces x into [0, PI/4), and chooses
between algebraic formulae for cos() or sin() as needed. This avoids
some nasty cancellation near PI/2 for the cosine. Sine is best handled
in the same way. [I like YAMS -- Yet another mirror symmetry.]
Vectorization of this approach, combined with software pipelining to
ride over vector FPU latency, achieve a nice gain over brute function
calls to cos() or sin().
We'll have more to say on this subject at WWDC 2004 in the session
focusing on the Accelerate framework.
SCP
--
Steve Peters
Numerics and Vectorization
Apple Computer, Inc.
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.