2 C program for floating point sin/cos.
4 There are no error exits.
5 Coefficients are #3370 from Hart & Cheney (18.80D).
11 #define p0 .1357884097877375669092680e8
12 #define p1 -.4942908100902844161158627e7
13 #define p2 .4401030535375266501944918e6
14 #define p3 -.1384727249982452873054457e5
15 #define p4 .1459688406665768722226959e3
16 #define q0 .8644558652922534429915149e7
17 #define q1 .4081792252343299749395779e6
18 #define q2 .9463096101538208180571257e4
19 #define q3 .1326534908786136358911494e3
23 sinus(double arg, int quad)
25 double e, f, ysq, x, y, temp1, temp2;
33 x *= 1/PIO2; /* underflow? */
51 temp1 = ((((p4*ysq+p3)*ysq+p2)*ysq+p1)*ysq+p0)*y;
52 temp2 = ((((ysq+q3)*ysq+q2)*ysq+q1)*ysq+q0);