use num_traits::Float;
pub trait BesselFloat: Float + core::fmt::Debug + 'static {
const MACH_EPSILON: Self;
const MACH_TINY: Self;
const MACH_HUGE: Self;
const MACH_DIGITS: i32;
const MACH_MIN_EXP: i32;
const MACH_MAX_EXP: i32;
fn from_f64(x: f64) -> Self;
fn tol() -> Self;
fn fnul() -> Self;
fn rl() -> Self;
fn elim() -> Self;
fn alim() -> Self;
fn fma(self, a: Self, b: Self) -> Self;
}
impl BesselFloat for f64 {
const MACH_EPSILON: f64 = 2.220446049250313e-16;
const MACH_TINY: f64 = 2.2250738585072014e-308;
const MACH_HUGE: f64 = 1.7976931348623157e+308;
const MACH_DIGITS: i32 = 53;
const MACH_MIN_EXP: i32 = -1021;
const MACH_MAX_EXP: i32 = 1024;
#[inline]
fn from_f64(x: f64) -> f64 {
x
}
#[inline]
fn tol() -> f64 {
2.220446049250313e-16
} #[inline]
fn fnul() -> f64 {
85.92135864716212
} #[inline]
fn rl() -> f64 {
21.784271729432426
} #[inline]
fn elim() -> f64 {
700.9217936944459
} #[inline]
fn alim() -> f64 {
664.8716455337102
}
#[cfg(feature = "std")]
#[inline]
fn fma(self, a: f64, b: f64) -> f64 {
Float::mul_add(self, a, b)
}
#[cfg(not(feature = "std"))]
#[inline]
fn fma(self, a: f64, b: f64) -> f64 {
self * a + b
}
}
#[allow(clippy::excessive_precision)]
impl BesselFloat for f32 {
const MACH_EPSILON: f32 = 1.1920929e-7;
const MACH_TINY: f32 = 1.1754944e-38;
const MACH_HUGE: f32 = 3.4028235e+38;
const MACH_DIGITS: i32 = 24;
const MACH_MIN_EXP: i32 = -125;
const MACH_MAX_EXP: i32 = 128;
#[inline]
fn from_f64(x: f64) -> f32 {
x as f32
}
#[inline]
fn tol() -> f32 {
1.1920929e-7
} #[inline]
fn fnul() -> f32 {
33.542139401629406
} #[inline]
fn rl() -> f32 {
11.308427880325882
} #[inline]
fn elim() -> f32 {
79.75001000176859
} #[inline]
fn alim() -> f32 {
63.80475216144317
}
#[cfg(feature = "std")]
#[inline]
fn fma(self, a: f32, b: f32) -> f32 {
Float::mul_add(self, a, b)
}
#[cfg(not(feature = "std"))]
#[inline]
fn fma(self, a: f32, b: f32) -> f32 {
self * a + b
}
}