annotate drivers/radeon/generic_math.h @ 9039:b615c698e994

Propolice catches an overflow in dct64_k7.c: mplayer: stack overflow in function dct64_MMX_3dnowex patch by Bj«Órn Sandell <biorn@dce.chalmers.se>
author arpi
date Sun, 19 Jan 2003 21:50:50 +0000
parents af4dcf6751dc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3944
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
1 /*
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
2 generic implementation of sin(x) and cos(x) functions.
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
3 Specially for Linux.
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
4 Licence: GPL
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
5 Copyright (C) 2002 Nick Kurshev
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
6 */
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
7
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
8 #ifndef GENERIC_MATH_H
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
9 #define GENERIC_MATH_H
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
10
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
11 typedef struct _gen_sincos
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
12 {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
13 double x;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
14 double sinx;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
15 double cosx;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
16 }gen_sincos_t;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
17
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
18 static gen_sincos_t g_sincos[201] = {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
19 { -3.141600e+00, 7.346410e-06, -1.000000e-00 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
20 { -3.110184e+00, -3.140349e-02, -9.995068e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
21 { -3.078768e+00, -6.278333e-02, -9.980272e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
22 { -3.047352e+00, -9.410122e-02, -9.955626e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
23 { -3.015936e+00, -1.253262e-01, -9.921156e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
24 { -2.984520e+00, -1.564276e-01, -9.876894e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
25 { -2.953104e+00, -1.873745e-01, -9.822885e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
26 { -2.921688e+00, -2.181366e-01, -9.759183e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
27 { -2.890272e+00, -2.486833e-01, -9.685848e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
28 { -2.858856e+00, -2.789847e-01, -9.602956e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
29 { -2.827440e+00, -3.090107e-01, -9.510586e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
30 { -2.796024e+00, -3.387318e-01, -9.408830e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
31 { -2.764608e+00, -3.681185e-01, -9.297789e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
32 { -2.733192e+00, -3.971420e-01, -9.177572e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
33 { -2.701776e+00, -4.257736e-01, -9.048297e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
34 { -2.670360e+00, -4.539849e-01, -8.910094e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
35 { -2.638944e+00, -4.817483e-01, -8.763097e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
36 { -2.607528e+00, -5.090362e-01, -8.607451e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
37 { -2.576112e+00, -5.358217e-01, -8.443312e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
38 { -2.544696e+00, -5.620785e-01, -8.270839e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
39 { -2.513280e+00, -5.877805e-01, -8.090204e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
40 { -2.481864e+00, -6.129025e-01, -7.901586e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
41 { -2.450448e+00, -6.374196e-01, -7.705169e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
42 { -2.419032e+00, -6.613076e-01, -7.501148e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
43 { -2.387616e+00, -6.845430e-01, -7.289724e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
44 { -2.356200e+00, -7.071029e-01, -7.071107e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
45 { -2.324784e+00, -7.289649e-01, -6.845511e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
46 { -2.293368e+00, -7.501075e-01, -6.613159e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
47 { -2.261952e+00, -7.705099e-01, -6.374281e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
48 { -2.230536e+00, -7.901518e-01, -6.129112e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
49 { -2.199120e+00, -8.090140e-01, -5.877894e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
50 { -2.167704e+00, -8.270777e-01, -5.620876e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
51 { -2.136288e+00, -8.443252e-01, -5.358310e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
52 { -2.104872e+00, -8.607395e-01, -5.090457e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
53 { -2.073456e+00, -8.763043e-01, -4.817579e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
54 { -2.042040e+00, -8.910044e-01, -4.539948e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
55 { -2.010624e+00, -9.048251e-01, -4.257835e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
56 { -1.979208e+00, -9.177528e-01, -3.971521e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
57 { -1.947792e+00, -9.297748e-01, -3.681288e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
58 { -1.916376e+00, -9.408793e-01, -3.387421e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
59 { -1.884960e+00, -9.510552e-01, -3.090212e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
60 { -1.853544e+00, -9.602925e-01, -2.789953e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
61 { -1.822128e+00, -9.685821e-01, -2.486940e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
62 { -1.790712e+00, -9.759158e-01, -2.181473e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
63 { -1.759296e+00, -9.822865e-01, -1.873854e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
64 { -1.727880e+00, -9.876877e-01, -1.564385e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
65 { -1.696464e+00, -9.921142e-01, -1.253372e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
66 { -1.665048e+00, -9.955616e-01, -9.411219e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
67 { -1.633632e+00, -9.980265e-01, -6.279433e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
68 { -1.602216e+00, -9.995064e-01, -3.141450e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
69 { -1.570800e+00, -1.000000e-00, -3.673205e-06 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
70 { -1.539384e+00, -9.995067e-01, 3.140716e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
71 { -1.507968e+00, -9.980269e-01, 6.278700e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
72 { -1.476552e+00, -9.955623e-01, 9.410488e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
73 { -1.445136e+00, -9.921151e-01, 1.253299e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
74 { -1.413720e+00, -9.876889e-01, 1.564312e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
75 { -1.382304e+00, -9.822879e-01, 1.873781e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
76 { -1.350888e+00, -9.759175e-01, 2.181402e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
77 { -1.319472e+00, -9.685839e-01, 2.486869e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
78 { -1.288056e+00, -9.602945e-01, 2.789882e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
79 { -1.256640e+00, -9.510574e-01, 3.090142e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
80 { -1.225224e+00, -9.408817e-01, 3.387352e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
81 { -1.193808e+00, -9.297775e-01, 3.681220e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
82 { -1.162392e+00, -9.177557e-01, 3.971454e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
83 { -1.130976e+00, -9.048282e-01, 4.257769e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
84 { -1.099560e+00, -8.910077e-01, 4.539882e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
85 { -1.068144e+00, -8.763079e-01, 4.817515e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
86 { -1.036728e+00, -8.607433e-01, 5.090393e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
87 { -1.005312e+00, -8.443292e-01, 5.358248e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
88 { -9.738960e-01, -8.270819e-01, 5.620815e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
89 { -9.424800e-01, -8.090183e-01, 5.877835e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
90 { -9.110640e-01, -7.901563e-01, 6.129054e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
91 { -8.796480e-01, -7.705146e-01, 6.374224e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
92 { -8.482320e-01, -7.501124e-01, 6.613104e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
93 { -8.168160e-01, -7.289699e-01, 6.845457e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
94 { -7.854000e-01, -7.071081e-01, 7.071055e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
95 { -7.539840e-01, -6.845484e-01, 7.289674e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
96 { -7.225680e-01, -6.613131e-01, 7.501100e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
97 { -6.911520e-01, -6.374252e-01, 7.705122e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
98 { -6.597360e-01, -6.129083e-01, 7.901541e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
99 { -6.283200e-01, -5.877864e-01, 8.090161e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
100 { -5.969040e-01, -5.620845e-01, 8.270798e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
101 { -5.654880e-01, -5.358279e-01, 8.443272e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
102 { -5.340720e-01, -5.090425e-01, 8.607414e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
103 { -5.026560e-01, -4.817547e-01, 8.763061e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
104 { -4.712400e-01, -4.539915e-01, 8.910060e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
105 { -4.398240e-01, -4.257802e-01, 9.048266e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
106 { -4.084080e-01, -3.971488e-01, 9.177542e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
107 { -3.769920e-01, -3.681254e-01, 9.297762e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
108 { -3.455760e-01, -3.387387e-01, 9.408805e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
109 { -3.141600e-01, -3.090177e-01, 9.510563e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
110 { -2.827440e-01, -2.789917e-01, 9.602935e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
111 { -2.513280e-01, -2.486905e-01, 9.685830e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
112 { -2.199120e-01, -2.181437e-01, 9.759166e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
113 { -1.884960e-01, -1.873817e-01, 9.822872e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
114 { -1.570800e-01, -1.564348e-01, 9.876883e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
115 { -1.256640e-01, -1.253335e-01, 9.921147e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
116 { -9.424800e-02, -9.410853e-02, 9.955619e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
117 { -6.283200e-02, -6.279067e-02, 9.980267e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
118 { -3.141600e-02, -3.141083e-02, 9.995066e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
119 { 0.000000e+00, 0.000000e+00, 1.000000e+00 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
120 { 3.141600e-02, 3.141083e-02, 9.995066e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
121 { 6.283200e-02, 6.279067e-02, 9.980267e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
122 { 9.424800e-02, 9.410853e-02, 9.955619e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
123 { 1.256640e-01, 1.253335e-01, 9.921147e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
124 { 1.570800e-01, 1.564348e-01, 9.876883e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
125 { 1.884960e-01, 1.873817e-01, 9.822872e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
126 { 2.199120e-01, 2.181437e-01, 9.759166e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
127 { 2.513280e-01, 2.486905e-01, 9.685830e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
128 { 2.827440e-01, 2.789917e-01, 9.602935e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
129 { 3.141600e-01, 3.090177e-01, 9.510563e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
130 { 3.455760e-01, 3.387387e-01, 9.408805e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
131 { 3.769920e-01, 3.681254e-01, 9.297762e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
132 { 4.084080e-01, 3.971488e-01, 9.177542e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
133 { 4.398240e-01, 4.257802e-01, 9.048266e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
134 { 4.712400e-01, 4.539915e-01, 8.910060e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
135 { 5.026560e-01, 4.817547e-01, 8.763061e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
136 { 5.340720e-01, 5.090425e-01, 8.607414e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
137 { 5.654880e-01, 5.358279e-01, 8.443272e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
138 { 5.969040e-01, 5.620845e-01, 8.270798e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
139 { 6.283200e-01, 5.877864e-01, 8.090161e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
140 { 6.597360e-01, 6.129083e-01, 7.901541e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
141 { 6.911520e-01, 6.374252e-01, 7.705122e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
142 { 7.225680e-01, 6.613131e-01, 7.501100e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
143 { 7.539840e-01, 6.845484e-01, 7.289674e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
144 { 7.854000e-01, 7.071081e-01, 7.071055e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
145 { 8.168160e-01, 7.289699e-01, 6.845457e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
146 { 8.482320e-01, 7.501124e-01, 6.613104e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
147 { 8.796480e-01, 7.705146e-01, 6.374224e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
148 { 9.110640e-01, 7.901563e-01, 6.129054e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
149 { 9.424800e-01, 8.090183e-01, 5.877835e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
150 { 9.738960e-01, 8.270819e-01, 5.620815e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
151 { 1.005312e+00, 8.443292e-01, 5.358248e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
152 { 1.036728e+00, 8.607433e-01, 5.090393e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
153 { 1.068144e+00, 8.763079e-01, 4.817515e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
154 { 1.099560e+00, 8.910077e-01, 4.539882e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
155 { 1.130976e+00, 9.048282e-01, 4.257769e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
156 { 1.162392e+00, 9.177557e-01, 3.971454e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
157 { 1.193808e+00, 9.297775e-01, 3.681220e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
158 { 1.225224e+00, 9.408817e-01, 3.387352e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
159 { 1.256640e+00, 9.510574e-01, 3.090142e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
160 { 1.288056e+00, 9.602945e-01, 2.789882e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
161 { 1.319472e+00, 9.685839e-01, 2.486869e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
162 { 1.350888e+00, 9.759175e-01, 2.181402e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
163 { 1.382304e+00, 9.822879e-01, 1.873781e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
164 { 1.413720e+00, 9.876889e-01, 1.564312e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
165 { 1.445136e+00, 9.921151e-01, 1.253299e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
166 { 1.476552e+00, 9.955623e-01, 9.410488e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
167 { 1.507968e+00, 9.980269e-01, 6.278700e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
168 { 1.539384e+00, 9.995067e-01, 3.140716e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
169 { 1.570800e+00, 1.000000e-00, -3.673205e-06 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
170 { 1.602216e+00, 9.995064e-01, -3.141450e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
171 { 1.633632e+00, 9.980265e-01, -6.279433e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
172 { 1.665048e+00, 9.955616e-01, -9.411219e-02 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
173 { 1.696464e+00, 9.921142e-01, -1.253372e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
174 { 1.727880e+00, 9.876877e-01, -1.564385e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
175 { 1.759296e+00, 9.822865e-01, -1.873854e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
176 { 1.790712e+00, 9.759158e-01, -2.181473e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
177 { 1.822128e+00, 9.685821e-01, -2.486940e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
178 { 1.853544e+00, 9.602925e-01, -2.789953e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
179 { 1.884960e+00, 9.510552e-01, -3.090212e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
180 { 1.916376e+00, 9.408793e-01, -3.387421e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
181 { 1.947792e+00, 9.297748e-01, -3.681288e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
182 { 1.979208e+00, 9.177528e-01, -3.971521e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
183 { 2.010624e+00, 9.048251e-01, -4.257835e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
184 { 2.042040e+00, 8.910044e-01, -4.539948e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
185 { 2.073456e+00, 8.763043e-01, -4.817579e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
186 { 2.104872e+00, 8.607395e-01, -5.090457e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
187 { 2.136288e+00, 8.443252e-01, -5.358310e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
188 { 2.167704e+00, 8.270777e-01, -5.620876e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
189 { 2.199120e+00, 8.090140e-01, -5.877894e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
190 { 2.230536e+00, 7.901518e-01, -6.129112e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
191 { 2.261952e+00, 7.705099e-01, -6.374281e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
192 { 2.293368e+00, 7.501075e-01, -6.613159e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
193 { 2.324784e+00, 7.289649e-01, -6.845511e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
194 { 2.356200e+00, 7.071029e-01, -7.071107e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
195 { 2.387616e+00, 6.845430e-01, -7.289724e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
196 { 2.419032e+00, 6.613076e-01, -7.501148e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
197 { 2.450448e+00, 6.374196e-01, -7.705169e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
198 { 2.481864e+00, 6.129025e-01, -7.901586e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
199 { 2.513280e+00, 5.877805e-01, -8.090204e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
200 { 2.544696e+00, 5.620785e-01, -8.270839e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
201 { 2.576112e+00, 5.358217e-01, -8.443312e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
202 { 2.607528e+00, 5.090362e-01, -8.607451e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
203 { 2.638944e+00, 4.817483e-01, -8.763097e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
204 { 2.670360e+00, 4.539849e-01, -8.910094e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
205 { 2.701776e+00, 4.257736e-01, -9.048297e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
206 { 2.733192e+00, 3.971420e-01, -9.177572e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
207 { 2.764608e+00, 3.681185e-01, -9.297789e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
208 { 2.796024e+00, 3.387318e-01, -9.408830e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
209 { 2.827440e+00, 3.090107e-01, -9.510586e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
210 { 2.858856e+00, 2.789847e-01, -9.602956e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
211 { 2.890272e+00, 2.486833e-01, -9.685848e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
212 { 2.921688e+00, 2.181366e-01, -9.759183e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
213 { 2.953104e+00, 1.873745e-01, -9.822885e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
214 { 2.984520e+00, 1.564276e-01, -9.876894e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
215 { 3.015936e+00, 1.253262e-01, -9.921156e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
216 { 3.047352e+00, 9.410122e-02, -9.955626e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
217 { 3.078768e+00, 6.278333e-02, -9.980272e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
218 { 3.110184e+00, 3.140349e-02, -9.995068e-01 },
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
219 { 3.141600e+00, -7.346410e-06, -1.000000e-00 }
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
220 };
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
221
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
222 # define M_PI 3.14159265358979323846 /* pi */
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
223
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
224 static double inline gen_sin(double x)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
225 {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
226 int i;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
227 if(x < 0) while(x < -M_PI) x+= M_PI;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
228 else while(x > M_PI) x-= M_PI;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
229 for(i=0;i<sizeof(g_sincos)/sizeof(gen_sincos_t)-1;i++)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
230 {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
231 if(x>=g_sincos[i].x && x <= g_sincos[i+1].x)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
232 {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
233 return (g_sincos[i+1].sinx-g_sincos[i].sinx)*(x-g_sincos[i].x)/(g_sincos[i+1].x-g_sincos[i].x)+g_sincos[i].sinx;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
234 }
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
235 }
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
236 return x<0?1:-1;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
237 }
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
238 #undef sin
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
239 #define sin(x) gen_sin(x)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
240
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
241 static double inline gen_cos(double x)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
242 {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
243 int i;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
244 if(x < 0) while(x < -M_PI) x+= M_PI;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
245 else while(x > M_PI) x-= M_PI;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
246 for(i=0;i<sizeof(g_sincos)/sizeof(gen_sincos_t)-1;i++)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
247 {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
248 if(x>=g_sincos[i].x && x <= g_sincos[i+1].x)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
249 {
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
250 return (g_sincos[i+1].cosx-g_sincos[i].cosx)*(x-g_sincos[i].x)/(g_sincos[i+1].x-g_sincos[i].x)+g_sincos[i].cosx;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
251 }
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
252 }
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
253 return x<0?1:-1;
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
254 }
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
255 #undef cos
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
256 #define cos(x) gen_cos(x)
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
257
af4dcf6751dc solution for non-x86 users
nick
parents:
diff changeset
258 #endif