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 9(8) Efficient — 21 stages, order 9(8), 8th-degree interpolant.
//!
//! Source: <https://www.sfu.ca/~jverner/RKV98.IIa.Efficient.000000349.081209.FLOAT6040OnWeb>
//! 16 core stages + 5 interpolation stages (17–21) for 8th-degree dense output.

use super::adaptive::RKAdaptive;

/// Verner 9(8) Efficient — 21 stages, order 9(8).
///
/// Has 5 extra stages beyond the 16 core stages to support
/// 8th-degree dense interpolation.
pub struct RKV98;

const BHAT: [f64; 21] = [
    0.019_969_965_148_867_73,
    0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
    2.191_499_304_949_33,
    0.088_570_718_482_084_38,
    0.114_056_023_486_596_56,
    0.253_316_380_534_510_7,
    -2.056_564_386_240_941,
    0.340_809_679_901_312,
    0.0,
    0.0,
    0.048_342_313_738_239_585,
    0.0, 0.0, 0.0, 0.0, 0.0,
];

impl RKAdaptive<21, 8> for RKV98 {
    const ORDER: usize = 9;
    const FSAL: bool = false;

    const C: [f64; 21] = [
        0.0, 0.034_62, 0.097_024_350_638_780_44, 0.145_536_525_958_170_68,
        0.561, 0.229_007_911_590_485, 0.544_992_088_409_515, 0.645,
        0.483_75, 0.067_57, 0.25, 0.659_065_061_873_099_9,
        0.820_6, 0.901_2, 1.0, 1.0, 1.0,
        0.740_418_547_063_156_1, 0.888, 0.696, 0.487,
    ];

    const B: [f64; 21] = [
        0.014_611_976_858_423_152,
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
        -0.391_521_186_233_133_9,
        0.231_093_250_028_950_65,
        0.127_476_676_999_285_25,
        0.224_643_417_620_415_8,
        0.568_435_268_974_851_3,
        0.058_258_715_572_158_275,
        0.136_431_740_348_221_56,
        0.030_570_139_830_827_976,
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
    ];

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

    #[rustfmt::skip]
    const A: [[f64; 21]; 21] = [
        [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.034_62, 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.038_933_543_885_728_734, 0.135_957_894_524_509_18, 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.036_384_131_489_542_67, 0.0, 0.109_152_394_468_628, 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],
        [2.025_763_914_393_97, 0.0, -7.638_023_836_496_292, 6.173_259_922_102_322, 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.051_122_755_894_060_61, 0.0, 0.0, 0.177_082_379_455_502_15, 0.000_802_776_240_922_250_2, 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.131_600_635_797_521_63, 0.0, 0.0, -0.295_727_625_266_963_67, 0.087_813_780_356_429_52, 0.621_305_297_522_527_5, 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.071_666_666_666_666_67, 0.0, 0.0, 0.0, 0.0, 0.330_553_357_891_531_95, 0.242_779_975_441_801_38, 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.071_806_640_625, 0.0, 0.0, 0.0, 0.0, 0.329_438_028_322_817_7, 0.116_519_002_927_182_29, -0.034_013_671_875, 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.048_367_576_463_406_47, 0.0, 0.0, 0.0, 0.0, 0.039_289_899_256_761_64, 0.105_474_094_589_034_46, -0.021_438_652_846_483_126, -0.104_122_917_462_719_44, 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.026_645_614_872_014_785, 0.0, 0.0, 0.0, 0.0, 0.033_333_333_333_333_33, -0.163_107_224_487_246_7, 0.033_960_816_841_277_615, 0.157_231_941_381_462_6, 0.215_226_747_803_187_96, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.036_890_092_487_086_225, 0.0, 0.0, 0.0, 0.0, -0.146_518_157_672_554_3, 0.224_257_776_817_202_44, 0.022_944_057_170_660_725, -0.003_585_005_290_572_876, 0.086_692_233_164_443_85, 0.438_384_065_196_833_76, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [-0.486_601_221_511_334_06, 0.0, 0.0, 0.0, 0.0, -6.304_602_650_282_853, -0.281_245_618_289_472_6, -2.679_019_236_219_849_3, 0.518_815_663_924_157_6, 1.365_353_187_603_341_8, 5.885_091_088_503_946_5, 2.802_808_786_272_062_8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.418_536_745_775_347_16, 0.0, 0.0, 0.0, 0.0, 6.724_547_581_906_459, -0.425_444_280_164_611_8, 3.343_279_153_001_265_8, 0.617_081_663_117_537_8, -0.929_966_123_939_932_8, -6.099_948_804_751_011, -3.002_206_187_889_399, 0.255_320_252_944_344_6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [-0.779_374_086_122_884_6, 0.0, 0.0, 0.0, 0.0, -13.937_342_538_107_776, 1.252_048_853_379_357_2, -14.691_500_408_016_87, -0.494_705_058_533_141_7, 2.242_974_909_146_236_8, 13.367_893_803_828_643, 14.396_650_486_650_687, -0.797_581_333_177_68, 0.440_935_370_953_427_8, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [2.058_051_337_466_886_3, 0.0, 0.0, 0.0, 0.0, 22.357_937_727_968_032, 0.909_498_109_975_563_4, 35.891_100_982_402_64, -3.442_515_027_624_453_6, -4.865_481_358_036_368_5, -18.909_803_813_543_427, -34.263_544_480_304_52, 1.264_756_521_695_642_7, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.014_611_976_858_423_152, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.391_521_186_233_133_9, 0.231_093_250_028_950_65, 0.127_476_676_999_285_25, 0.224_643_417_620_415_8, 0.568_435_268_974_851_3, 0.058_258_715_572_158_275, 0.136_431_740_348_221_56, 0.030_570_139_830_827_976, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.015_499_736_681_895_594, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.335_515_321_905_963_5, 0.200_361_394_419_186_07, 0.125_206_065_928_354_93, 0.229_867_639_318_420_66, -0.202_025_065_347_618_13, 0.059_171_032_306_654_57, -0.026_518_347_830_476_387, -0.023_840_946_021_309_713, 0.0, 0.027_181_715_702_085_017, 0.0, 0.0, 0.0, 0.0],
        [0.013_024_539_431_143_383, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.745_285_090_241_311_2, 0.264_386_789_642_930_1, 0.131_396_175_837_275_4, 0.216_725_381_512_292_73, 0.873_411_756_407_605_3, 0.011_859_056_439_357_767, 0.058_760_029_416_895_51, 0.003_266_518_630_202_088, 0.0, -0.008_959_308_648_417_93, 0.069_414_151_572_026_92, 0.0, 0.0, 0.0],
        [0.013_970_899_969_259_426, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.466_576_533_595_767_45, 0.241_637_278_721_625_71, 0.129_036_334_134_567_47, 0.221_670_067_173_510_54, 0.625_727_512_336_464_5, 0.043_553_124_156_792_84, 0.101_196_249_166_729_08, 0.018_085_822_546_797_21, 0.0, -0.020_798_755_876_891_697, -0.090_222_325_170_862_19, -0.121_279_673_562_225_42, 0.0, 0.0],
        [0.016_046_388_883_181_127, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.095_177_123_994_583_36, 0.135_918_726_465_531_77, 0.123_776_528_095_985_4, 0.233_565_626_410_296_6, -0.090_515_081_726_258_73, -0.025_375_742_700_061_31, -0.135_963_169_688_716_22, -0.046_792_142_841_451_13, 0.0, 0.051_779_588_593_917_48, 0.096_725_956_774_767_74, 0.147_731_269_034_074_27, -0.115_075_071_295_850_39, 0.0],
    ];

    #[rustfmt::skip]
    const BI: [[f64; 8]; 21] = [
        [1.0, -12.749_665_417_715_761, 68.530_807_666_723_22, -194.811_974_535_418_41, 317.842_637_135_285_8, -299.715_540_959_339_65, 152.111_918_642_041_22, -32.193_570_554_718_06],
        [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, 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, 141.069_609_253_371_25, -1_283.768_450_646_593_7, 4_630.280_061_766_681, -8_648.500_976_100_317, 8_890.812_161_067_019, -4_787.949_212_676_938, 1_057.665_286_150_543_8],
        [0.0, -51.751_013_234_515_38, 486.041_250_731_293_13, -1_777.475_586_368_523_9, 3_345.498_238_649_791_3, -3_455.762_480_007_366_3, 1_867.081_161_290_311_5, -413.400_477_810_961_8],
        [0.0, 16.320_820_086_958_964, -118.707_274_096_674_67, 379.898_065_329_465_6, -659.198_017_968_181_6, 645.012_709_496_887, -335.392_363_029_477_96, 72.193_536_858_021_9],
        [0.0, -5.897_787_927_512_738, 89.614_271_566_022_81, -381.388_787_705_276_7, 773.096_419_986_775, -834.121_253_628_326_3, 463.620_915_193_36, -104.699_134_067_421_72],
        [0.0, -211.575_357_829_394_28, 1_922.149_747_207_956_6, -6_927.544_647_063_403, 12_933.891_311_491_838, -13_292.722_522_361_093, 7_157.200_591_588_666, -1_580.830_687_765_595_3],
        [0.0, -29.643_151_549_733_865, 265.616_145_266_880_27, -951.314_637_915_278_5, 1_769.876_627_954_108_2, -1_814.926_158_732_241_7, 975.725_237_951_851_3, -215.275_804_260_013_8],
        [0.0, -78.718_908_222_203_23, 702.203_096_369_808_6, -2_509.783_618_527_791_5, 4_663.884_687_403_353, -4_779.049_763_533_835, 2_567.969_360_375_736_4, -566.368_422_124_720_8],
        [0.0, -20.192_815_666_804_382, 179.363_725_794_911_86, -639.812_626_073_269, 1_187.623_035_597_44, -1_216.083_146_478_911, 653.130_516_603_491_2, -143.998_119_637_028_05],
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [0.0, 22.255_291_729_370_043, -202.276_888_265_656_4, 741.450_403_595_939_1, -1_420.171_375_819_646_5, 1_506.826_759_283_909_7, -842.088_314_540_574_6, 194.004_124_016_658_66],
        [0.0, 14.877_639_873_605_062, -312.284_051_278_534_66, 1_842.506_617_216_153_2, -4_868.899_648_863_079, 6_508.346_688_203_268, -4_307.866_481_530_869, 1_123.319_236_379_456_7],
        [0.0, 94.984_566_505_253_78, -820.577_565_429_543_5, 2_818.347_256_898_649, -4_992.649_725_157_523, 4_835.804_647_435_805, -2_434.068_718_877_444, 498.159_538_624_802_17],
        [0.0, 63.460_825_961_460_32, -387.624_469_578_244_8, 652.600_872_703_938_1, 222.002_097_600_079_96, -1_696.555_363_345_186_4, 1_674.058_335_196_842_8, -527.942_298_538_89],
        [0.0, 57.559_946_437_860_184, -588.280_345_308_349, 2_317.048_600_678_135, -4_624.295_311_909_927, 5_002.133_263_559_41, -2_803.532_946_186_995_6, 639.366_792_729_866_5],
    ];
}