pub mod pattern_strings {
pub const PI: &str = "3.141592653589793238462643383279502884197169399375105820974944592307816406286208";
pub const E: &str = "2.718281828459045235360287471352662497757247093699959574966967627724076630353547";
pub const SQRT_2: &str = "1.414213562373095048801688724209698078569671875376948073176679737990732478462107";
pub const LN_2: &str = "0.693147180559945309417232121458176568075500134360255254120680009493393621969694";
pub const PHI: &str = "1.618033988749894848204586834365638117720309179805762862135448622705260462818902";
pub const LN_10: &str = "2.302585092994045684017991454684364207601101488628772976033327900967572609677352";
pub const SQRT_3: &str = "1.732050807568877293527446341505872366942805253810380628055806979451933016908800";
pub const SQRT_5: &str = "2.236067977499789696409173668731276235440618359611525724270897245410520925637804";
}
pub struct MathematicalConstants;
impl MathematicalConstants {
pub fn PI() -> ([u64; 8], [u64; 8]) {
([17093173215378876564, 4704283712920505792, 12, 0, 0, 0, 0, 0], [11446334060092070145, 16618559870875360976, 3, 0, 0, 0, 0, 0])
}
pub fn E() -> ([u64; 8], [u64; 8]) {
([11266668197513532995, 8782301859590494747, 9, 0, 0, 0, 0, 0], [18354912338540341841, 8966197190596382540, 3, 0, 0, 0, 0, 0])
}
pub fn SQRT_2() -> ([u64; 8], [u64; 8]) {
([5608832401712713489, 5135926685547871228, 0, 0, 0, 0, 0, 0], [6304837579822865708, 3631648587027848854, 0, 0, 0, 0, 0, 0])
}
pub fn LN_2() -> ([u64; 8], [u64; 8]) {
([14116827670876763057, 13288893159019944271, 0, 0, 0, 0, 0, 0], [11742035400196210312, 725076185711792988, 1, 0, 0, 0, 0, 0])
}
pub fn PHI() -> ([u64; 8], [u64; 8]) {
([1298777728820984005, 31, 0, 0, 0, 0, 0, 0], [3736710778780434371, 19, 0, 0, 0, 0, 0, 0])
}
pub fn LN_10() -> ([u64; 8], [u64; 8]) {
([7913720833983364865, 2757150434758170784, 10, 0, 0, 0, 0, 0], [12535103863569060163, 7523630527690126472, 4, 0, 0, 0, 0, 0])
}
pub fn SQRT_3() -> ([u64; 8], [u64; 8]) {
([9709625594627164551, 1072574971, 0, 0, 0, 0, 0, 0], [9902194762307657316, 619251448, 0, 0, 0, 0, 0, 0])
}
pub fn SQRT_5() -> ([u64; 8], [u64; 8]) {
([11418695431520134782, 11663460903872282127, 4, 0, 0, 0, 0, 0], [15929765354331731713, 1321109109259568227, 2, 0, 0, 0, 0, 0])
}
pub fn GOLDEN_RATIO() -> ([u64; 8], [u64; 8]) {
Self::PHI()
}
pub fn PI_OVER_2() -> ([u64; 8], [u64; 8]) {
([8546586607689438282, 2352141856460252896, 6, 0, 0, 0, 0, 0], [11446334060092070145, 16618559870875360976, 3, 0, 0, 0, 0, 0])
}
pub fn PI_OVER_4() -> ([u64; 8], [u64; 8]) {
([4273293303844719141, 1176070928230126448, 3, 0, 0, 0, 0, 0], [11446334060092070145, 16618559870875360976, 3, 0, 0, 0, 0, 0])
}
pub fn PI_OVER_6() -> ([u64; 8], [u64; 8]) {
([8546586607689438282, 2352141856460252896, 6, 0, 0, 0, 0, 0], [15892258106566658819, 12962191465206979697, 11, 0, 0, 0, 0, 0])
}
pub fn ONE_OVER_E() -> ([u64; 8], [u64; 8]) {
([18354912338540341841, 8966197190596382540, 3, 0, 0, 0, 0, 0], [11266668197513532995, 8782301859590494747, 9, 0, 0, 0, 0, 0])
}
pub fn E_SQUARED() -> ([u64; 8], [u64; 8]) {
Self::E() }
#[inline]
pub fn extract_i128_from_u64_8(arr: [u64; 8]) -> i128 {
let low = arr[0] as i128;
let high = arr[1] as i128;
low | (high << 64)
}
#[inline]
pub fn extract_u64_4_from_u64_8(arr: [u64; 8]) -> [u64; 4] {
[arr[0], arr[1], arr[2], arr[3]]
}
}