What interesting methods we have here recently for evaluating functions
on
huge arrays. (I realize not everyone is interested in this topic, so I
shall
be as brief as I can...)
One can develop an attractive hybrid of S. Peters' and S. Hannahs'
suggestions
for evaluating cos() or sin() over an array. The hybrid method uses:
cos(x) ~ (1- a x^2)^4 * (1 - 4 x^2/PI^2),
where a = 0.023706285680096327 is the optimal parameter, in terms of
RMS-error minimum, for the given
pdouct form. This formula now works over the full range (0,PI/2)
and gives the dead zero at x = PI/2 that Peters' suggestion (of
function-
swtiching) supplied.
The maximum error here in cos() is < 0.00004 over said range.
Note that this formula is not classically popular; however in modern,
"vector"
times, the 4th power is a piece of proverbial cake (2 squarings). So it
often
happens that new formulae beat the old ones, on vector engines...that
is
one reason some of us are so interested!
There are similar formulae for better accuracy, and
similar formulae for sin(), and so on.
It remains to be seen whether any of these formulae, hybrids, etc. can
really
beat an optimized interpolating lookup; though many of us believe "pure
algebra" should generally be boss.
R. E. Crandall
Advanced Computation Group
_______________________________________________
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.