cosine (from +100 to -100) , based on the 1256 darwinbots x degrees
notice i kept the value of e inside here since there might be different ways to optimize this math into to darwinbots.
e is about 2.71828182845904523536 (source wikipedia)
the function cos(x)*100 as f(x) =
100.336
+ 1.55527e-015*x*x*x*x*x*x
+ 6.72543e-009*x*x*x*x
- 1.48672e-006*x*x*x
- 5.86017e-012*x*x*x*x*x
- 0.000986079*x*x
- 0.0193941*x
__________________________(sum)
PS
I don't deserve big credits for it, I'm just playing with my new math toy and giving it some tests.
Still it might be useful for those who want to play with sin and cos sin (x) = cos (x-324)
So we can create Spiro-graphic effects
Notice i let result from -100 to 100 for integer rounding reasons true cos should have a final 100 div after it.
I'm not sure how precise it will be these function inside the integer universe of darwin bots.
My mechanical turk , is going to keep number crunching on the data set so maybe i have a better function tomorrow.
But i doubt it as this is pretty near to the real thing..
Note this function might require mod function for its input 1256 mod
hmm and it might be that *x*x*x*x*x*x results in overflow...