g_math 0.4.32

Multi-domain fixed-point arithmetic with geometric extension: Lie groups, manifolds, ODE solvers, tensors, fiber bundles — pure Rust, zero-float, deterministic
Documentation
// GENERATED by scripts/generate_compute_tier_refs.py — mpmath 60-digit references.
// (x_compute_raw, expected_compute_raw, expected_storage_raw)
// compute raw = round(v * 2^COMPUTE_FRAC_BITS); storage raw = round(v * 2^FRAC_BITS).

#[cfg(table_format = "q16_16")]
pub mod refs {
    pub const EXP: &[(i128, i128, i64)] = &[
        (-15032385536, 129696774, 1979),
        (-3221225472, 2028798896, 30957),
        (268435456, 4571968888, 69763),
        (2147483648, 7081203938, 108051),
        (5368709120, 14990908854, 228743),
        (8589934592, 31735754293, 484249),
        (15032385536, 142229783155, 2170254),
    ];
    pub const LN: &[(i128, i128, i64)] = &[
        (268435456, -11908177887, -181704),
        (2147483648, -2977044472, -45426),
        (5368709120, 958394255, 14624),
        (8589934592, 2977044472, 45426),
        (33285996544, 8794773795, 134198),
    ];
    pub const SQRT: &[(i128, i128, i64)] = &[
        (268435456, 1073741824, 16384),
        (2147483648, 3037000500, 46341),
        (8589934592, 6074001000, 92682),
        (33285996544, 11956682925, 182445),
        (429496729600, 42949672960, 655360),
    ];
    pub const SIGMOID: &[(i128, i128, i64)] = &[
        (-30064771072, 3912935, 60),
        (-10737418240, 325808402, 4971),
        (-2147483648, 1621524825, 24743),
        (0, 2147483648, 32768),
        (2147483648, 2673442471, 40793),
        (10737418240, 3969158894, 60565),
        (30064771072, 4291054361, 65476),
    ];
    pub const SOFTPLUS: &[(i128, i128, i64)] = &[
        (-30064771072, 3914719, 60),
        (-10737418240, 338828829, 5170),
        (-2147483648, 2036145143, 31069),
        (0, 2977044472, 45426),
        (2147483648, 4183628791, 63837),
        (10737418240, 11076247069, 169010),
        (30064771072, 30068685791, 458812),
    ];
    pub const LN1P: &[(i128, i128, i64)] = &[
        (-4026531840, -11908177887, -181704),
        (-2147483648, -2977044472, -45426),
        (268435456, 260380768, 3973),
        (4294967296, 2977044472, 45426),
        (33285996544, 9316014706, 142151),
    ];
    pub const SINH: &[(i128, i128, i64)] = &[
        (-10737418240, -25985430380, -396506),
        (-2147483648, -2238087295, -34151),
        (2147483648, 2238087295, 34151),
        (10737418240, 25985430380, 396506),
    ];
    pub const COSH: &[(i128, i128, i64)] = &[
        (-10737418240, 26337982765, 401886),
        (-2147483648, 4843116643, 73900),
        (2147483648, 4843116643, 73900),
        (10737418240, 26337982765, 401886),
    ];
}

#[cfg(table_format = "q32_32")]
pub mod refs {
    pub const EXP: &[(i128, i128, i64)] = &[
        (-64563604257983430656, 557043403687188862, 129696774),
        (-13835058055282163712, 8713624907393923404, 2028798896),
        (1152921504606846976, 19636456851539679190, 4571968888),
        (9223372036854775808, 30413539329486470295, 7081203938),
        (23058430092136939520, 64385463265773092015, 14990908854),
        (36893488147419103232, 136304026803256390413, 31735754293),
        (64563604257983430656, 610872267167220801962, 142229783155),
    ];
    pub const LN: &[(i128, i128, i64)] = &[
        (1152921504606846976, -51145234580810622639, -11908177887),
        (9223372036854775808, -12786308645202655660, -2977044472),
        (23058430092136939520, 4116271982791902040, 958394255),
        (36893488147419103232, 12786308645202655660, 2977044472),
        (142962266571249025024, 37773265823125490379, 8794773795),
    ];
    pub const SQRT: &[(i128, i128, i64)] = &[
        (1152921504606846976, 4611686018427387904, 1073741824),
        (9223372036854775808, 13043817825332782212, 3037000500),
        (36893488147419103232, 26087635650665564425, 6074001000),
        (142962266571249025024, 51353562131922972300, 11956682925),
        (1844674407370955161600, 184467440737095516160, 42949672960),
    ];
    pub const SIGMOID: &[(i128, i128, i64)] = &[
        (-129127208515966861312, 16805928221156113, 3912935),
        (-46116860184273879040, 1399336432749266786, 325808402),
        (-9223372036854775808, 6964396094736529935, 1621524825),
        (0, 9223372036854775808, 2147483648),
        (9223372036854775808, 11482347978973021681, 2673442471),
        (46116860184273879040, 17047407640960284830, 3969158894),
        (129127208515966861312, 18429938145488395503, 4291054361),
    ];
    pub const SOFTPLUS: &[(i128, i128, i64)] = &[
        (-129127208515966861312, 16813588404545109, 3914719),
        (-46116860184273879040, 1455258738537610951, 338828829),
        (-9223372036854775808, 8745176798406479770, 2036145143),
        (0, 12786308645202655660, 2977044472),
        (9223372036854775808, 17968548835261255578, 4183628791),
        (46116860184273879040, 47572118922811489991, 11076247069),
        (129127208515966861312, 129144022104371406421, 30068685791),
    ];
    pub const LN1P: &[(i128, i128, i64)] = &[
        (-17293822569102704640, -51145234580810622639, -11908177887),
        (-9223372036854775808, -12786308645202655660, -2977044472),
        (1152921504606846976, 1118326883213202225, 260380768),
        (18446744073709551616, 12786308645202655660, 2977044472),
        (142962266571249025024, 40011978492849272991, 9316014706),
    ];
    pub const SINH: &[(i128, i128, i64)] = &[
        (-46116860184273879040, -111606573655351670016, -25985430380),
        (-9223372036854775808, -9612511738454652498, -2238087295),
        (9223372036854775808, 9612511738454652498, 2238087295),
        (46116860184273879040, 111606573655351670016, 25985430380),
    ];
    pub const COSH: &[(i128, i128, i64)] = &[
        (-46116860184273879040, 113120774617257531815, 26337982765),
        (-9223372036854775808, 20801027591031817798, 4843116643),
        (9223372036854775808, 20801027591031817798, 4843116643),
        (46116860184273879040, 113120774617257531815, 26337982765),
    ];
}