Name: Anonymous 2009-08-24 21:10
Ruby hurrrrrrrrrrr
Anyway, I've got a task that requires a lot of use sine and cosine, and I've decided that speed in computation is far more important than accuracy, as there is a very small number of digits that are significant. So the solution that I came up with is to make a method that uses a polynomial approximation instead. Something like 'check for domain and subtract pi until in domain' then apply the polynomial. Would this compute faster or slower than the built in trig functions? Is there an easy way to test this?
Anyway, I've got a task that requires a lot of use sine and cosine, and I've decided that speed in computation is far more important than accuracy, as there is a very small number of digits that are significant. So the solution that I came up with is to make a method that uses a polynomial approximation instead. Something like 'check for domain and subtract pi until in domain' then apply the polynomial. Would this compute faster or slower than the built in trig functions? Is there an easy way to test this?