thermite-complex 0.2.0

Generic SIMD complex numbers built on Thermite
Documentation
//! Weideman coefficient tables for the Faddeeva function.
//!
//! **Generated by `tables.py`, in this directory. Do not edit by hand.**
//!
//! Leading-term-first (MATLAB `polyval` order), which is what
//! [`poly_rev`](thermite::math::specialized::SpecializedCoreMath::poly_rev) expects.
//! Reordering them silently yields a different polynomial that agrees at `Z = 1`.
//!
//! The f32 tables are the same values rounded, not a separate fit.
//! `Weideman<24|32|40> for f32` exist only to satisfy the
//! [`WeidemanTables`](super::WeidemanTables) supertrait bound - f32 clamps at
//! `MAX_N = 16` and never instantiates them.

use super::Weideman;

impl Weideman<8> for f64 {
    const L: Self = 2.378414230005442;
    const A: [Self; 8] = [
        0.0014229848041546413,
        0.0015142587643912563,
        -0.008825132847675934,
        -0.017753679350031387,
        0.04459409338792004,
        0.2809307617790603,
        0.7062868161372526,
        1.1497363506670526,
    ];
}

impl Weideman<16> for f64 {
    const L: Self = 3.363585661014858;
    const A: [Self; 16] = [
        9.939322536342897e-07,
        3.9812875751282576e-06,
        -5.584233411019305e-06,
        -2.7346404624376358e-05,
        2.170986793234679e-05,
        0.0002107105639655035,
        8.70315842847194e-05,
        -0.0015276597401219678,
        -0.0038810151890227213,
        0.0036825673170918396,
        0.05182240243161155,
        0.19124172674669487,
        0.46929090090360376,
        0.8864478302050547,
        1.3622408222719589,
        1.7483958860819617,
    ];
}

impl Weideman<24> for f64 {
    const L: Self = 4.119534287814235;
    const A: [Self; 24] = [
        -1.5137461285014412e-10,
        4.9048204900217325e-09,
        1.3310454420371002e-09,
        -3.008282348388502e-08,
        -1.9122258888735165e-08,
        1.8738343454069238e-07,
        2.5682641335791855e-07,
        -1.085647579569039e-06,
        -3.0388931842808516e-06,
        4.139461724333319e-06,
        3.0471066082991645e-05,
        2.4331415462260513e-05,
        -0.00020748431511424012,
        -0.0007816642995623505,
        -0.0004936426901285409,
        0.006215006362949199,
        0.033723366855315975,
        0.10838723484566723,
        0.26549639598807706,
        0.5361139535729115,
        0.9257087138588673,
        1.394819673379119,
        1.8562864992055401,
        2.1978589365315413,
    ];
}

impl Weideman<32> for f64 {
    const L: Self = 4.756828460010884;
    const A: [Self; 32] = [
        -1.3033481245090926e-12,
        3.741034357970915e-12,
        8.030394123342998e-12,
        -2.154362353454026e-11,
        -5.544247434751948e-11,
        1.165823850551327e-10,
        4.153742283768118e-10,
        -5.231022115795881e-10,
        -3.208015220602109e-09,
        8.12488917405019e-10,
        2.3797556704926332e-08,
        2.2930439030891307e-08,
        -1.481307891793793e-07,
        -4.184076371185529e-07,
        4.255833137355632e-07,
        4.401531731530374e-06,
        6.821031944000645e-06,
        -2.1409619201818262e-05,
        -0.00013075449254609854,
        -0.0002453298027001812,
        0.0003925913607007896,
        0.004519541105349286,
        0.019006155784845477,
        0.05730440352983719,
        0.14060716226893785,
        0.2954445107150873,
        0.5460139720639342,
        0.9019254893648,
        1.3455441692345451,
        1.8256696296324813,
        2.2635372999002676,
        2.572253408124569,
    ];
}

impl Weideman<40> for f64 {
    const L: Self = 5.3182958969449885;
    const A: [Self; 40] = [
        -1.899694947394927e-15,
        1.128073562364402e-15,
        1.1357687198999241e-14,
        -5.409310282882142e-15,
        -7.074086260286855e-14,
        1.37256205867155e-14,
        4.5329666782606727e-13,
        1.2031458219387989e-13,
        -2.907688342182867e-12,
        -2.7276023158200452e-12,
        1.7714495214011192e-11,
        3.47272670930455e-11,
        -9.055124450928292e-11,
        -3.5632339865976533e-10,
        2.1086006347066517e-10,
        3.0177805400090707e-09,
        3.2497465180436973e-09,
        -1.8315616783040462e-08,
        -6.35177348504429e-08,
        1.4198642399935674e-08,
        5.912136951899494e-07,
        1.483566113220078e-06,
        -1.0660138984947143e-06,
        -1.8007447144750956e-05,
        -5.591309264248318e-05,
        -3.939363145489569e-05,
        0.0004398070159869668,
        0.0027054056330737914,
        0.010048186242783424,
        0.029202916471241867,
        0.07182361779074337,
        0.15504263802479495,
        0.29989437996150065,
        0.5266528988277086,
        0.8472174576593818,
        1.2563815675765133,
        1.7253830848179779,
        2.201513794878312,
        2.61605415276186,
        2.8996245093897053,
    ];
}

impl Weideman<8> for f32 {
    const L: Self = 2.3784142;
    const A: [Self; 8] = [
        0.0014229848,
        0.0015142588,
        -0.008825133,
        -0.01775368,
        0.044594094,
        0.28093076,
        0.7062868,
        1.1497364,
    ];
}

impl Weideman<16> for f32 {
    const L: Self = 3.3635857;
    const A: [Self; 16] = [
        9.939323e-07,
        3.9812876e-06,
        -5.5842333e-06,
        -2.7346405e-05,
        2.1709868e-05,
        0.00021071057,
        8.7031585e-05,
        -0.0015276597,
        -0.003881015,
        0.0036825673,
        0.0518224,
        0.19124173,
        0.4692909,
        0.88644785,
        1.3622408,
        1.7483959,
    ];
}

impl Weideman<24> for f32 {
    const L: Self = 4.1195345;
    const A: [Self; 24] = [
        -1.5137461e-10,
        4.9048205e-09,
        1.3310455e-09,
        -3.0082823e-08,
        -1.912226e-08,
        1.8738343e-07,
        2.568264e-07,
        -1.0856476e-06,
        -3.0388933e-06,
        4.139462e-06,
        3.0471067e-05,
        2.4331415e-05,
        -0.00020748432,
        -0.0007816643,
        -0.0004936427,
        0.0062150066,
        0.033723366,
        0.10838723,
        0.2654964,
        0.536114,
        0.9257087,
        1.3948196,
        1.8562865,
        2.197859,
    ];
}

impl Weideman<32> for f32 {
    const L: Self = 4.7568283;
    const A: [Self; 32] = [
        -1.3033482e-12,
        3.7410344e-12,
        8.030394e-12,
        -2.1543623e-11,
        -5.5442474e-11,
        1.1658238e-10,
        4.1537424e-10,
        -5.2310223e-10,
        -3.2080152e-09,
        8.124889e-10,
        2.3797556e-08,
        2.293044e-08,
        -1.481308e-07,
        -4.1840764e-07,
        4.2558332e-07,
        4.401532e-06,
        6.821032e-06,
        -2.140962e-05,
        -0.00013075449,
        -0.0002453298,
        0.00039259135,
        0.0045195413,
        0.019006155,
        0.057304405,
        0.14060716,
        0.29544452,
        0.54601395,
        0.9019255,
        1.3455442,
        1.8256696,
        2.2635374,
        2.5722535,
    ];
}

impl Weideman<40> for f32 {
    const L: Self = 5.318296;
    const A: [Self; 40] = [
        -1.899695e-15,
        1.1280736e-15,
        1.1357687e-14,
        -5.4093104e-15,
        -7.0740865e-14,
        1.3725621e-14,
        4.5329666e-13,
        1.2031458e-13,
        -2.9076884e-12,
        -2.7276022e-12,
        1.7714495e-11,
        3.4727266e-11,
        -9.055125e-11,
        -3.563234e-10,
        2.1086007e-10,
        3.0177805e-09,
        3.2497465e-09,
        -1.8315617e-08,
        -6.351773e-08,
        1.4198642e-08,
        5.912137e-07,
        1.4835662e-06,
        -1.0660139e-06,
        -1.8007448e-05,
        -5.5913093e-05,
        -3.939363e-05,
        0.00043980702,
        0.0027054057,
        0.010048186,
        0.029202916,
        0.07182362,
        0.15504263,
        0.2998944,
        0.5266529,
        0.84721744,
        1.2563815,
        1.725383,
        2.2015138,
        2.616054,
        2.8996246,
    ];
}

impl super::WeidemanTables for f64 {
    const MAX_N: usize = 40;
    // sqrt(f64::MAX) is ~1.34e154; back off for the (L + y)^2 headroom.
    const HUGE: Self = 1.0e150;
    // Measured crossover: inside this box the correction is never worse than the direct
    // evaluation and up to 4 orders better; outside it, the direct one wins.
    const REAL_AXIS_Y: Self = 1.0e-5;
    const REAL_AXIS_X: Self = 1.0e3;
}

impl super::WeidemanTables for f32 {
    // f32 Horner roundoff floors at ~5e-7 (N = 16); more terms measure no better.
    const MAX_N: usize = 16;
    // sqrt(f32::MAX) is ~1.84e19.
    const HUGE: Self = 1.0e17;
    const REAL_AXIS_Y: Self = 1.0e-3;
    const REAL_AXIS_X: Self = 1.0e2;
}