Iterative sin/cos calculation from
"http://web.archive.org/web/20020219143846/http://www.intersrv.com/~dcross/fasttrig.html"
(trig1.c)
adapted to work on quadratic series.
Remarks:
This is just a test implementation, not tested with the
seti client.
The generated results aren't precise all the time
(maybe 1 LSB off), but there's no drift.
Using true "long double" (80 Bits) is vital to keep the
results accurate enough over 1M iterations.
Explanation:
The original "Trig1" code calculates sin/cos
iteratively by using
the known sin/cos of the (constant) angle increment.
The modified version uses the same trick to calculate
the sin/cos of the angle increment for quadratic "x".
This works because the incremenent of the angle
increment is
constant for a quadratic series:
1^2 = 1 = 0 + 1
2^2 = 4 = 1 + 3
3^2 = 9 = 4 + 5
4^2 = 16 = 9 + 7
etc...
Regards Hans
trig1.c