pxfm 0.1.29

Fast and accurate math
Documentation
/*
 * // Copyright (c) Radzivon Bartoshyk 7/2025. All rights reserved.
 * //
 * // Redistribution and use in source and binary forms, with or without modification,
 * // are permitted provided that the following conditions are met:
 * //
 * // 1.  Redistributions of source code must retain the above copyright notice, this
 * // list of conditions and the following disclaimer.
 * //
 * // 2.  Redistributions in binary form must reproduce the above copyright notice,
 * // this list of conditions and the following disclaimer in the documentation
 * // and/or other materials provided with the distribution.
 * //
 * // 3.  Neither the name of the copyright holder nor the names of its
 * // contributors may be used to endorse or promote products derived from
 * // this software without specific prior written permission.
 * //
 * // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

pub(crate) static SIN_K_PI_OVER_128: [(u64, u64); 256] = [
    (0x0000000000000000, 0x0000000000000000),
    (0xbbfb1d63091a0130, 0x3f992155f7a3667e),
    (0xbc2912bd0d569a90, 0x3fa91f65f10dd814),
    (0xbc49a088a8bf6b2c, 0x3fb2d52092ce19f6),
    (0xbc3e2718d26ed688, 0x3fb917a6bc29b42c),
    (0x3c4a2704729ae56d, 0x3fbf564e56a9730e),
    (0x3c513000a89a11e0, 0x3fc2c8106e8e613a),
    (0x3c6531ff779ddac6, 0x3fc5e214448b3fc6),
    (0xbc626d19b9ff8d82, 0x3fc8f8b83c69a60b),
    (0xbc1af1439e521935, 0x3fcc0b826a7e4f63),
    (0xbc642deef11da2c4, 0x3fcf19f97b215f1b),
    (0x3c7824c20ab7aa9a, 0x3fd111d262b1f677),
    (0xbc75d28da2c4612d, 0x3fd294062ed59f06),
    (0x3c70c97c4afa2518, 0x3fd4135c94176601),
    (0xbc1efdc0d58cf620, 0x3fd58f9a75ab1fdd),
    (0xbc744b19e0864c5d, 0x3fd7088530fa459f),
    (0xbc672cedd3d5a610, 0x3fd87de2a6aea963),
    (0x3c66da81290bdbab, 0x3fd9ef7943a8ed8a),
    (0x3c65b362cb974183, 0x3fdb5d1009e15cc0),
    (0x3c56850e59c37f8f, 0x3fdcc66e9931c45e),
    (0x3c5e0d891d3c6841, 0x3fde2b5d3806f63b),
    (0xbc32ec1fc1b776b8, 0x3fdf8ba4dbf89aba),
    (0xbc8a5a014347406c, 0x3fe073879922ffee),
    (0xbc8ef23b69abe4f1, 0x3fe11eb3541b4b23),
    (0x3c8b25dd267f6600, 0x3fe1c73b39ae68c8),
    (0xbc85da743ef3770c, 0x3fe26d054cdd12df),
    (0xbc6efcc626f74a6f, 0x3fe30ff7fce17035),
    (0x3c7e3e25e3954964, 0x3fe3affa292050b9),
    (0x3c68076a2cfdc6b3, 0x3fe44cf325091dd6),
    (0x3c63c293edceb327, 0x3fe4e6cabbe3e5e9),
    (0xbc875720992bfbb2, 0x3fe57d69348ceca0),
    (0xbc7251b352ff2a37, 0x3fe610b7551d2cdf),
    (0xbc8bdd3413b26456, 0x3fe6a09e667f3bcd),
    (0x3c80d4ef0f1d915c, 0x3fe72d0837efff96),
    (0xbc70f537acdf0ad7, 0x3fe7b5df226aafaf),
    (0xbc76f420f8ea3475, 0x3fe83b0e0bff976e),
    (0xbc82c5e12ed1336d, 0x3fe8bc806b151741),
    (0x3c83d419a920df0b, 0x3fe93a22499263fb),
    (0xbc830ee286712474, 0x3fe9b3e047f38741),
    (0xbc7128bb015df175, 0x3fea29a7a0462782),
    (0x3c39f630e8b6dac8, 0x3fea9b66290ea1a3),
    (0xbc8926da300ffcce, 0x3feb090a58150200),
    (0xbc8bc69f324e6d61, 0x3feb728345196e3e),
    (0xbc8825a732ac700a, 0x3febd7c0ac6f952a),
    (0xbc76e0b1757c8d07, 0x3fec38b2f180bdb1),
    (0xbc52fb761e946603, 0x3fec954b213411f5),
    (0xbc5e7b6bb5ab58ae, 0x3feced7af43cc773),
    (0xbc84ef5295d25af2, 0x3fed4134d14dc93a),
    (0x3c7457e610231ac2, 0x3fed906bcf328d46),
    (0x3c883c37c6107db3, 0x3feddb13b6ccc23c),
    (0xbc8014c76c126527, 0x3fee212104f686e5),
    (0xbc616b56f2847754, 0x3fee6288ec48e112),
    (0x3c8760b1e2e3f81e, 0x3fee9f4156c62dda),
    (0x3c7e82c791f59cc2, 0x3feed740e7684963),
    (0x3c752c7adc6b4989, 0x3fef0a7efb9230d7),
    (0xbc7d7bafb51f72e6, 0x3fef38f3ac64e589),
    (0x3c7562172a361fd3, 0x3fef6297cff75cb0),
    (0x3c7ab256778ffcb6, 0x3fef8764fa714ba9),
    (0xbc87a0a8ca13571f, 0x3fefa7557f08a517),
    (0x3c81ec8668ecacee, 0x3fefc26470e19fd3),
    (0xbc887df6378811c7, 0x3fefd88da3d12526),
    (0x3c6521ecd0c67e35, 0x3fefe9cdad01883a),
    (0xbc6c57bc2e24aa15, 0x3feff621e3796d7e),
    (0xbc81354d4556e4cb, 0x3feffd886084cd0d),
    (0x0000000000000000, 0x3ff0000000000000),
    (0xbc81354d4556e4cb, 0x3feffd886084cd0d),
    (0xbc6c57bc2e24aa15, 0x3feff621e3796d7e),
    (0x3c6521ecd0c67e35, 0x3fefe9cdad01883a),
    (0xbc887df6378811c7, 0x3fefd88da3d12526),
    (0x3c81ec8668ecacee, 0x3fefc26470e19fd3),
    (0xbc87a0a8ca13571f, 0x3fefa7557f08a517),
    (0x3c7ab256778ffcb6, 0x3fef8764fa714ba9),
    (0x3c7562172a361fd3, 0x3fef6297cff75cb0),
    (0xbc7d7bafb51f72e6, 0x3fef38f3ac64e589),
    (0x3c752c7adc6b4989, 0x3fef0a7efb9230d7),
    (0x3c7e82c791f59cc2, 0x3feed740e7684963),
    (0x3c8760b1e2e3f81e, 0x3fee9f4156c62dda),
    (0xbc616b56f2847754, 0x3fee6288ec48e112),
    (0xbc8014c76c126527, 0x3fee212104f686e5),
    (0x3c883c37c6107db3, 0x3feddb13b6ccc23c),
    (0x3c7457e610231ac2, 0x3fed906bcf328d46),
    (0xbc84ef5295d25af2, 0x3fed4134d14dc93a),
    (0xbc5e7b6bb5ab58ae, 0x3feced7af43cc773),
    (0xbc52fb761e946603, 0x3fec954b213411f5),
    (0xbc76e0b1757c8d07, 0x3fec38b2f180bdb1),
    (0xbc8825a732ac700a, 0x3febd7c0ac6f952a),
    (0xbc8bc69f324e6d61, 0x3feb728345196e3e),
    (0xbc8926da300ffcce, 0x3feb090a58150200),
    (0x3c39f630e8b6dac8, 0x3fea9b66290ea1a3),
    (0xbc7128bb015df175, 0x3fea29a7a0462782),
    (0xbc830ee286712474, 0x3fe9b3e047f38741),
    (0x3c83d419a920df0b, 0x3fe93a22499263fb),
    (0xbc82c5e12ed1336d, 0x3fe8bc806b151741),
    (0xbc76f420f8ea3475, 0x3fe83b0e0bff976e),
    (0xbc70f537acdf0ad7, 0x3fe7b5df226aafaf),
    (0x3c80d4ef0f1d915c, 0x3fe72d0837efff96),
    (0xbc8bdd3413b26456, 0x3fe6a09e667f3bcd),
    (0xbc7251b352ff2a37, 0x3fe610b7551d2cdf),
    (0xbc875720992bfbb2, 0x3fe57d69348ceca0),
    (0x3c63c293edceb327, 0x3fe4e6cabbe3e5e9),
    (0x3c68076a2cfdc6b3, 0x3fe44cf325091dd6),
    (0x3c7e3e25e3954964, 0x3fe3affa292050b9),
    (0xbc6efcc626f74a6f, 0x3fe30ff7fce17035),
    (0xbc85da743ef3770c, 0x3fe26d054cdd12df),
    (0x3c8b25dd267f6600, 0x3fe1c73b39ae68c8),
    (0xbc8ef23b69abe4f1, 0x3fe11eb3541b4b23),
    (0xbc8a5a014347406c, 0x3fe073879922ffee),
    (0xbc32ec1fc1b776b8, 0x3fdf8ba4dbf89aba),
    (0x3c5e0d891d3c6841, 0x3fde2b5d3806f63b),
    (0x3c56850e59c37f8f, 0x3fdcc66e9931c45e),
    (0x3c65b362cb974183, 0x3fdb5d1009e15cc0),
    (0x3c66da81290bdbab, 0x3fd9ef7943a8ed8a),
    (0xbc672cedd3d5a610, 0x3fd87de2a6aea963),
    (0xbc744b19e0864c5d, 0x3fd7088530fa459f),
    (0xbc1efdc0d58cf620, 0x3fd58f9a75ab1fdd),
    (0x3c70c97c4afa2518, 0x3fd4135c94176601),
    (0xbc75d28da2c4612d, 0x3fd294062ed59f06),
    (0x3c7824c20ab7aa9a, 0x3fd111d262b1f677),
    (0xbc642deef11da2c4, 0x3fcf19f97b215f1b),
    (0xbc1af1439e521935, 0x3fcc0b826a7e4f63),
    (0xbc626d19b9ff8d82, 0x3fc8f8b83c69a60b),
    (0x3c6531ff779ddac6, 0x3fc5e214448b3fc6),
    (0x3c513000a89a11e0, 0x3fc2c8106e8e613a),
    (0x3c4a2704729ae56d, 0x3fbf564e56a9730e),
    (0xbc3e2718d26ed688, 0x3fb917a6bc29b42c),
    (0xbc49a088a8bf6b2c, 0x3fb2d52092ce19f6),
    (0xbc2912bd0d569a90, 0x3fa91f65f10dd814),
    (0xbbfb1d63091a0130, 0x3f992155f7a3667e),
    (0x0000000000000000, 0x0000000000000000),
    (0x3bfb1d63091a0130, 0xbf992155f7a3667e),
    (0x3c2912bd0d569a90, 0xbfa91f65f10dd814),
    (0x3c49a088a8bf6b2c, 0xbfb2d52092ce19f6),
    (0x3c3e2718d26ed688, 0xbfb917a6bc29b42c),
    (0xbc4a2704729ae56d, 0xbfbf564e56a9730e),
    (0xbc513000a89a11e0, 0xbfc2c8106e8e613a),
    (0xbc6531ff779ddac6, 0xbfc5e214448b3fc6),
    (0x3c626d19b9ff8d82, 0xbfc8f8b83c69a60b),
    (0x3c1af1439e521935, 0xbfcc0b826a7e4f63),
    (0x3c642deef11da2c4, 0xbfcf19f97b215f1b),
    (0xbc7824c20ab7aa9a, 0xbfd111d262b1f677),
    (0x3c75d28da2c4612d, 0xbfd294062ed59f06),
    (0xbc70c97c4afa2518, 0xbfd4135c94176601),
    (0x3c1efdc0d58cf620, 0xbfd58f9a75ab1fdd),
    (0x3c744b19e0864c5d, 0xbfd7088530fa459f),
    (0x3c672cedd3d5a610, 0xbfd87de2a6aea963),
    (0xbc66da81290bdbab, 0xbfd9ef7943a8ed8a),
    (0xbc65b362cb974183, 0xbfdb5d1009e15cc0),
    (0xbc56850e59c37f8f, 0xbfdcc66e9931c45e),
    (0xbc5e0d891d3c6841, 0xbfde2b5d3806f63b),
    (0x3c32ec1fc1b776b8, 0xbfdf8ba4dbf89aba),
    (0x3c8a5a014347406c, 0xbfe073879922ffee),
    (0x3c8ef23b69abe4f1, 0xbfe11eb3541b4b23),
    (0xbc8b25dd267f6600, 0xbfe1c73b39ae68c8),
    (0x3c85da743ef3770c, 0xbfe26d054cdd12df),
    (0x3c6efcc626f74a6f, 0xbfe30ff7fce17035),
    (0xbc7e3e25e3954964, 0xbfe3affa292050b9),
    (0xbc68076a2cfdc6b3, 0xbfe44cf325091dd6),
    (0xbc63c293edceb327, 0xbfe4e6cabbe3e5e9),
    (0x3c875720992bfbb2, 0xbfe57d69348ceca0),
    (0x3c7251b352ff2a37, 0xbfe610b7551d2cdf),
    (0x3c8bdd3413b26456, 0xbfe6a09e667f3bcd),
    (0xbc80d4ef0f1d915c, 0xbfe72d0837efff96),
    (0x3c70f537acdf0ad7, 0xbfe7b5df226aafaf),
    (0x3c76f420f8ea3475, 0xbfe83b0e0bff976e),
    (0x3c82c5e12ed1336d, 0xbfe8bc806b151741),
    (0xbc83d419a920df0b, 0xbfe93a22499263fb),
    (0x3c830ee286712474, 0xbfe9b3e047f38741),
    (0x3c7128bb015df175, 0xbfea29a7a0462782),
    (0xbc39f630e8b6dac8, 0xbfea9b66290ea1a3),
    (0x3c8926da300ffcce, 0xbfeb090a58150200),
    (0x3c8bc69f324e6d61, 0xbfeb728345196e3e),
    (0x3c8825a732ac700a, 0xbfebd7c0ac6f952a),
    (0x3c76e0b1757c8d07, 0xbfec38b2f180bdb1),
    (0x3c52fb761e946603, 0xbfec954b213411f5),
    (0x3c5e7b6bb5ab58ae, 0xbfeced7af43cc773),
    (0x3c84ef5295d25af2, 0xbfed4134d14dc93a),
    (0xbc7457e610231ac2, 0xbfed906bcf328d46),
    (0xbc883c37c6107db3, 0xbfeddb13b6ccc23c),
    (0x3c8014c76c126527, 0xbfee212104f686e5),
    (0x3c616b56f2847754, 0xbfee6288ec48e112),
    (0xbc8760b1e2e3f81e, 0xbfee9f4156c62dda),
    (0xbc7e82c791f59cc2, 0xbfeed740e7684963),
    (0xbc752c7adc6b4989, 0xbfef0a7efb9230d7),
    (0x3c7d7bafb51f72e6, 0xbfef38f3ac64e589),
    (0xbc7562172a361fd3, 0xbfef6297cff75cb0),
    (0xbc7ab256778ffcb6, 0xbfef8764fa714ba9),
    (0x3c87a0a8ca13571f, 0xbfefa7557f08a517),
    (0xbc81ec8668ecacee, 0xbfefc26470e19fd3),
    (0x3c887df6378811c7, 0xbfefd88da3d12526),
    (0xbc6521ecd0c67e35, 0xbfefe9cdad01883a),
    (0x3c6c57bc2e24aa15, 0xbfeff621e3796d7e),
    (0x3c81354d4556e4cb, 0xbfeffd886084cd0d),
    (0x0000000000000000, 0xbff0000000000000),
    (0x3c81354d4556e4cb, 0xbfeffd886084cd0d),
    (0x3c6c57bc2e24aa15, 0xbfeff621e3796d7e),
    (0xbc6521ecd0c67e35, 0xbfefe9cdad01883a),
    (0x3c887df6378811c7, 0xbfefd88da3d12526),
    (0xbc81ec8668ecacee, 0xbfefc26470e19fd3),
    (0x3c87a0a8ca13571f, 0xbfefa7557f08a517),
    (0xbc7ab256778ffcb6, 0xbfef8764fa714ba9),
    (0xbc7562172a361fd3, 0xbfef6297cff75cb0),
    (0x3c7d7bafb51f72e6, 0xbfef38f3ac64e589),
    (0xbc752c7adc6b4989, 0xbfef0a7efb9230d7),
    (0xbc7e82c791f59cc2, 0xbfeed740e7684963),
    (0xbc8760b1e2e3f81e, 0xbfee9f4156c62dda),
    (0x3c616b56f2847754, 0xbfee6288ec48e112),
    (0x3c8014c76c126527, 0xbfee212104f686e5),
    (0xbc883c37c6107db3, 0xbfeddb13b6ccc23c),
    (0xbc7457e610231ac2, 0xbfed906bcf328d46),
    (0x3c84ef5295d25af2, 0xbfed4134d14dc93a),
    (0x3c5e7b6bb5ab58ae, 0xbfeced7af43cc773),
    (0x3c52fb761e946603, 0xbfec954b213411f5),
    (0x3c76e0b1757c8d07, 0xbfec38b2f180bdb1),
    (0x3c8825a732ac700a, 0xbfebd7c0ac6f952a),
    (0x3c8bc69f324e6d61, 0xbfeb728345196e3e),
    (0x3c8926da300ffcce, 0xbfeb090a58150200),
    (0xbc39f630e8b6dac8, 0xbfea9b66290ea1a3),
    (0x3c7128bb015df175, 0xbfea29a7a0462782),
    (0x3c830ee286712474, 0xbfe9b3e047f38741),
    (0xbc83d419a920df0b, 0xbfe93a22499263fb),
    (0x3c82c5e12ed1336d, 0xbfe8bc806b151741),
    (0x3c76f420f8ea3475, 0xbfe83b0e0bff976e),
    (0x3c70f537acdf0ad7, 0xbfe7b5df226aafaf),
    (0xbc80d4ef0f1d915c, 0xbfe72d0837efff96),
    (0x3c8bdd3413b26456, 0xbfe6a09e667f3bcd),
    (0x3c7251b352ff2a37, 0xbfe610b7551d2cdf),
    (0x3c875720992bfbb2, 0xbfe57d69348ceca0),
    (0xbc63c293edceb327, 0xbfe4e6cabbe3e5e9),
    (0xbc68076a2cfdc6b3, 0xbfe44cf325091dd6),
    (0xbc7e3e25e3954964, 0xbfe3affa292050b9),
    (0x3c6efcc626f74a6f, 0xbfe30ff7fce17035),
    (0x3c85da743ef3770c, 0xbfe26d054cdd12df),
    (0xbc8b25dd267f6600, 0xbfe1c73b39ae68c8),
    (0x3c8ef23b69abe4f1, 0xbfe11eb3541b4b23),
    (0x3c8a5a014347406c, 0xbfe073879922ffee),
    (0x3c32ec1fc1b776b8, 0xbfdf8ba4dbf89aba),
    (0xbc5e0d891d3c6841, 0xbfde2b5d3806f63b),
    (0xbc56850e59c37f8f, 0xbfdcc66e9931c45e),
    (0xbc65b362cb974183, 0xbfdb5d1009e15cc0),
    (0xbc66da81290bdbab, 0xbfd9ef7943a8ed8a),
    (0x3c672cedd3d5a610, 0xbfd87de2a6aea963),
    (0x3c744b19e0864c5d, 0xbfd7088530fa459f),
    (0x3c1efdc0d58cf620, 0xbfd58f9a75ab1fdd),
    (0xbc70c97c4afa2518, 0xbfd4135c94176601),
    (0x3c75d28da2c4612d, 0xbfd294062ed59f06),
    (0xbc7824c20ab7aa9a, 0xbfd111d262b1f677),
    (0x3c642deef11da2c4, 0xbfcf19f97b215f1b),
    (0x3c1af1439e521935, 0xbfcc0b826a7e4f63),
    (0x3c626d19b9ff8d82, 0xbfc8f8b83c69a60b),
    (0xbc6531ff779ddac6, 0xbfc5e214448b3fc6),
    (0xbc513000a89a11e0, 0xbfc2c8106e8e613a),
    (0xbc4a2704729ae56d, 0xbfbf564e56a9730e),
    (0x3c3e2718d26ed688, 0xbfb917a6bc29b42c),
    (0x3c49a088a8bf6b2c, 0xbfb2d52092ce19f6),
    (0x3c2912bd0d569a90, 0xbfa91f65f10dd814),
    (0x3bfb1d63091a0130, 0xbf992155f7a3667e),
];