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
//! Tsitouras Order 5(4) Runge-Kutta integrator
//!
//! Reference: <https://dblp.org/rec/journals/cma/Tsitouras11>

use super::adaptive::RKAdaptive;

const A32: f64 = 0.335_480_655_492_357;
const A42: f64 = -6.359_448_489_975_075;
const A52: f64 = -11.748_883_564_062_83;
const A43: f64 = 4.362_295_432_869_581;
const A53: f64 = 7.495_539_342_889_836;
const A54: f64 = -0.092_495_066_361_755_25;
const A62: f64 = -12.920_969_317_847_11;
const A63: f64 = 8.159_367_898_576_159;
const A64: f64 = -0.071_584_973_281_401;
const A65: f64 = -0.028_269_050_394_068_38;

const BI11: f64 = -1.053_088_497_729_021_6;
const BI12: f64 = -1.329_989_018_975_141;
const BI13: f64 = -1.436_402_854_171_635_1;
const BI14: f64 = 0.713_981_691_707_420_9;

const BI21: f64 = 0.1017;
const BI22: f64 = -2.196_656_833_824_975_4;
const BI23: f64 = 1.294_985_250_737_463;

const BI31: f64 = 2.490_627_285_651_253;
const BI32: f64 = -2.385_356_454_720_616_5;
const BI33: f64 = 1.578_034_682_080_924_8;

const BI41: f64 = -16.548_102_889_244_902;
const BI42: f64 = -1.217_129_272_955_332_5;
const BI43: f64 = -0.616_204_060_378_000_9;

const BI51: f64 = 47.379_521_962_819_28;
const BI52: f64 = -1.203_071_208_372_362_7;
const BI53: f64 = -0.658_047_292_653_547_3;

const BI61: f64 = -34.870_657_861_496_61;
const BI62: f64 = -1.2;
const BI63: f64 = -2.0 / 3.0;

const BI71: f64 = 2.5;
const BI72: f64 = -1.0;
const BI73: f64 = -0.6;

/// Tsitouras 5(4) — 7 stages, order 5(4), FSAL.
pub struct RKTS54;

impl RKAdaptive<7, 4> for RKTS54 {
    const C: [f64; 7] = [0.0, 0.161, 0.327, 0.9, 0.980_025_540_904_509_7, 1.0, 1.0];

    const B: [f64; 7] = [
        0.096_460_766_818_065_23,
        0.01,
        0.479_889_650_414_499_6,
        1.379_008_574_103_742,
        -3.290_069_515_436_081,
        2.324_710_524_099_774,
        0.0,
    ];

    const BERR: [f64; 7] = [
        0.001_780_011_052_226,
        0.000_816_434_459_657,
        -0.007_880_878_010_262,
        0.144_711_007_173_263,
        -0.582_357_165_452_555,
        0.458_082_105_929_187,
        -1.0 / 66.0,
    ];

    const A: [[f64; 7]; 7] = [
        [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [Self::C[1], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
        [Self::C[2] - A32, A32, 0.0, 0.0, 0.0, 0.0, 0.0],
        [Self::C[3] - A42 - A43, A42, A43, 0.0, 0.0, 0.0, 0.0],
        [Self::C[4] - A52 - A53 - A54, A52, A53, A54, 0.0, 0.0, 0.0],
        [
            Self::C[5] - A62 - A63 - A64 - A65,
            A62,
            A63,
            A64,
            A65,
            0.0,
            0.0,
        ],
        Self::B,
    ];

    const ORDER: usize = 5;
    const FSAL: bool = true;

    const BI: [[f64; 4]; 7] = [
        [
            BI11 * BI12 * BI14,
            BI11 * (BI14 + BI12 * BI13),
            BI11 * (BI13 + BI12),
            BI11,
        ],
        [0.0, BI21 * BI23, BI21 * BI22, BI21],
        [0.0, BI31 * BI33, BI31 * BI32, BI31],
        [0.0, BI41 * BI42 * BI43, BI41 * (BI42 + BI43), BI41],
        [0.0, BI51 * BI52 * BI53, BI51 * (BI52 + BI53), BI51],
        [0.0, BI61 * BI62 * BI63, BI61 * (BI62 + BI63), BI61],
        [0.0, BI71 * BI72 * BI73, BI71 * (BI72 + BI73), BI71],
    ];
}