numeris 0.5.2

Pure-Rust numerical algorithms library — high performance with SIMD support while also supporting no-std for embedded and WASM targets.
Documentation
//! Verner 8(7) Robust — 17 stages, order 8(7).
//!
//! Source: <https://www.sfu.ca/~jverner/RKV87.IIa.Robust.00000754677.081208.CoeffsOnlyFLOAT>
//! 13 core stages + 4 interpolation stages (14–17) for 7th-degree dense output.

use super::adaptive::RKAdaptive;

/// Verner 8(7) — 17 stages, order 8(7).
pub struct RKV87;

const BHAT: [f64; 17] = [
    0.045_847_111_400_495_924,
    0.0,
    0.0,
    0.0,
    0.0,
    0.262_318_914_041_523_85,
    0.191_693_723_378_526_1,
    0.217_091_723_279_026_18,
    0.127_381_896_248_337_07,
    0.115_105_303_853_653_27,
    0.0,
    0.0,
    0.040_561_327_798_437_57,
    0.0,
    0.0,
    0.0,
    0.0,
];

impl RKAdaptive<17, 7> for RKV87 {
    const ORDER: usize = 8;
    const FSAL: bool = false;

    const C: [f64; 17] = [
        0.0,
        0.25,
        0.112_888_451_443_569_56,
        0.169_332_677_165_354_33,
        0.424,
        0.509,
        0.867,
        0.15,
        0.709_068_036_513_868_4,
        0.32,
        0.45,
        1.0,
        1.0,
        1.0,
        0.311_017_763_495_386_4,
        0.536,
        0.132,
    ];

    const B: [f64; 17] = [
        0.044_729_564_666_695_71,
        0.0,
        0.0,
        0.0,
        0.0,
        0.156_910_335_277_082,
        0.184_609_734_081_516_37,
        0.225_163_806_020_869_9,
        0.147_946_156_519_702_36,
        0.076_055_542_444_955_83,
        0.122_772_902_350_186_2,
        0.041_811_958_638_991_634,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
    ];

    const BERR: [f64; 17] = {
        let mut berr = [0.0; 17];
        let mut ix: usize = 0;
        while ix < 17 {
            berr[ix] = RKV87::B[ix] - BHAT[ix];
            ix += 1;
        }
        berr
    };

    #[rustfmt::skip]
    const A: [[f64; 17]; 17] = [
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.087_400_846_504_915_24, 0.025_487_604_938_654_32, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.042_333_169_291_338_58, 0.0, 0.126_999_507_874_015_76, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.426_095_058_887_422_6, 0.0, -1.598_795_284_659_152_2, 1.596_700_225_771_729_8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.050_719_337_296_713_93, 0.0, 0.0, 0.254_333_772_646_004_1, 0.203_946_890_057_282, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [-0.290_003_747_175_231_1, 0.0, 0.0, 1.344_187_391_026_079, -2.864_777_943_361_443, 2.677_594_299_510_595, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.098_535_011_337_993_54, 0.0, 0.0, 0.0, 0.221_926_806_307_513_85, -0.181_406_229_118_069_94, 0.010_944_411_472_562_547, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.387_110_525_457_311_45, 0.0, 0.0, -1.442_445_497_485_527_9, 2.905_398_189_069_950_7, -1.853_771_069_630_106, 0.140_036_480_987_281_55, 0.572_739_408_114_958_2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [-0.161_244_034_444_393_1, 0.0, 0.0, -0.173_396_029_573_589_85, -1.301_289_281_406_514_7, 1.137_950_375_173_861_8, -0.031_747_649_663_966_88, 0.933_512_938_249_336_7, -0.083_786_318_334_733_85, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [-0.019_199_444_881_589_534, 0.0, 0.0, 0.273_308_572_652_642_86, -0.675_349_732_069_443_7, 0.341_518_498_138_460_14, -0.067_950_064_803_375_77, 0.096_591_752_247_623_88, 0.132_530_825_111_821_02, 0.368_549_593_603_861_14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.609_187_740_364_528_9, 0.0, 0.0, -2.272_569_085_898_002, 4.757_898_342_694_029, -5.516_106_706_692_758, 0.290_059_636_968_011_9, 0.569_142_396_335_903_7, 0.792_679_576_033_216_7, 0.154_737_204_532_888_22, 1.614_970_895_662_181_5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.887_357_622_085_347_2, 0.0, 0.0, -2.975_459_782_108_537, 5.600_717_009_488_163, -5.915_607_450_536_674, 0.220_296_891_561_349_27, 0.101_550_978_244_622_17, 1.151_434_564_738_605_5, 1.929_710_166_527_124, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.044_729_564_666_695_71, 0.0, 0.0, 0.0, 0.0, 0.156_910_335_277_082, 0.184_609_734_081_516_37, 0.225_163_806_020_869_9, 0.147_946_156_519_702_36, 0.076_055_542_444_955_83, 0.122_772_902_350_186_2, 0.041_811_958_638_991_634, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.045_849_099_625_917_46, 0.0, 0.0, 0.0, 0.0, 0.007_818_706_744_375_54, 0.006_155_870_622_618_811, 0.219_557_144_962_368_1, -0.012_225_817_326_973_467, 0.032_613_004_929_588_3, 0.012_547_978_055_204_379, 0.011_296_811_426_148_919, 0.0, -0.012_595_035_543_861_663, 0.0, 0.0, 0.0],
        [0.041_678_472_841_386_13, 0.0, 0.0, 0.0, 0.0, -0.407_384_910_369_989_03, -0.023_022_567_199_816_38, 0.248_239_224_265_301_62, 0.074_000_268_175_605_97, -0.193_014_180_625_97, 0.669_028_028_438_252_4, -0.010_992_295_645_101_225, 0.0, 0.014_803_893_689_681_396, 0.122_664_066_430_649_1, 0.0, 0.0],
        [0.056_466_094_567_966_32, 0.0, 0.0, 0.0, 0.0, -0.035_229_104_404_967_85, 0.065_681_610_650_812_92, 0.073_835_451_653_301_5, -0.192_585_731_505_893_7, 0.037_655_636_156_526_41, -0.518_600_904_222_035, 0.091_902_795_697_430_7, 0.0, -0.103_613_462_778_129_86, 0.105_196_591_077_502_14, 0.551_291_023_107_486_3, 0.0],
    ];

    #[rustfmt::skip]
    const BI: [[f64; 7]; 17] = [
        [1.0, -10.951_475_872_296_147, 59.397_978_993_855_5, -169.078_142_889_099_87, 253.764_946_049_986_52, -188.816_893_093_947_93, 54.728_316_376_168_58],
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.0, -46.412_413_164_580_95, 459.368_844_443_592_5, -1_703.186_404_409_985_2, 2_931.752_704_829_931_6, -2_358.261_136_034_433_5, 716.895_314_670_752_4],
        [0.0, 5.227_285_917_918_246, -52.191_388_155_366_8, 196.475_740_128_630_7, -345.764_578_356_240_46, 286.023_327_497_035_44, -89.585_777_297_895_59],
        [0.0, -139.781_565_318_096_82, 1_384.049_425_472_941, -5_135.222_952_667_993, 8_848.685_618_357_147, -7_127.416_107_369_449, 2_169.910_745_331_471_4],
        [0.0, -16.964_054_728_311_62, 167.699_082_344_754_7, -620.443_220_458_668_3, 1_064.602_309_196_311, -852.815_389_658_44, 258.069_219_460_873_85],
        [0.0, -35.509_949_707_403_74, 351.560_012_328_024_3, -1_304.112_648_012_321_2, 2_246.458_668_426_436_4, -1_808.737_304_793_872_5, 550.417_277_301_581_9],
        [0.0, -42.872_702_983_325_67, 424.384_181_854_290_2, -1_573.800_189_653_22, 2_709.864_860_007_943_7, -2_180.642_953_240_307_6, 663.189_576_916_97],
        [0.0, 6.218_398_007_581_9, -61.687_918_339_359_97, 229.640_011_215_638_82, -397.636_837_736_535_7, 322.306_008_856_158_26, -98.797_850_044_844_31],
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.0, -7.110_162_725_994_358, 70.668_902_272_224_26, -263.969_297_929_341_56, 459.472_606_615_498_53, -375.162_114_901_897_6, 116.100_066_669_510_72],
        [0.0, 70.404_327_114_822_34, -711.025_443_121_709_1, 2_707.824_092_614_873_7, -4_757.024_287_614_61, 3_882.656_434_297_324_3, -1_192.835_123_290_700_7],
        [0.0, 82.908_733_703_264_22, -817.386_837_255_751_3, 3_011.227_972_172_782_3, -5_142.113_838_585_539, 4_105.547_441_159_415, -1_240.183_471_194_171_5],
        [0.0, 134.843_579_756_422_6, -1_274.836_840_837_495_2, 4_624.645_039_888_704, -7_872.062_171_190_329_5, 6_295.318_687_282_414, -1_907.908_294_899_716_6],
    ];
}