solmath 0.2.0

Deterministic fixed-point math and quantitative finance for Solana: Greeks, IV, American KBI, NIG, TWAP, and DeFi primitives.
Documentation
// @generated by scripts/generate_norm_cdf_coeffs.py; do not edit manually.
// Coefficients carry 23 binary guard bits and use a Q44 normalized argument.

pub(crate) const CDF_T_Q: u32 = 44;
pub(crate) const CDF_COEFF_GUARD_Q: u32 = 23;
pub(crate) const CDF_TAIL_EVAL_EXTRA_Q: u32 = 16;

#[rustfmt::skip]
pub(crate) const NORM_CDF_0_05_Q23: [i64; 9] = [
    5_022_312_673_274_379_417,
    810_901_814_394_960_375,
    -25_340_681_696_364_488,
    -7_918_961_773_429_722,
    387_699_146_054_352,
    69_389_502_385_790,
    -3_953_372_558_958,
    -474_962_914_137,
    29_820_638_421,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_05_10_Q23: [i64; 9] = [
    6_487_519_978_832_584_408,
    631_530_968_182_396_384,
    -59_206_028_255_022_718,
    -2_878_071_673_133_046,
    751_638_949_715_500,
    -1_201_467_934_009,
    -6_225_724_801_139,
    171_608_579_074,
    37_183_908_071,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_10_15_Q23: [i64; 9] = [
    7_502_353_463_420_028_651,
    383_042_894_792_852_907,
    -59_850_452_304_324_548,
    2_244_390_917_043_581,
    448_099_143_512_382,
    -49_043_605_770_017,
    -1_179_803_424_747,
    412_572_290_876,
    -8_152_741_272,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_15_20_Q23: [i64; 9] = [
    8_052_567_436_258_929_045,
    180_936_651_712_933_008,
    -39_579_892_569_961_957,
    3_887_311_126_932_774,
    -12_884_030_774_286,
    -35_317_084_449_848,
    2_682_329_741_260,
    96_322_531_051,
    -22_929_892_322,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_20_25_Q23: [i64; 9] = [
    8_286_061_690_890_110_763,
    66_562_874_288_895_850,
    -18_720_808_403_019_822,
    2_816_788_802_738_217,
    -201_102_451_387_864,
    -3_785_171_905_445,
    2_030_606_829_142,
    -132_607_678_277,
    -4_187_729_001,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_25_30_Q23: [i64; 9] = [
    8_363_611_934_288_315_465,
    19_070_582_784_364_442,
    -6_555_512_831_727_815,
    1_303_653_159_784_261,
    -155_778_806_952_001,
    9_197_693_666_915,
    244_306_086_201,
    -92_237_248_087,
    6_216_213_178,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_30_35_Q23: [i64; 9] = [
    8_383_767_563_113_200_472,
    4_255_222_200_498_977,
    -1_728_684_015_360_267,
    423_859_902_448_590,
    -68_089_440_955_744,
    7_091_280_908_713,
    -392_810_614_150,
    -7_745_913_483,
    3_363_348_037,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_35_40_Q23: [i64; 8] = [
    8_387_866_302_053_877_089,
    739_446_741_208_920,
    -346_615_654_889_821,
    100_614_799_710_785,
    -19_971_041_118_753,
    2_801_420_617_745,
    -271_251_106_815,
    15_299_614_663,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_40_45_Q23: [i64; 8] = [
    8_388_518_338_151_337_464,
    100_073_233_982_094,
    -53_164_038_770_139,
    17_786_456_193_782,
    -4_170_069_803_186,
    719_520_944_996,
    -93_728_901_152,
    8_731_131_264,
];

#[rustfmt::skip]
pub(crate) const NORM_CDF_45_50_Q23: [i64; 8] = [
    8_388_599_468_088_094_501,
    10_547_641_148_047,
    -6_262_720_284_500,
    2_369_102_993_018,
    -637_798_948_297,
    129_316_723_829,
    -20_745_949_957,
    2_509_157_234,
];

#[rustfmt::skip]
pub(crate) const NORM_TAIL_50_55_Q23: [i64; 7] = [
    637_950_326_283,
    -865_853_490_422,
    568_189_218_107,
    -239_158_995_636,
    72_640_182_033,
    -17_636_074_988,
    3_171_254_302,
];

#[rustfmt::skip]
pub(crate) const NORM_TAIL_55_60_Q23: [i64; 7] = [
    37_442_282_177,
    -55_350_763_209,
    39_586_705_805,
    -18_452_922_552,
    6_745_935_486,
    -1_704_412_420,
    0,
];

#[rustfmt::skip]
pub(crate) const NORM_TAIL_60_65_Q23: [i64; 7] = [
    1_721_563_339,
    -2_717_324_504,
    2_144_137_258,
    -1_244_276_484,
    438_993_263,
    0,
    0,
];

#[rustfmt::skip]
pub(crate) const NORM_TAIL_65_70_Q23: [i64; 7] = [
    59_305_874,
    -106_020_191,
    111_584_833,
    -56_182_006,
    0,
    0,
    0,
];

pub(crate) const NORM_TAIL_HALF_RAW_CUTOFF: i128 = 7_130_506_848_171;