pxfm/
sin_table.rs

1/*
2 * // Copyright (c) Radzivon Bartoshyk 7/2025. All rights reserved.
3 * //
4 * // Redistribution and use in source and binary forms, with or without modification,
5 * // are permitted provided that the following conditions are met:
6 * //
7 * // 1.  Redistributions of source code must retain the above copyright notice, this
8 * // list of conditions and the following disclaimer.
9 * //
10 * // 2.  Redistributions in binary form must reproduce the above copyright notice,
11 * // this list of conditions and the following disclaimer in the documentation
12 * // and/or other materials provided with the distribution.
13 * //
14 * // 3.  Neither the name of the copyright holder nor the names of its
15 * // contributors may be used to endorse or promote products derived from
16 * // this software without specific prior written permission.
17 * //
18 * // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 * // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 * // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30pub(crate) static SIN_K_PI_OVER_128: [(u64, u64); 256] = [
31    (0x0000000000000000, 0x0000000000000000),
32    (0xbbfb1d63091a0130, 0x3f992155f7a3667e),
33    (0xbc2912bd0d569a90, 0x3fa91f65f10dd814),
34    (0xbc49a088a8bf6b2c, 0x3fb2d52092ce19f6),
35    (0xbc3e2718d26ed688, 0x3fb917a6bc29b42c),
36    (0x3c4a2704729ae56d, 0x3fbf564e56a9730e),
37    (0x3c513000a89a11e0, 0x3fc2c8106e8e613a),
38    (0x3c6531ff779ddac6, 0x3fc5e214448b3fc6),
39    (0xbc626d19b9ff8d82, 0x3fc8f8b83c69a60b),
40    (0xbc1af1439e521935, 0x3fcc0b826a7e4f63),
41    (0xbc642deef11da2c4, 0x3fcf19f97b215f1b),
42    (0x3c7824c20ab7aa9a, 0x3fd111d262b1f677),
43    (0xbc75d28da2c4612d, 0x3fd294062ed59f06),
44    (0x3c70c97c4afa2518, 0x3fd4135c94176601),
45    (0xbc1efdc0d58cf620, 0x3fd58f9a75ab1fdd),
46    (0xbc744b19e0864c5d, 0x3fd7088530fa459f),
47    (0xbc672cedd3d5a610, 0x3fd87de2a6aea963),
48    (0x3c66da81290bdbab, 0x3fd9ef7943a8ed8a),
49    (0x3c65b362cb974183, 0x3fdb5d1009e15cc0),
50    (0x3c56850e59c37f8f, 0x3fdcc66e9931c45e),
51    (0x3c5e0d891d3c6841, 0x3fde2b5d3806f63b),
52    (0xbc32ec1fc1b776b8, 0x3fdf8ba4dbf89aba),
53    (0xbc8a5a014347406c, 0x3fe073879922ffee),
54    (0xbc8ef23b69abe4f1, 0x3fe11eb3541b4b23),
55    (0x3c8b25dd267f6600, 0x3fe1c73b39ae68c8),
56    (0xbc85da743ef3770c, 0x3fe26d054cdd12df),
57    (0xbc6efcc626f74a6f, 0x3fe30ff7fce17035),
58    (0x3c7e3e25e3954964, 0x3fe3affa292050b9),
59    (0x3c68076a2cfdc6b3, 0x3fe44cf325091dd6),
60    (0x3c63c293edceb327, 0x3fe4e6cabbe3e5e9),
61    (0xbc875720992bfbb2, 0x3fe57d69348ceca0),
62    (0xbc7251b352ff2a37, 0x3fe610b7551d2cdf),
63    (0xbc8bdd3413b26456, 0x3fe6a09e667f3bcd),
64    (0x3c80d4ef0f1d915c, 0x3fe72d0837efff96),
65    (0xbc70f537acdf0ad7, 0x3fe7b5df226aafaf),
66    (0xbc76f420f8ea3475, 0x3fe83b0e0bff976e),
67    (0xbc82c5e12ed1336d, 0x3fe8bc806b151741),
68    (0x3c83d419a920df0b, 0x3fe93a22499263fb),
69    (0xbc830ee286712474, 0x3fe9b3e047f38741),
70    (0xbc7128bb015df175, 0x3fea29a7a0462782),
71    (0x3c39f630e8b6dac8, 0x3fea9b66290ea1a3),
72    (0xbc8926da300ffcce, 0x3feb090a58150200),
73    (0xbc8bc69f324e6d61, 0x3feb728345196e3e),
74    (0xbc8825a732ac700a, 0x3febd7c0ac6f952a),
75    (0xbc76e0b1757c8d07, 0x3fec38b2f180bdb1),
76    (0xbc52fb761e946603, 0x3fec954b213411f5),
77    (0xbc5e7b6bb5ab58ae, 0x3feced7af43cc773),
78    (0xbc84ef5295d25af2, 0x3fed4134d14dc93a),
79    (0x3c7457e610231ac2, 0x3fed906bcf328d46),
80    (0x3c883c37c6107db3, 0x3feddb13b6ccc23c),
81    (0xbc8014c76c126527, 0x3fee212104f686e5),
82    (0xbc616b56f2847754, 0x3fee6288ec48e112),
83    (0x3c8760b1e2e3f81e, 0x3fee9f4156c62dda),
84    (0x3c7e82c791f59cc2, 0x3feed740e7684963),
85    (0x3c752c7adc6b4989, 0x3fef0a7efb9230d7),
86    (0xbc7d7bafb51f72e6, 0x3fef38f3ac64e589),
87    (0x3c7562172a361fd3, 0x3fef6297cff75cb0),
88    (0x3c7ab256778ffcb6, 0x3fef8764fa714ba9),
89    (0xbc87a0a8ca13571f, 0x3fefa7557f08a517),
90    (0x3c81ec8668ecacee, 0x3fefc26470e19fd3),
91    (0xbc887df6378811c7, 0x3fefd88da3d12526),
92    (0x3c6521ecd0c67e35, 0x3fefe9cdad01883a),
93    (0xbc6c57bc2e24aa15, 0x3feff621e3796d7e),
94    (0xbc81354d4556e4cb, 0x3feffd886084cd0d),
95    (0x0000000000000000, 0x3ff0000000000000),
96    (0xbc81354d4556e4cb, 0x3feffd886084cd0d),
97    (0xbc6c57bc2e24aa15, 0x3feff621e3796d7e),
98    (0x3c6521ecd0c67e35, 0x3fefe9cdad01883a),
99    (0xbc887df6378811c7, 0x3fefd88da3d12526),
100    (0x3c81ec8668ecacee, 0x3fefc26470e19fd3),
101    (0xbc87a0a8ca13571f, 0x3fefa7557f08a517),
102    (0x3c7ab256778ffcb6, 0x3fef8764fa714ba9),
103    (0x3c7562172a361fd3, 0x3fef6297cff75cb0),
104    (0xbc7d7bafb51f72e6, 0x3fef38f3ac64e589),
105    (0x3c752c7adc6b4989, 0x3fef0a7efb9230d7),
106    (0x3c7e82c791f59cc2, 0x3feed740e7684963),
107    (0x3c8760b1e2e3f81e, 0x3fee9f4156c62dda),
108    (0xbc616b56f2847754, 0x3fee6288ec48e112),
109    (0xbc8014c76c126527, 0x3fee212104f686e5),
110    (0x3c883c37c6107db3, 0x3feddb13b6ccc23c),
111    (0x3c7457e610231ac2, 0x3fed906bcf328d46),
112    (0xbc84ef5295d25af2, 0x3fed4134d14dc93a),
113    (0xbc5e7b6bb5ab58ae, 0x3feced7af43cc773),
114    (0xbc52fb761e946603, 0x3fec954b213411f5),
115    (0xbc76e0b1757c8d07, 0x3fec38b2f180bdb1),
116    (0xbc8825a732ac700a, 0x3febd7c0ac6f952a),
117    (0xbc8bc69f324e6d61, 0x3feb728345196e3e),
118    (0xbc8926da300ffcce, 0x3feb090a58150200),
119    (0x3c39f630e8b6dac8, 0x3fea9b66290ea1a3),
120    (0xbc7128bb015df175, 0x3fea29a7a0462782),
121    (0xbc830ee286712474, 0x3fe9b3e047f38741),
122    (0x3c83d419a920df0b, 0x3fe93a22499263fb),
123    (0xbc82c5e12ed1336d, 0x3fe8bc806b151741),
124    (0xbc76f420f8ea3475, 0x3fe83b0e0bff976e),
125    (0xbc70f537acdf0ad7, 0x3fe7b5df226aafaf),
126    (0x3c80d4ef0f1d915c, 0x3fe72d0837efff96),
127    (0xbc8bdd3413b26456, 0x3fe6a09e667f3bcd),
128    (0xbc7251b352ff2a37, 0x3fe610b7551d2cdf),
129    (0xbc875720992bfbb2, 0x3fe57d69348ceca0),
130    (0x3c63c293edceb327, 0x3fe4e6cabbe3e5e9),
131    (0x3c68076a2cfdc6b3, 0x3fe44cf325091dd6),
132    (0x3c7e3e25e3954964, 0x3fe3affa292050b9),
133    (0xbc6efcc626f74a6f, 0x3fe30ff7fce17035),
134    (0xbc85da743ef3770c, 0x3fe26d054cdd12df),
135    (0x3c8b25dd267f6600, 0x3fe1c73b39ae68c8),
136    (0xbc8ef23b69abe4f1, 0x3fe11eb3541b4b23),
137    (0xbc8a5a014347406c, 0x3fe073879922ffee),
138    (0xbc32ec1fc1b776b8, 0x3fdf8ba4dbf89aba),
139    (0x3c5e0d891d3c6841, 0x3fde2b5d3806f63b),
140    (0x3c56850e59c37f8f, 0x3fdcc66e9931c45e),
141    (0x3c65b362cb974183, 0x3fdb5d1009e15cc0),
142    (0x3c66da81290bdbab, 0x3fd9ef7943a8ed8a),
143    (0xbc672cedd3d5a610, 0x3fd87de2a6aea963),
144    (0xbc744b19e0864c5d, 0x3fd7088530fa459f),
145    (0xbc1efdc0d58cf620, 0x3fd58f9a75ab1fdd),
146    (0x3c70c97c4afa2518, 0x3fd4135c94176601),
147    (0xbc75d28da2c4612d, 0x3fd294062ed59f06),
148    (0x3c7824c20ab7aa9a, 0x3fd111d262b1f677),
149    (0xbc642deef11da2c4, 0x3fcf19f97b215f1b),
150    (0xbc1af1439e521935, 0x3fcc0b826a7e4f63),
151    (0xbc626d19b9ff8d82, 0x3fc8f8b83c69a60b),
152    (0x3c6531ff779ddac6, 0x3fc5e214448b3fc6),
153    (0x3c513000a89a11e0, 0x3fc2c8106e8e613a),
154    (0x3c4a2704729ae56d, 0x3fbf564e56a9730e),
155    (0xbc3e2718d26ed688, 0x3fb917a6bc29b42c),
156    (0xbc49a088a8bf6b2c, 0x3fb2d52092ce19f6),
157    (0xbc2912bd0d569a90, 0x3fa91f65f10dd814),
158    (0xbbfb1d63091a0130, 0x3f992155f7a3667e),
159    (0x0000000000000000, 0x0000000000000000),
160    (0x3bfb1d63091a0130, 0xbf992155f7a3667e),
161    (0x3c2912bd0d569a90, 0xbfa91f65f10dd814),
162    (0x3c49a088a8bf6b2c, 0xbfb2d52092ce19f6),
163    (0x3c3e2718d26ed688, 0xbfb917a6bc29b42c),
164    (0xbc4a2704729ae56d, 0xbfbf564e56a9730e),
165    (0xbc513000a89a11e0, 0xbfc2c8106e8e613a),
166    (0xbc6531ff779ddac6, 0xbfc5e214448b3fc6),
167    (0x3c626d19b9ff8d82, 0xbfc8f8b83c69a60b),
168    (0x3c1af1439e521935, 0xbfcc0b826a7e4f63),
169    (0x3c642deef11da2c4, 0xbfcf19f97b215f1b),
170    (0xbc7824c20ab7aa9a, 0xbfd111d262b1f677),
171    (0x3c75d28da2c4612d, 0xbfd294062ed59f06),
172    (0xbc70c97c4afa2518, 0xbfd4135c94176601),
173    (0x3c1efdc0d58cf620, 0xbfd58f9a75ab1fdd),
174    (0x3c744b19e0864c5d, 0xbfd7088530fa459f),
175    (0x3c672cedd3d5a610, 0xbfd87de2a6aea963),
176    (0xbc66da81290bdbab, 0xbfd9ef7943a8ed8a),
177    (0xbc65b362cb974183, 0xbfdb5d1009e15cc0),
178    (0xbc56850e59c37f8f, 0xbfdcc66e9931c45e),
179    (0xbc5e0d891d3c6841, 0xbfde2b5d3806f63b),
180    (0x3c32ec1fc1b776b8, 0xbfdf8ba4dbf89aba),
181    (0x3c8a5a014347406c, 0xbfe073879922ffee),
182    (0x3c8ef23b69abe4f1, 0xbfe11eb3541b4b23),
183    (0xbc8b25dd267f6600, 0xbfe1c73b39ae68c8),
184    (0x3c85da743ef3770c, 0xbfe26d054cdd12df),
185    (0x3c6efcc626f74a6f, 0xbfe30ff7fce17035),
186    (0xbc7e3e25e3954964, 0xbfe3affa292050b9),
187    (0xbc68076a2cfdc6b3, 0xbfe44cf325091dd6),
188    (0xbc63c293edceb327, 0xbfe4e6cabbe3e5e9),
189    (0x3c875720992bfbb2, 0xbfe57d69348ceca0),
190    (0x3c7251b352ff2a37, 0xbfe610b7551d2cdf),
191    (0x3c8bdd3413b26456, 0xbfe6a09e667f3bcd),
192    (0xbc80d4ef0f1d915c, 0xbfe72d0837efff96),
193    (0x3c70f537acdf0ad7, 0xbfe7b5df226aafaf),
194    (0x3c76f420f8ea3475, 0xbfe83b0e0bff976e),
195    (0x3c82c5e12ed1336d, 0xbfe8bc806b151741),
196    (0xbc83d419a920df0b, 0xbfe93a22499263fb),
197    (0x3c830ee286712474, 0xbfe9b3e047f38741),
198    (0x3c7128bb015df175, 0xbfea29a7a0462782),
199    (0xbc39f630e8b6dac8, 0xbfea9b66290ea1a3),
200    (0x3c8926da300ffcce, 0xbfeb090a58150200),
201    (0x3c8bc69f324e6d61, 0xbfeb728345196e3e),
202    (0x3c8825a732ac700a, 0xbfebd7c0ac6f952a),
203    (0x3c76e0b1757c8d07, 0xbfec38b2f180bdb1),
204    (0x3c52fb761e946603, 0xbfec954b213411f5),
205    (0x3c5e7b6bb5ab58ae, 0xbfeced7af43cc773),
206    (0x3c84ef5295d25af2, 0xbfed4134d14dc93a),
207    (0xbc7457e610231ac2, 0xbfed906bcf328d46),
208    (0xbc883c37c6107db3, 0xbfeddb13b6ccc23c),
209    (0x3c8014c76c126527, 0xbfee212104f686e5),
210    (0x3c616b56f2847754, 0xbfee6288ec48e112),
211    (0xbc8760b1e2e3f81e, 0xbfee9f4156c62dda),
212    (0xbc7e82c791f59cc2, 0xbfeed740e7684963),
213    (0xbc752c7adc6b4989, 0xbfef0a7efb9230d7),
214    (0x3c7d7bafb51f72e6, 0xbfef38f3ac64e589),
215    (0xbc7562172a361fd3, 0xbfef6297cff75cb0),
216    (0xbc7ab256778ffcb6, 0xbfef8764fa714ba9),
217    (0x3c87a0a8ca13571f, 0xbfefa7557f08a517),
218    (0xbc81ec8668ecacee, 0xbfefc26470e19fd3),
219    (0x3c887df6378811c7, 0xbfefd88da3d12526),
220    (0xbc6521ecd0c67e35, 0xbfefe9cdad01883a),
221    (0x3c6c57bc2e24aa15, 0xbfeff621e3796d7e),
222    (0x3c81354d4556e4cb, 0xbfeffd886084cd0d),
223    (0x0000000000000000, 0xbff0000000000000),
224    (0x3c81354d4556e4cb, 0xbfeffd886084cd0d),
225    (0x3c6c57bc2e24aa15, 0xbfeff621e3796d7e),
226    (0xbc6521ecd0c67e35, 0xbfefe9cdad01883a),
227    (0x3c887df6378811c7, 0xbfefd88da3d12526),
228    (0xbc81ec8668ecacee, 0xbfefc26470e19fd3),
229    (0x3c87a0a8ca13571f, 0xbfefa7557f08a517),
230    (0xbc7ab256778ffcb6, 0xbfef8764fa714ba9),
231    (0xbc7562172a361fd3, 0xbfef6297cff75cb0),
232    (0x3c7d7bafb51f72e6, 0xbfef38f3ac64e589),
233    (0xbc752c7adc6b4989, 0xbfef0a7efb9230d7),
234    (0xbc7e82c791f59cc2, 0xbfeed740e7684963),
235    (0xbc8760b1e2e3f81e, 0xbfee9f4156c62dda),
236    (0x3c616b56f2847754, 0xbfee6288ec48e112),
237    (0x3c8014c76c126527, 0xbfee212104f686e5),
238    (0xbc883c37c6107db3, 0xbfeddb13b6ccc23c),
239    (0xbc7457e610231ac2, 0xbfed906bcf328d46),
240    (0x3c84ef5295d25af2, 0xbfed4134d14dc93a),
241    (0x3c5e7b6bb5ab58ae, 0xbfeced7af43cc773),
242    (0x3c52fb761e946603, 0xbfec954b213411f5),
243    (0x3c76e0b1757c8d07, 0xbfec38b2f180bdb1),
244    (0x3c8825a732ac700a, 0xbfebd7c0ac6f952a),
245    (0x3c8bc69f324e6d61, 0xbfeb728345196e3e),
246    (0x3c8926da300ffcce, 0xbfeb090a58150200),
247    (0xbc39f630e8b6dac8, 0xbfea9b66290ea1a3),
248    (0x3c7128bb015df175, 0xbfea29a7a0462782),
249    (0x3c830ee286712474, 0xbfe9b3e047f38741),
250    (0xbc83d419a920df0b, 0xbfe93a22499263fb),
251    (0x3c82c5e12ed1336d, 0xbfe8bc806b151741),
252    (0x3c76f420f8ea3475, 0xbfe83b0e0bff976e),
253    (0x3c70f537acdf0ad7, 0xbfe7b5df226aafaf),
254    (0xbc80d4ef0f1d915c, 0xbfe72d0837efff96),
255    (0x3c8bdd3413b26456, 0xbfe6a09e667f3bcd),
256    (0x3c7251b352ff2a37, 0xbfe610b7551d2cdf),
257    (0x3c875720992bfbb2, 0xbfe57d69348ceca0),
258    (0xbc63c293edceb327, 0xbfe4e6cabbe3e5e9),
259    (0xbc68076a2cfdc6b3, 0xbfe44cf325091dd6),
260    (0xbc7e3e25e3954964, 0xbfe3affa292050b9),
261    (0x3c6efcc626f74a6f, 0xbfe30ff7fce17035),
262    (0x3c85da743ef3770c, 0xbfe26d054cdd12df),
263    (0xbc8b25dd267f6600, 0xbfe1c73b39ae68c8),
264    (0x3c8ef23b69abe4f1, 0xbfe11eb3541b4b23),
265    (0x3c8a5a014347406c, 0xbfe073879922ffee),
266    (0x3c32ec1fc1b776b8, 0xbfdf8ba4dbf89aba),
267    (0xbc5e0d891d3c6841, 0xbfde2b5d3806f63b),
268    (0xbc56850e59c37f8f, 0xbfdcc66e9931c45e),
269    (0xbc65b362cb974183, 0xbfdb5d1009e15cc0),
270    (0xbc66da81290bdbab, 0xbfd9ef7943a8ed8a),
271    (0x3c672cedd3d5a610, 0xbfd87de2a6aea963),
272    (0x3c744b19e0864c5d, 0xbfd7088530fa459f),
273    (0x3c1efdc0d58cf620, 0xbfd58f9a75ab1fdd),
274    (0xbc70c97c4afa2518, 0xbfd4135c94176601),
275    (0x3c75d28da2c4612d, 0xbfd294062ed59f06),
276    (0xbc7824c20ab7aa9a, 0xbfd111d262b1f677),
277    (0x3c642deef11da2c4, 0xbfcf19f97b215f1b),
278    (0x3c1af1439e521935, 0xbfcc0b826a7e4f63),
279    (0x3c626d19b9ff8d82, 0xbfc8f8b83c69a60b),
280    (0xbc6531ff779ddac6, 0xbfc5e214448b3fc6),
281    (0xbc513000a89a11e0, 0xbfc2c8106e8e613a),
282    (0xbc4a2704729ae56d, 0xbfbf564e56a9730e),
283    (0x3c3e2718d26ed688, 0xbfb917a6bc29b42c),
284    (0x3c49a088a8bf6b2c, 0xbfb2d52092ce19f6),
285    (0x3c2912bd0d569a90, 0xbfa91f65f10dd814),
286    (0x3bfb1d63091a0130, 0xbf992155f7a3667e),
287];