aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/lib/eina_fp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/eina/src/lib/eina_fp.c')
-rw-r--r--libraries/eina/src/lib/eina_fp.c532
1 files changed, 532 insertions, 0 deletions
diff --git a/libraries/eina/src/lib/eina_fp.c b/libraries/eina/src/lib/eina_fp.c
new file mode 100644
index 0000000..8984b49
--- /dev/null
+++ b/libraries/eina/src/lib/eina_fp.c
@@ -0,0 +1,532 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdio.h>
6#include <math.h>
7
8#include "eina_types.h"
9#include "eina_fp.h"
10
11#define MAX_PREC 1025
12static const Eina_F32p32 eina_trigo[MAX_PREC] =
13{
14 0x0000000100000000, 0x00000000ffffec43, 0x00000000ffffb10b,
15 0x00000000ffff4e5a, 0x00000000fffec42e, 0x00000000fffe1287,
16 0x00000000fffd3967, 0x00000000fffc38cd, 0x00000000fffb10b9,
17 0x00000000fff9c12c,
18 0x00000000fff84a25, 0x00000000fff6aba5, 0x00000000fff4e5ac,
19 0x00000000fff2f83b, 0x00000000fff0e351, 0x00000000ffeea6ef,
20 0x00000000ffec4316, 0x00000000ffe9b7c5, 0x00000000ffe704fe,
21 0x00000000ffe42ac0,
22 0x00000000ffe1290b, 0x00000000ffddffe2, 0x00000000ffdaaf43,
23 0x00000000ffd7372f, 0x00000000ffd397a8, 0x00000000ffcfd0ad,
24 0x00000000ffcbe23f, 0x00000000ffc7cc5f, 0x00000000ffc38f0d,
25 0x00000000ffbf2a4b,
26 0x00000000ffba9e17, 0x00000000ffb5ea75, 0x00000000ffb10f63,
27 0x00000000ffac0ce3, 0x00000000ffa6e2f6, 0x00000000ffa1919c,
28 0x00000000ff9c18d6, 0x00000000ff9678a6, 0x00000000ff90b10b,
29 0x00000000ff8ac208,
30 0x00000000ff84ab9c, 0x00000000ff7e6dc8, 0x00000000ff78088f,
31 0x00000000ff717bf0, 0x00000000ff6ac7ec, 0x00000000ff63ec85,
32 0x00000000ff5ce9bc, 0x00000000ff55bf92, 0x00000000ff4e6e08,
33 0x00000000ff46f51f,
34 0x00000000ff3f54d8, 0x00000000ff378d34, 0x00000000ff2f9e35,
35 0x00000000ff2787dc, 0x00000000ff1f4a2a, 0x00000000ff16e520,
36 0x00000000ff0e58c0, 0x00000000ff05a50a, 0x00000000fefcca01,
37 0x00000000fef3c7a6,
38 0x00000000feea9df9, 0x00000000fee14cfe, 0x00000000fed7d4b3,
39 0x00000000fece351d, 0x00000000fec46e3b, 0x00000000feba800f,
40 0x00000000feb06a9c, 0x00000000fea62de1, 0x00000000fe9bc9e2,
41 0x00000000fe913e9f,
42 0x00000000fe868c1b, 0x00000000fe7bb256, 0x00000000fe70b153,
43 0x00000000fe658913, 0x00000000fe5a3998, 0x00000000fe4ec2e4,
44 0x00000000fe4324f9, 0x00000000fe375fd7, 0x00000000fe2b7382,
45 0x00000000fe1f5ffa,
46 0x00000000fe132543, 0x00000000fe06c35d, 0x00000000fdfa3a4b,
47 0x00000000fded8a0e, 0x00000000fde0b2a8, 0x00000000fdd3b41c,
48 0x00000000fdc68e6c, 0x00000000fdb94199, 0x00000000fdabcda5,
49 0x00000000fd9e3294,
50 0x00000000fd907065, 0x00000000fd82871d, 0x00000000fd7476bd,
51 0x00000000fd663f46, 0x00000000fd57e0bd, 0x00000000fd495b21,
52 0x00000000fd3aae77, 0x00000000fd2bdabf, 0x00000000fd1cdffd,
53 0x00000000fd0dbe32,
54 0x00000000fcfe7562, 0x00000000fcef058e, 0x00000000fcdf6eb8,
55 0x00000000fccfb0e4, 0x00000000fcbfcc13, 0x00000000fcafc048,
56 0x00000000fc9f8d86, 0x00000000fc8f33ce, 0x00000000fc7eb325,
57 0x00000000fc6e0b8b,
58 0x00000000fc5d3d03, 0x00000000fc4c4791, 0x00000000fc3b2b37,
59 0x00000000fc29e7f7, 0x00000000fc187dd5, 0x00000000fc06ecd2,
60 0x00000000fbf534f2, 0x00000000fbe35637, 0x00000000fbd150a3,
61 0x00000000fbbf243b,
62 0x00000000fbacd100, 0x00000000fb9a56f6, 0x00000000fb87b61f,
63 0x00000000fb74ee7e, 0x00000000fb620016, 0x00000000fb4eeaea,
64 0x00000000fb3baefd, 0x00000000fb284c52, 0x00000000fb14c2eb,
65 0x00000000fb0112cd,
66 0x00000000faed3bf9, 0x00000000fad93e73, 0x00000000fac51a3f,
67 0x00000000fab0cf5e, 0x00000000fa9c5dd5, 0x00000000fa87c5a6,
68 0x00000000fa7306d5, 0x00000000fa5e2164, 0x00000000fa491558,
69 0x00000000fa33e2b3,
70 0x00000000fa1e8978, 0x00000000fa0909ab, 0x00000000f9f36350,
71 0x00000000f9dd9668, 0x00000000f9c7a2f9, 0x00000000f9b18905,
72 0x00000000f99b488f, 0x00000000f984e19c, 0x00000000f96e542e,
73 0x00000000f957a049,
74 0x00000000f940c5f1, 0x00000000f929c528, 0x00000000f9129df3,
75 0x00000000f8fb5056, 0x00000000f8e3dc53, 0x00000000f8cc41ee,
76 0x00000000f8b4812b, 0x00000000f89c9a0e, 0x00000000f8848c9b,
77 0x00000000f86c58d4,
78 0x00000000f853febe, 0x00000000f83b7e5d, 0x00000000f822d7b4,
79 0x00000000f80a0ac7, 0x00000000f7f1179a, 0x00000000f7d7fe31,
80 0x00000000f7bebe90, 0x00000000f7a558ba, 0x00000000f78bccb3,
81 0x00000000f7721a80,
82 0x00000000f7584225, 0x00000000f73e43a5, 0x00000000f7241f04,
83 0x00000000f709d446, 0x00000000f6ef6370, 0x00000000f6d4cc85,
84 0x00000000f6ba0f8a, 0x00000000f69f2c83, 0x00000000f6842374,
85 0x00000000f668f461,
86 0x00000000f64d9f4e, 0x00000000f632243f, 0x00000000f616833a,
87 0x00000000f5fabc41, 0x00000000f5decf59, 0x00000000f5c2bc87,
88 0x00000000f5a683cf, 0x00000000f58a2535, 0x00000000f56da0be,
89 0x00000000f550f66e,
90 0x00000000f5342649, 0x00000000f5173054, 0x00000000f4fa1494,
91 0x00000000f4dcd30c, 0x00000000f4bf6bc2, 0x00000000f4a1deb9,
92 0x00000000f4842bf7, 0x00000000f4665380, 0x00000000f4485559,
93 0x00000000f42a3186,
94 0x00000000f40be80c, 0x00000000f3ed78ef, 0x00000000f3cee434,
95 0x00000000f3b029e1, 0x00000000f39149f9, 0x00000000f3724482,
96 0x00000000f3531980, 0x00000000f333c8f8, 0x00000000f31452ef,
97 0x00000000f2f4b76a,
98 0x00000000f2d4f66d, 0x00000000f2b50ffe, 0x00000000f2950421,
99 0x00000000f274d2dc, 0x00000000f2547c33, 0x00000000f234002b,
100 0x00000000f2135eca, 0x00000000f1f29814, 0x00000000f1d1ac0e,
101 0x00000000f1b09abe,
102 0x00000000f18f6429, 0x00000000f16e0853, 0x00000000f14c8742,
103 0x00000000f12ae0fb, 0x00000000f1091583, 0x00000000f0e724e0,
104 0x00000000f0c50f17, 0x00000000f0a2d42c, 0x00000000f0807426,
105 0x00000000f05def09,
106 0x00000000f03b44db, 0x00000000f01875a1, 0x00000000eff58161,
107 0x00000000efd2681f, 0x00000000efaf29e2, 0x00000000ef8bc6af,
108 0x00000000ef683e8b, 0x00000000ef44917b, 0x00000000ef20bf86,
109 0x00000000eefcc8b1,
110 0x00000000eed8ad01, 0x00000000eeb46c7b, 0x00000000ee900727,
111 0x00000000ee6b7d08, 0x00000000ee46ce25, 0x00000000ee21fa83,
112 0x00000000edfd0228, 0x00000000edd7e51a, 0x00000000edb2a35f,
113 0x00000000ed8d3cfc,
114 0x00000000ed67b1f6, 0x00000000ed420255, 0x00000000ed1c2e1d,
115 0x00000000ecf63554, 0x00000000ecd01801, 0x00000000eca9d628,
116 0x00000000ec836fd1, 0x00000000ec5ce501, 0x00000000ec3635bd,
117 0x00000000ec0f620d,
118 0x00000000ebe869f5, 0x00000000ebc14d7d, 0x00000000eb9a0ca9,
119 0x00000000eb72a780, 0x00000000eb4b1e08, 0x00000000eb237047,
120 0x00000000eafb9e43, 0x00000000ead3a803, 0x00000000eaab8d8d,
121 0x00000000ea834ee6,
122 0x00000000ea5aec15, 0x00000000ea326520, 0x00000000ea09ba0d,
123 0x00000000e9e0eae4, 0x00000000e9b7f7a9, 0x00000000e98ee063,
124 0x00000000e965a51a, 0x00000000e93c45d2, 0x00000000e912c292,
125 0x00000000e8e91b61,
126 0x00000000e8bf5046, 0x00000000e8956146, 0x00000000e86b4e68,
127 0x00000000e84117b3, 0x00000000e816bd2d, 0x00000000e7ec3edc,
128 0x00000000e7c19cc8, 0x00000000e796d6f6, 0x00000000e76bed6e,
129 0x00000000e740e036,
130 0x00000000e715af54, 0x00000000e6ea5ad0, 0x00000000e6bee2af,
131 0x00000000e69346f9, 0x00000000e66787b5, 0x00000000e63ba4e9,
132 0x00000000e60f9e9b, 0x00000000e5e374d4, 0x00000000e5b72798,
133 0x00000000e58ab6f1,
134 0x00000000e55e22e3, 0x00000000e5316b76, 0x00000000e50490b1,
135 0x00000000e4d7929c, 0x00000000e4aa713c, 0x00000000e47d2c98,
136 0x00000000e44fc4b9, 0x00000000e42239a4, 0x00000000e3f48b61,
137 0x00000000e3c6b9f7,
138 0x00000000e398c56c, 0x00000000e36aadc9, 0x00000000e33c7314,
139 0x00000000e30e1554, 0x00000000e2df9490, 0x00000000e2b0f0d0,
140 0x00000000e2822a1a, 0x00000000e2534077, 0x00000000e22433ec,
141 0x00000000e1f50482,
142 0x00000000e1c5b240, 0x00000000e1963d2d, 0x00000000e166a550,
143 0x00000000e136eab0, 0x00000000e1070d56, 0x00000000e0d70d48,
144 0x00000000e0a6ea8e, 0x00000000e076a52f, 0x00000000e0463d33,
145 0x00000000e015b2a1,
146 0x00000000dfe50580, 0x00000000dfb435d9, 0x00000000df8343b2,
147 0x00000000df522f13, 0x00000000df20f804, 0x00000000deef9e8d,
148 0x00000000debe22b5, 0x00000000de8c8483, 0x00000000de5ac3ff,
149 0x00000000de28e131,
150 0x00000000ddf6dc21, 0x00000000ddc4b4d6, 0x00000000dd926b59,
151 0x00000000dd5fffb0, 0x00000000dd2d71e3, 0x00000000dcfac1fb,
152 0x00000000dcc7f000, 0x00000000dc94fbf8, 0x00000000dc61e5ec,
153 0x00000000dc2eade4,
154 0x00000000dbfb53e8, 0x00000000dbc7d7ff, 0x00000000db943a31,
155 0x00000000db607a88, 0x00000000db2c9909, 0x00000000daf895bf,
156 0x00000000dac470af, 0x00000000da9029e3, 0x00000000da5bc163,
157 0x00000000da273737,
158 0x00000000d9f28b66, 0x00000000d9bdbdf9, 0x00000000d988cef8,
159 0x00000000d953be6b, 0x00000000d91e8c5b, 0x00000000d8e938d0,
160 0x00000000d8b3c3d1, 0x00000000d87e2d67, 0x00000000d848759b,
161 0x00000000d8129c74,
162 0x00000000d7dca1fb, 0x00000000d7a68638, 0x00000000d7704934,
163 0x00000000d739eaf7, 0x00000000d7036b89, 0x00000000d6cccaf3,
164 0x00000000d696093d, 0x00000000d65f266f, 0x00000000d6282293,
165 0x00000000d5f0fdb0,
166 0x00000000d5b9b7d0, 0x00000000d58250fa, 0x00000000d54ac937,
167 0x00000000d513208f, 0x00000000d4db570c, 0x00000000d4a36cb6,
168 0x00000000d46b6195, 0x00000000d43335b3, 0x00000000d3fae917,
169 0x00000000d3c27bcb,
170 0x00000000d389edd7, 0x00000000d3513f43, 0x00000000d318701a,
171 0x00000000d2df8063, 0x00000000d2a67027, 0x00000000d26d3f6f,
172 0x00000000d233ee43, 0x00000000d1fa7cae, 0x00000000d1c0eab7,
173 0x00000000d1873867,
174 0x00000000d14d65c8, 0x00000000d11372e1, 0x00000000d0d95fbd,
175 0x00000000d09f2c64, 0x00000000d064d8df, 0x00000000d02a6537,
176 0x00000000cfefd176, 0x00000000cfb51da3, 0x00000000cf7a49c8,
177 0x00000000cf3f55ef,
178 0x00000000cf044220, 0x00000000cec90e64, 0x00000000ce8dbac5,
179 0x00000000ce52474c, 0x00000000ce16b401, 0x00000000cddb00ef,
180 0x00000000cd9f2e1e, 0x00000000cd633b97, 0x00000000cd272964,
181 0x00000000cceaf78e,
182 0x00000000ccaea61e, 0x00000000cc72351e, 0x00000000cc35a497,
183 0x00000000cbf8f492, 0x00000000cbbc2519, 0x00000000cb7f3634,
184 0x00000000cb4227ee, 0x00000000cb04fa50, 0x00000000cac7ad63,
185 0x00000000ca8a4131,
186 0x00000000ca4cb5c3, 0x00000000ca0f0b22, 0x00000000c9d14159,
187 0x00000000c9935870, 0x00000000c9555072, 0x00000000c9172967,
188 0x00000000c8d8e35a, 0x00000000c89a7e53, 0x00000000c85bfa5e,
189 0x00000000c81d5782,
190 0x00000000c7de95cb, 0x00000000c79fb541, 0x00000000c760b5ee,
191 0x00000000c72197dc, 0x00000000c6e25b15, 0x00000000c6a2ffa3,
192 0x00000000c663858f, 0x00000000c623ece2, 0x00000000c5e435a8,
193 0x00000000c5a45fe9,
194 0x00000000c5646bb0, 0x00000000c5245906, 0x00000000c4e427f6,
195 0x00000000c4a3d888, 0x00000000c4636ac8, 0x00000000c422debf,
196 0x00000000c3e23476, 0x00000000c3a16bf9, 0x00000000c3608550,
197 0x00000000c31f8087,
198 0x00000000c2de5da6, 0x00000000c29d1cb8, 0x00000000c25bbdc8,
199 0x00000000c21a40de, 0x00000000c1d8a606, 0x00000000c196ed49,
200 0x00000000c15516b2, 0x00000000c113224a, 0x00000000c0d1101d,
201 0x00000000c08ee033,
202 0x00000000c04c9297, 0x00000000c00a2754, 0x00000000bfc79e73,
203 0x00000000bf84f800, 0x00000000bf423404, 0x00000000beff5289,
204 0x00000000bebc539a, 0x00000000be793741, 0x00000000be35fd89,
205 0x00000000bdf2a67b,
206 0x00000000bdaf3223, 0x00000000bd6ba08b, 0x00000000bd27f1bc,
207 0x00000000bce425c2, 0x00000000bca03ca7, 0x00000000bc5c3676,
208 0x00000000bc181338, 0x00000000bbd3d2f9, 0x00000000bb8f75c3,
209 0x00000000bb4afba1,
210 0x00000000bb06649c, 0x00000000bac1b0c0, 0x00000000ba7ce018,
211 0x00000000ba37f2ad, 0x00000000b9f2e88b, 0x00000000b9adc1bc,
212 0x00000000b9687e4a, 0x00000000b9231e41, 0x00000000b8dda1ac,
213 0x00000000b8980894,
214 0x00000000b8525305, 0x00000000b80c8109, 0x00000000b7c692ac,
215 0x00000000b78087f7, 0x00000000b73a60f6, 0x00000000b6f41db4,
216 0x00000000b6adbe3a, 0x00000000b6674296, 0x00000000b620aad0,
217 0x00000000b5d9f6f4,
218 0x00000000b593270e, 0x00000000b54c3b27, 0x00000000b505334a,
219 0x00000000b4be0f84, 0x00000000b476cfde, 0x00000000b42f7464,
220 0x00000000b3e7fd20, 0x00000000b3a06a1e, 0x00000000b358bb69,
221 0x00000000b310f10c,
222 0x00000000b2c90b11, 0x00000000b2810985, 0x00000000b238ec71,
223 0x00000000b1f0b3e2, 0x00000000b1a85fe2, 0x00000000b15ff07c,
224 0x00000000b11765bc, 0x00000000b0cebfad, 0x00000000b085fe5a,
225 0x00000000b03d21ce,
226 0x00000000aff42a15, 0x00000000afab1739, 0x00000000af61e946,
227 0x00000000af18a048, 0x00000000aecf3c49, 0x00000000ae85bd55,
228 0x00000000ae3c2377, 0x00000000adf26ebb, 0x00000000ada89f2c,
229 0x00000000ad5eb4d5,
230 0x00000000ad14afc2, 0x00000000acca8ffd, 0x00000000ac805594,
231 0x00000000ac360090, 0x00000000abeb90fe, 0x00000000aba106e9,
232 0x00000000ab56625d, 0x00000000ab0ba364, 0x00000000aac0ca0b,
233 0x00000000aa75d65d,
234 0x00000000aa2ac865, 0x00000000a9dfa030, 0x00000000a9945dc9,
235 0x00000000a949013a, 0x00000000a8fd8a91, 0x00000000a8b1f9d8,
236 0x00000000a8664f1c, 0x00000000a81a8a68, 0x00000000a7ceabc7,
237 0x00000000a782b345,
238 0x00000000a736a0ef, 0x00000000a6ea74cf, 0x00000000a69e2ef2,
239 0x00000000a651cf63, 0x00000000a605562f, 0x00000000a5b8c360,
240 0x00000000a56c1702, 0x00000000a51f5123, 0x00000000a4d271cc,
241 0x00000000a485790b,
242 0x00000000a43866eb, 0x00000000a3eb3b77, 0x00000000a39df6bd,
243 0x00000000a35098c7, 0x00000000a30321a2, 0x00000000a2b5915a,
244 0x00000000a267e7fa, 0x00000000a21a258e, 0x00000000a1cc4a24,
245 0x00000000a17e55c5,
246 0x00000000a1304880, 0x00000000a0e2225f, 0x00000000a093e36f,
247 0x00000000a0458bbb, 0x000000009ff71b50, 0x000000009fa8923a,
248 0x000000009f59f086, 0x000000009f0b363e, 0x000000009ebc6370,
249 0x000000009e6d7827,
250 0x000000009e1e746f, 0x000000009dcf5856, 0x000000009d8023e6,
251 0x000000009d30d72d, 0x000000009ce17236, 0x000000009c91f50e,
252 0x000000009c425fc1, 0x000000009bf2b25b, 0x000000009ba2ece8,
253 0x000000009b530f76,
254 0x000000009b031a0f, 0x000000009ab30cc1, 0x000000009a62e797,
255 0x000000009a12aa9f, 0x0000000099c255e5, 0x000000009971e974,
256 0x000000009921655a, 0x0000000098d0c9a2, 0x0000000098801659,
257 0x00000000982f4b8d,
258 0x0000000097de6948, 0x00000000978d6f97, 0x00000000973c5e88,
259 0x0000000096eb3626, 0x000000009699f67f, 0x0000000096489f9e,
260 0x0000000095f73190, 0x0000000095a5ac61, 0x000000009554101f,
261 0x0000000095025cd6,
262 0x0000000094b09292, 0x00000000945eb161, 0x00000000940cb94e,
263 0x0000000093baaa66, 0x00000000936884b6, 0x000000009316484b,
264 0x0000000092c3f531, 0x0000000092718b75, 0x00000000921f0b24,
265 0x0000000091cc744b,
266 0x000000009179c6f5, 0x0000000091270331, 0x0000000090d4290a,
267 0x000000009081388e, 0x00000000902e31c8, 0x000000008fdb14c7,
268 0x000000008f87e197, 0x000000008f349845, 0x000000008ee138dd,
269 0x000000008e8dc36c,
270 0x000000008e3a3800, 0x000000008de696a5, 0x000000008d92df68,
271 0x000000008d3f1256, 0x000000008ceb2f7c, 0x000000008c9736e7,
272 0x000000008c4328a3, 0x000000008bef04bf, 0x000000008b9acb46,
273 0x000000008b467c45,
274 0x000000008af217cb, 0x000000008a9d9de3, 0x000000008a490e9b,
275 0x0000000089f469ff, 0x00000000899fb01e, 0x00000000894ae103,
276 0x0000000088f5fcbc, 0x0000000088a10357, 0x00000000884bf4df,
277 0x0000000087f6d163,
278 0x0000000087a198f0, 0x00000000874c4b92, 0x0000000086f6e956,
279 0x0000000086a1724b, 0x00000000864be67c, 0x0000000085f645f8,
280 0x0000000085a090cc, 0x00000000854ac704, 0x0000000084f4e8ad,
281 0x00000000849ef5d7,
282 0x000000008448ee8c, 0x0000000083f2d2db, 0x00000000839ca2d1,
283 0x0000000083465e7c, 0x0000000082f005e8, 0x0000000082999922,
284 0x0000000082431839, 0x0000000081ec833a, 0x000000008195da31,
285 0x00000000813f1d2d,
286 0x0000000080e84c3a, 0x0000000080916766, 0x00000000803a6ebf,
287 0x000000007fe36251, 0x000000007f8c422b, 0x000000007f350e59,
288 0x000000007eddc6ea, 0x000000007e866bea, 0x000000007e2efd67,
289 0x000000007dd77b6f,
290 0x000000007d7fe60f, 0x000000007d283d54, 0x000000007cd0814c,
291 0x000000007c78b205, 0x000000007c20cf8c, 0x000000007bc8d9ef,
292 0x000000007b70d13b, 0x000000007b18b57e, 0x000000007ac086c5,
293 0x000000007a68451f,
294 0x000000007a0ff098, 0x0000000079b7893e, 0x00000000795f0f1f,
295 0x0000000079068248, 0x0000000078ade2c8, 0x00000000785530ab,
296 0x0000000077fc6c01, 0x0000000077a394d5, 0x00000000774aab36,
297 0x0000000076f1af32,
298 0x000000007698a0d6, 0x00000000763f8030, 0x0000000075e64d4e,
299 0x00000000758d083e, 0x000000007533b10d, 0x0000000074da47c9,
300 0x000000007480cc80, 0x0000000074273f3f, 0x0000000073cda016,
301 0x000000007373ef10,
302 0x00000000731a2c3d, 0x0000000072c057aa, 0x0000000072667164,
303 0x00000000720c797a, 0x0000000071b26ffa, 0x00000000715854f2,
304 0x0000000070fe286e, 0x0000000070a3ea7e, 0x0000000070499b30,
305 0x000000006fef3a90,
306 0x000000006f94c8ae, 0x000000006f3a4596, 0x000000006edfb157,
307 0x000000006e850c00, 0x000000006e2a559d, 0x000000006dcf8e3d,
308 0x000000006d74b5ee, 0x000000006d19ccbe, 0x000000006cbed2bb,
309 0x000000006c63c7f3,
310 0x000000006c08ac74, 0x000000006bad804c, 0x000000006b524389,
311 0x000000006af6f639, 0x000000006a9b986b, 0x000000006a402a2c,
312 0x0000000069e4ab8a, 0x0000000069891c94, 0x00000000692d7d57,
313 0x0000000068d1cde3,
314 0x0000000068760e44, 0x00000000681a3e89, 0x0000000067be5ec1,
315 0x0000000067626ef9, 0x0000000067066f40, 0x0000000066aa5fa3,
316 0x00000000664e4032, 0x0000000065f210f9, 0x000000006595d209,
317 0x000000006539836d,
318 0x0000000064dd2536, 0x000000006480b770, 0x0000000064243a2b,
319 0x0000000063c7ad75, 0x00000000636b115c, 0x00000000630e65ed,
320 0x0000000062b1ab39, 0x000000006254e14c, 0x0000000061f80835,
321 0x00000000619b2002,
322 0x00000000613e28c2, 0x0000000060e12283, 0x0000000060840d54,
323 0x000000006026e943, 0x000000005fc9b65d, 0x000000005f6c74b2,
324 0x000000005f0f2450, 0x000000005eb1c545, 0x000000005e5457a0,
325 0x000000005df6db6f,
326 0x000000005d9950c0, 0x000000005d3bb7a3, 0x000000005cde1024,
327 0x000000005c805a54, 0x000000005c22963f, 0x000000005bc4c3f6,
328 0x000000005b66e385, 0x000000005b08f4fd, 0x000000005aaaf86a,
329 0x000000005a4ceddc,
330 0x0000000059eed561, 0x000000005990af08, 0x0000000059327adf,
331 0x0000000058d438f4, 0x000000005875e957, 0x0000000058178c16,
332 0x0000000057b9213f, 0x00000000575aa8e0, 0x0000000056fc230a,
333 0x00000000569d8fc9,
334 0x00000000563eef2d, 0x0000000055e04144, 0x000000005581861d,
335 0x000000005522bdc6, 0x0000000054c3e84e, 0x00000000546505c4,
336 0x0000000054061636, 0x0000000053a719b3, 0x000000005348104a,
337 0x0000000052e8fa09,
338 0x000000005289d6ff, 0x00000000522aa73a, 0x0000000051cb6aca,
339 0x00000000516c21bc, 0x00000000510ccc20, 0x0000000050ad6a05,
340 0x00000000504dfb78, 0x000000004fee808a, 0x000000004f8ef947,
341 0x000000004f2f65c0,
342 0x000000004ecfc603, 0x000000004e701a1f, 0x000000004e106222,
343 0x000000004db09e1b, 0x000000004d50ce19, 0x000000004cf0f22b,
344 0x000000004c910a5f, 0x000000004c3116c5, 0x000000004bd1176b,
345 0x000000004b710c5f,
346 0x000000004b10f5b2, 0x000000004ab0d371, 0x000000004a50a5ab,
347 0x0000000049f06c70, 0x00000000499027cd, 0x00000000492fd7d3,
348 0x0000000048cf7c8f, 0x00000000486f1611, 0x00000000480ea467,
349 0x0000000047ae27a1,
350 0x00000000474d9fcd, 0x0000000046ed0cfa, 0x00000000468c6f37,
351 0x00000000462bc693, 0x0000000045cb131c, 0x00000000456a54e3,
352 0x0000000045098bf5, 0x0000000044a8b861, 0x000000004447da37,
353 0x0000000043e6f186,
354 0x000000004385fe5c, 0x00000000432500c8, 0x0000000042c3f8d9,
355 0x000000004262e69f, 0x000000004201ca28, 0x0000000041a0a383,
356 0x00000000413f72bf, 0x0000000040de37eb, 0x00000000407cf317,
357 0x00000000401ba450,
358 0x000000003fba4ba7, 0x000000003f58e92a, 0x000000003ef77ce8,
359 0x000000003e9606f1, 0x000000003e348752, 0x000000003dd2fe1c,
360 0x000000003d716b5e, 0x000000003d0fcf25, 0x000000003cae2982,
361 0x000000003c4c7a83,
362 0x000000003beac238, 0x000000003b8900b0, 0x000000003b2735f9,
363 0x000000003ac56223, 0x000000003a63853d, 0x000000003a019f56,
364 0x00000000399fb07d, 0x00000000393db8c1, 0x0000000038dbb831,
365 0x000000003879aedd,
366 0x0000000038179cd3, 0x0000000037b58222, 0x0000000037535edb,
367 0x0000000036f1330b, 0x00000000368efec2, 0x00000000362cc20f,
368 0x0000000035ca7d02, 0x0000000035682fa9, 0x000000003505da14,
369 0x0000000034a37c51,
370 0x0000000034411671, 0x0000000033dea881, 0x00000000337c3292,
371 0x000000003319b4b3, 0x0000000032b72ef2, 0x000000003254a15e,
372 0x0000000031f20c08, 0x00000000318f6efe, 0x00000000312cca50,
373 0x0000000030ca1e0c,
374 0x0000000030676a43, 0x000000003004af02, 0x000000002fa1ec5a,
375 0x000000002f3f2259, 0x000000002edc510f, 0x000000002e79788b,
376 0x000000002e1698dc, 0x000000002db3b212, 0x000000002d50c43c,
377 0x000000002cedcf68,
378 0x000000002c8ad3a7, 0x000000002c27d108, 0x000000002bc4c799,
379 0x000000002b61b76b, 0x000000002afea08c, 0x000000002a9b830b,
380 0x000000002a385ef9, 0x0000000029d53464, 0x000000002972035b,
381 0x00000000290ecbee,
382 0x0000000028ab8e2c, 0x0000000028484a25, 0x0000000027e4ffe7,
383 0x000000002781af83, 0x00000000271e5906, 0x0000000026bafc82,
384 0x0000000026579a04, 0x0000000025f4319d, 0x000000002590c35c,
385 0x00000000252d4f4f,
386 0x0000000024c9d587, 0x0000000024665613, 0x000000002402d101,
387 0x00000000239f4662, 0x00000000233bb644, 0x0000000022d820b8,
388 0x00000000227485cc, 0x000000002210e590, 0x0000000021ad4013,
389 0x0000000021499565,
390 0x0000000020e5e594, 0x00000000208230b1, 0x00000000201e76ca,
391 0x000000001fbab7ef, 0x000000001f56f430, 0x000000001ef32b9b,
392 0x000000001e8f5e41, 0x000000001e2b8c30, 0x000000001dc7b578,
393 0x000000001d63da29,
394 0x000000001cfffa51, 0x000000001c9c1600, 0x000000001c382d46,
395 0x000000001bd44032, 0x000000001b704ed3, 0x000000001b0c5939,
396 0x000000001aa85f74, 0x000000001a446191, 0x0000000019e05fa2,
397 0x00000000197c59b5,
398 0x0000000019184fdb, 0x0000000018b44221, 0x0000000018503098,
399 0x0000000017ec1b50, 0x0000000017880257, 0x000000001723e5bd,
400 0x0000000016bfc591, 0x00000000165ba1e4, 0x0000000015f77ac3,
401 0x0000000015935040,
402 0x00000000152f2269, 0x0000000014caf14d, 0x000000001466bcfd,
403 0x0000000014028587, 0x00000000139e4afb, 0x00000000133a0d69,
404 0x0000000012d5cce0, 0x000000001271896f, 0x00000000120d4326,
405 0x0000000011a8fa15,
406 0x000000001144ae4a, 0x0000000010e05fd6, 0x00000000107c0ec7,
407 0x000000001017bb2d, 0x000000000fb36519, 0x000000000f4f0c98,
408 0x000000000eeab1bb, 0x000000000e865491, 0x000000000e21f52a,
409 0x000000000dbd9395,
410 0x000000000d592fe1, 0x000000000cf4ca1f, 0x000000000c90625c,
411 0x000000000c2bf8aa, 0x000000000bc78d18, 0x000000000b631fb4,
412 0x000000000afeb08f, 0x000000000a9a3fb8, 0x000000000a35cd3e,
413 0x0000000009d15931,
414 0x00000000096ce3a1, 0x0000000009086c9c, 0x0000000008a3f433,
415 0x00000000083f7a75, 0x0000000007daff71, 0x0000000007768337,
416 0x00000000071205d6, 0x0000000006ad875f, 0x00000000064907df,
417 0x0000000005e48768,
418 0x0000000005800608, 0x00000000051b83cf, 0x0000000004b700cc,
419 0x0000000004527d0f, 0x0000000003edf8a7, 0x00000000038973a4,
420 0x000000000324ee16, 0x0000000002c0680b, 0x00000000025be194,
421 0x0000000001f75ac0,
422 0x000000000192d39e, 0x00000000012e4c3e, 0x0000000000c9c4af,
423 0x0000000000653d02, 0x0000000000000000
424};
425
426EAPI Eina_F32p32
427eina_f32p32_cos(Eina_F32p32 a)
428{
429 Eina_F32p32 F32P32_2PI;
430 Eina_F32p32 F32P32_PI2;
431 Eina_F32p32 F32P32_3PI2;
432 Eina_F32p32 remainder_2PI;
433 Eina_F32p32 remainder_PI;
434 Eina_F32p32 interpol;
435 Eina_F32p32 result;
436 int idx;
437 int index2;
438
439 F32P32_2PI = EINA_F32P32_PI << 1;
440 F32P32_PI2 = EINA_F32P32_PI >> 1;
441 F32P32_3PI2 = EINA_F32P32_PI + F32P32_PI2;
442
443 /* Take advantage of cosinus symetrie. */
444 a = eina_fp32p32_llabs(a);
445
446 /* Find table entry in 0 to PI / 2 */
447 remainder_PI = a - (a / EINA_F32P32_PI) * EINA_F32P32_PI;
448
449 /* Find which case from 0 to 2 * PI */
450 remainder_2PI = a - (a / F32P32_2PI) * F32P32_2PI;
451
452 interpol = eina_f32p32_div(eina_f32p32_scale(remainder_PI, MAX_PREC * 2),
453 EINA_F32P32_PI);
454 idx = eina_f32p32_int_to(interpol);
455 if (idx >= MAX_PREC)
456 idx = 2 * MAX_PREC - (idx + 1);
457
458 index2 = idx + 1;
459 if (index2 == MAX_PREC)
460 index2 = idx - 1;
461
462 result = eina_f32p32_add(eina_trigo[idx],
463 eina_f32p32_mul(eina_f32p32_sub(eina_trigo[idx],
464 eina_trigo[index2]),
465 (Eina_F32p32)eina_f32p32_fracc_get(
466 interpol)));
467
468 if (0 <= remainder_2PI && remainder_2PI < F32P32_PI2)
469 return result;
470 else if (F32P32_PI2 <= remainder_2PI && remainder_2PI < EINA_F32P32_PI)
471 return -result;
472 else if (EINA_F32P32_PI <= remainder_2PI && remainder_2PI < F32P32_3PI2)
473 return -result;
474 else /* if (F32P32_3PI2 <= remainder_2PI) */
475 return result;
476}
477
478EAPI Eina_F32p32
479eina_f32p32_sin(Eina_F32p32 a)
480{
481 Eina_F32p32 F32P32_2PI;
482 Eina_F32p32 F32P32_PI2;
483 Eina_F32p32 F32P32_3PI2;
484 Eina_F32p32 remainder_2PI;
485 Eina_F32p32 remainder_PI;
486 Eina_F32p32 interpol;
487 Eina_F32p32 result;
488 int idx;
489 int index2;
490
491 F32P32_2PI = EINA_F32P32_PI << 1;
492 F32P32_PI2 = EINA_F32P32_PI >> 1;
493 F32P32_3PI2 = EINA_F32P32_PI + F32P32_PI2;
494
495 /* We only have a table for cosinus, but sin(a) = cos(pi / 2 - a) */
496 a = eina_f32p32_sub(F32P32_PI2, a);
497
498 /* Take advantage of cosinus symetrie. */
499 a = eina_fp32p32_llabs(a);
500
501 /* Find table entry in 0 to PI / 2 */
502 remainder_PI = a - (a / EINA_F32P32_PI) * EINA_F32P32_PI;
503
504 /* Find which case from 0 to 2 * PI */
505 remainder_2PI = a - (a / F32P32_2PI) * F32P32_2PI;
506
507 interpol = eina_f32p32_div(eina_f32p32_scale(remainder_PI, MAX_PREC * 2),
508 EINA_F32P32_PI);
509 idx = eina_f32p32_int_to(interpol);
510 if (idx >= MAX_PREC)
511 idx = 2 * MAX_PREC - (idx + 1);
512
513 index2 = idx + 1;
514 if (index2 == MAX_PREC)
515 index2 = idx - 1;
516
517 result = eina_f32p32_add(eina_trigo[idx],
518 eina_f32p32_mul(eina_f32p32_sub(eina_trigo[idx],
519 eina_trigo[index2]),
520 (Eina_F32p32)eina_f32p32_fracc_get(
521 interpol)));
522
523 if (0 <= remainder_2PI && remainder_2PI < F32P32_PI2)
524 return result;
525 else if (F32P32_PI2 <= remainder_2PI && remainder_2PI < EINA_F32P32_PI)
526 return -result;
527 else if (EINA_F32P32_PI <= remainder_2PI && remainder_2PI < F32P32_3PI2)
528 return -result;
529 else /* if (F32P32_3PI2 <= remainder_2PI) */
530 return result;
531}
532