-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatan_accurate.h
198 lines (193 loc) · 9.85 KB
/
atan_accurate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#include "crlibm.h"
#include "crlibm_private.h"
#include "atan_fast.h"
/*File generated by maple/atan.mpl */
static const scs constant_poly [10]=
/* ~-5.26315789473684210526315789473684210526315789473684e-02 */
{{{0x035e50d7, 0x250d7943, 0x179435e5, 0x035e50d7,
0x250d7943, 0x179435e5, 0x035e50d7, 0x250d7943},
DB_ONE, -1, -1 }
,
/* ~5.88235294117647058823529411764705882352941176470588e-02 */
{{0x03c3c3c3, 0x30f0f0f0, 0x3c3c3c3c, 0x0f0f0f0f,
0x03c3c3c3, 0x30f0f0f0, 0x3c3c3c3c, 0x0f0f0f0f},
DB_ONE, -1, 1 }
,
/* ~-6.66666666666666666666666666666666666666666666666667e-02 */
{{0x04444444, 0x11111111, 0x04444444, 0x11111111,
0x04444444, 0x11111111, 0x04444444, 0x11111111},
DB_ONE, -1, -1 }
,
/* ~7.69230769230769230769230769230769230769230769230769e-02 */
{{0x04ec4ec4, 0x3b13b13b, 0x04ec4ec4, 0x3b13b13b,
0x04ec4ec4, 0x3b13b13b, 0x04ec4ec4, 0x3b13b13b},
DB_ONE, -1, 1 }
,
/* ~-9.09090909090909090909090909090909090909090909090909e-02 */
{{0x05d1745d, 0x05d1745d, 0x05d1745d, 0x05d1745d,
0x05d1745d, 0x05d1745d, 0x05d1745d, 0x05d1745d},
DB_ONE, -1, -1 }
,
/* ~1.11111111111111111111111111111111111111111111111111e-01 */
{{0x071c71c7, 0x071c71c7, 0x071c71c7, 0x071c71c7,
0x071c71c7, 0x071c71c7, 0x071c71c7, 0x071c71c7},
DB_ONE, -1, 1 }
,
/* ~-1.42857142857142857142857142857142857142857142857143e-01 */
{{0x09249249, 0x09249249, 0x09249249, 0x09249249,
0x09249249, 0x09249249, 0x09249249, 0x09249249},
DB_ONE, -1, -1 }
,
/* ~2.00000000000000000000000000000000000000000000000000e-01 */
{{0x0ccccccc, 0x33333333, 0x0ccccccc, 0x33333333,
0x0ccccccc, 0x33333333, 0x0ccccccc, 0x33333333},
DB_ONE, -1, 1 }
,
/* ~-3.33333333333333333333333333333333333333333333333333e-01 */
{{0x15555555, 0x15555555, 0x15555555, 0x15555555,
0x15555555, 0x15555555, 0x15555555, 0x15555555},
DB_ONE, -1, -1 }
,
/* ~1.00000000000000000000000000000000000000000000000000e+00 */
{{0x00000001, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000},
DB_ONE, 0, 1 }
};
#define constant_poly_ptr (scs_ptr)&constant_poly
static const scs InvPiSCS=
{{0x145f306d, 0x327220a9, 0x13f84eaf, 0x28fa9a6e,
0x381b6c52, 0x2cc9e21c, 0x2083fca2, 0x31d5ef5d},
DB_ONE, -1, 1 }
;
#define InvPiSCS_ptr (scs_ptr)(& InvPiSCS)
#ifdef WORDS_BIGENDIAN
static const db_number atan_blolo[62] = {
/* 0 */ {{0xB8D1C5F3,0xA947CCE9}} /* -5.3484426395e-35 */,
/* 1 */ {{0xB8B05943,0x3C749846}} /* -1.2299381479e-35 */,
/* 2 */ {{0x38FC2F2A,0x267751FB}} /* +3.3925541143e-34 */,
/* 3 */ {{0x38D44E61,0xDDA4249D}} /* +6.1106690132e-35 */,
/* 4 */ {{0xB906FBFA,0xA5B245C8}} /* -5.5332673453e-34 */,
/* 5 */ {{0xB8DE1E98,0x67CABE65}} /* -9.0637612563e-35 */,
/* 6 */ {{0x38BD7B8F,0x45D13048}} /* +2.2180284354e-35 */,
/* 7 */ {{0xB9049436,0x23AD369B}} /* -4.9542022687e-34 */,
/* 8 */ {{0xB8F98586,0xF6BB1DB7}} /* -3.0720497269e-34 */,
/* 9 */ {{0xB89BC985,0xCB4D6219}} /* -5.2261910438e-36 */,
/* 10 */ {{0xB8C4002C,0x9C3884F4}} /* -3.0093679582e-35 */,
/* 11 */ {{0x3910CBC4,0x893058D9}} /* +8.0869642604e-34 */,
/* 12 */ {{0xB8F5408B,0xFF010BB5}} /* -2.5581328396e-34 */,
/* 13 */ {{0xB908570F,0xB5813578}} /* -5.8596619457e-34 */,
/* 14 */ {{0x39155B89,0x7E967248}} /* +1.0283294335e-33 */,
/* 15 */ {{0xB8CD159A,0x2031F115}} /* -4.3761315763e-35 */,
/* 16 */ {{0xB8E8D9C6,0x0FC3C81C}} /* -1.4956458040e-34 */,
/* 17 */ {{0x38C0AC30,0x8219F20D}} /* +2.5086163140e-35 */,
/* 18 */ {{0x38B36506,0x32EDCB95}} /* +1.4590894790e-35 */,
/* 19 */ {{0xB8FD57B0,0x5932E7C2}} /* -3.5319791285e-34 */,
/* 20 */ {{0x38C73827,0x91A2D916}} /* +3.4936600564e-35 */,
/* 21 */ {{0xB92FE60D,0x9EC5116C}} /* -3.0717278111e-33 */,
/* 22 */ {{0x3903AADF,0x6A3B8AE2}} /* +4.7347715466e-34 */,
/* 23 */ {{0xB88D6A01,0x71B87C3C}} /* -2.7660872166e-36 */,
/* 24 */ {{0xB8E17427,0xEA5AC8E8}} /* -1.0504584084e-34 */,
/* 25 */ {{0x38F4ED52,0xF776B005}} /* +2.5190016806e-34 */,
/* 26 */ {{0xB9265B23,0x75D2B05C}} /* -2.1528054385e-33 */,
/* 27 */ {{0xB8DA45DA,0xAFEAB282}} /* -7.9062036715e-35 */,
/* 28 */ {{0x3912EF75,0xBD16D3D4}} /* +9.1170587963e-34 */,
/* 29 */ {{0x390AB3D7,0xE904B022}} /* +6.4283962392e-34 */,
/* 30 */ {{0xB8EE688B,0x3F9F468B}} /* -1.8301374849e-34 */,
/* 31 */ {{0xB9225DF6,0x71A98823}} /* -1.7686817787e-33 */,
/* 32 */ {{0xB8CC82B0,0x522BE0F8}} /* -4.2897836993e-35 */,
/* 33 */ {{0xB912AFE0,0x88BB6A0B}} /* -8.9974727841e-34 */,
/* 34 */ {{0x38D4DC99,0x8640FAE5}} /* +6.2778447830e-35 */,
/* 35 */ {{0xB9016FC6,0x406A343B}} /* -4.1977132916e-34 */,
/* 36 */ {{0x3909804C,0x126FC74C}} /* +6.1391811422e-34 */,
/* 37 */ {{0x39051033,0xE5B0956F}} /* +5.0708030720e-34 */,
/* 38 */ {{0xB910CADC,0x203B114C}} /* -8.0852567814e-34 */,
/* 39 */ {{0x38EFCAC7,0xF97ED36B}} /* +1.9134182531e-34 */,
/* 40 */ {{0xB92464C0,0xB51D77B4}} /* -1.9638289218e-33 */,
/* 41 */ {{0x391157F3,0x2D4A03DE}} /* +8.3506176591e-34 */,
/* 42 */ {{0xB92BD929,0x136A8DDE}} /* -2.6816921082e-33 */,
/* 43 */ {{0x390F1514,0x035DF6B3}} /* +7.4828003563e-34 */,
/* 44 */ {{0xB92606EC,0x19DB7E3B}} /* -2.1211268072e-33 */,
/* 45 */ {{0x393B104B,0xCDA1B51D}} /* +5.2122706777e-33 */,
/* 46 */ {{0x3935FB01,0xF88A520C}} /* +4.2332900876e-33 */,
/* 47 */ {{0xB9189ED1,0x1940944D}} /* -1.1854280852e-33 */,
/* 48 */ {{0xB914E8F2,0x38D4794B}} /* -1.0067772791e-33 */,
/* 49 */ {{0xB93DF07A,0x73581CF5}} /* -5.7661126209e-33 */,
/* 50 */ {{0xB939C22F,0x727CE10C}} /* -4.9609136744e-33 */,
/* 51 */ {{0xB8EF37D2,0x26E1A810}} /* -1.8788680655e-34 */,
/* 52 */ {{0x391A4251,0x45155DAA}} /* +1.2643273919e-33 */,
/* 53 */ {{0xB9126D2F,0xA42D0A9A}} /* -8.8720409776e-34 */,
/* 54 */ {{0xB93CAF8B,0x3DFAFFA5}} /* -5.5246684074e-33 */,
/* 55 */ {{0x3919C170,0xA9A35831}} /* +1.2400882522e-33 */,
/* 56 */ {{0xB924C2B3,0xAE51E4B3}} /* -1.9991686511e-33 */,
/* 57 */ {{0xB8DEFB7D,0x0DE98917}} /* -9.3234199178e-35 */,
/* 58 */ {{0xB916EC39,0x1ABE373B}} /* -1.1036900898e-33 */,
/* 59 */ {{0x391C5BA4,0x4135ADBE}} /* +1.3653868341e-33 */,
/* 60 */ {{0xB9112692,0xD7179E60}} /* -8.2577511316e-34 */,
/* 61 */ {{0x392F96B5,0xBCC93753}} /* +3.0418821818e-33 */,
};
#else
static const db_number atan_blolo[62] = {
/* 0 */ {{0xA947CCE9,0xB8D1C5F3}} /* -5.3484426395e-35 */,
/* 1 */ {{0x3C749846,0xB8B05943}} /* -1.2299381479e-35 */,
/* 2 */ {{0x267751FB,0x38FC2F2A}} /* +3.3925541143e-34 */,
/* 3 */ {{0xDDA4249D,0x38D44E61}} /* +6.1106690132e-35 */,
/* 4 */ {{0xA5B245C8,0xB906FBFA}} /* -5.5332673453e-34 */,
/* 5 */ {{0x67CABE65,0xB8DE1E98}} /* -9.0637612563e-35 */,
/* 6 */ {{0x45D13048,0x38BD7B8F}} /* +2.2180284354e-35 */,
/* 7 */ {{0x23AD369B,0xB9049436}} /* -4.9542022687e-34 */,
/* 8 */ {{0xF6BB1DB7,0xB8F98586}} /* -3.0720497269e-34 */,
/* 9 */ {{0xCB4D6219,0xB89BC985}} /* -5.2261910438e-36 */,
/* 10 */ {{0x9C3884F4,0xB8C4002C}} /* -3.0093679582e-35 */,
/* 11 */ {{0x893058D9,0x3910CBC4}} /* +8.0869642604e-34 */,
/* 12 */ {{0xFF010BB5,0xB8F5408B}} /* -2.5581328396e-34 */,
/* 13 */ {{0xB5813578,0xB908570F}} /* -5.8596619457e-34 */,
/* 14 */ {{0x7E967248,0x39155B89}} /* +1.0283294335e-33 */,
/* 15 */ {{0x2031F115,0xB8CD159A}} /* -4.3761315763e-35 */,
/* 16 */ {{0x0FC3C81C,0xB8E8D9C6}} /* -1.4956458040e-34 */,
/* 17 */ {{0x8219F20D,0x38C0AC30}} /* +2.5086163140e-35 */,
/* 18 */ {{0x32EDCB95,0x38B36506}} /* +1.4590894790e-35 */,
/* 19 */ {{0x5932E7C2,0xB8FD57B0}} /* -3.5319791285e-34 */,
/* 20 */ {{0x91A2D916,0x38C73827}} /* +3.4936600564e-35 */,
/* 21 */ {{0x9EC5116C,0xB92FE60D}} /* -3.0717278111e-33 */,
/* 22 */ {{0x6A3B8AE2,0x3903AADF}} /* +4.7347715466e-34 */,
/* 23 */ {{0x71B87C3C,0xB88D6A01}} /* -2.7660872166e-36 */,
/* 24 */ {{0xEA5AC8E8,0xB8E17427}} /* -1.0504584084e-34 */,
/* 25 */ {{0xF776B005,0x38F4ED52}} /* +2.5190016806e-34 */,
/* 26 */ {{0x75D2B05C,0xB9265B23}} /* -2.1528054385e-33 */,
/* 27 */ {{0xAFEAB282,0xB8DA45DA}} /* -7.9062036715e-35 */,
/* 28 */ {{0xBD16D3D4,0x3912EF75}} /* +9.1170587963e-34 */,
/* 29 */ {{0xE904B022,0x390AB3D7}} /* +6.4283962392e-34 */,
/* 30 */ {{0x3F9F468B,0xB8EE688B}} /* -1.8301374849e-34 */,
/* 31 */ {{0x71A98823,0xB9225DF6}} /* -1.7686817787e-33 */,
/* 32 */ {{0x522BE0F8,0xB8CC82B0}} /* -4.2897836993e-35 */,
/* 33 */ {{0x88BB6A0B,0xB912AFE0}} /* -8.9974727841e-34 */,
/* 34 */ {{0x8640FAE5,0x38D4DC99}} /* +6.2778447830e-35 */,
/* 35 */ {{0x406A343B,0xB9016FC6}} /* -4.1977132916e-34 */,
/* 36 */ {{0x126FC74C,0x3909804C}} /* +6.1391811422e-34 */,
/* 37 */ {{0xE5B0956F,0x39051033}} /* +5.0708030720e-34 */,
/* 38 */ {{0x203B114C,0xB910CADC}} /* -8.0852567814e-34 */,
/* 39 */ {{0xF97ED36B,0x38EFCAC7}} /* +1.9134182531e-34 */,
/* 40 */ {{0xB51D77B4,0xB92464C0}} /* -1.9638289218e-33 */,
/* 41 */ {{0x2D4A03DE,0x391157F3}} /* +8.3506176591e-34 */,
/* 42 */ {{0x136A8DDE,0xB92BD929}} /* -2.6816921082e-33 */,
/* 43 */ {{0x035DF6B3,0x390F1514}} /* +7.4828003563e-34 */,
/* 44 */ {{0x19DB7E3B,0xB92606EC}} /* -2.1211268072e-33 */,
/* 45 */ {{0xCDA1B51D,0x393B104B}} /* +5.2122706777e-33 */,
/* 46 */ {{0xF88A520C,0x3935FB01}} /* +4.2332900876e-33 */,
/* 47 */ {{0x1940944D,0xB9189ED1}} /* -1.1854280852e-33 */,
/* 48 */ {{0x38D4794B,0xB914E8F2}} /* -1.0067772791e-33 */,
/* 49 */ {{0x73581CF5,0xB93DF07A}} /* -5.7661126209e-33 */,
/* 50 */ {{0x727CE10C,0xB939C22F}} /* -4.9609136744e-33 */,
/* 51 */ {{0x26E1A810,0xB8EF37D2}} /* -1.8788680655e-34 */,
/* 52 */ {{0x45155DAA,0x391A4251}} /* +1.2643273919e-33 */,
/* 53 */ {{0xA42D0A9A,0xB9126D2F}} /* -8.8720409776e-34 */,
/* 54 */ {{0x3DFAFFA5,0xB93CAF8B}} /* -5.5246684074e-33 */,
/* 55 */ {{0xA9A35831,0x3919C170}} /* +1.2400882522e-33 */,
/* 56 */ {{0xAE51E4B3,0xB924C2B3}} /* -1.9991686511e-33 */,
/* 57 */ {{0x0DE98917,0xB8DEFB7D}} /* -9.3234199178e-35 */,
/* 58 */ {{0x1ABE373B,0xB916EC39}} /* -1.1036900898e-33 */,
/* 59 */ {{0x4135ADBE,0x391C5BA4}} /* +1.3653868341e-33 */,
/* 60 */ {{0xD7179E60,0xB9112692}} /* -8.2577511316e-34 */,
/* 61 */ {{0xBCC93753,0x392F96B5}} /* +3.0418821818e-33 */,
};
#endif /* WORDS_BIGENDIAN */