pub trait BesselFloat:
Float
+ 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;
// Required methods
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;
}Expand description
Floating-point trait for Bessel and Airy function computation.
Implemented for f64 and f32. Provides machine constants and
derived thresholds used by the Amos algorithm.
Required Associated Constants§
Sourceconst MACH_EPSILON: Self
const MACH_EPSILON: Self
Machine epsilon (D1MACH(3)).
Sourceconst MACH_DIGITS: i32
const MACH_DIGITS: i32
Number of binary digits in the mantissa (I1MACH(14)).
Sourceconst MACH_MIN_EXP: i32
const MACH_MIN_EXP: i32
Minimum binary exponent (I1MACH(12)).
Sourceconst MACH_MAX_EXP: i32
const MACH_MAX_EXP: i32
Maximum binary exponent (I1MACH(11)).
Required Methods§
Sourcefn from_f64(x: f64) -> Self
fn from_f64(x: f64) -> Self
Infallible conversion from f64.
For f64 this is the identity; for f32 it truncates via as f32.
All Amos algorithm constants originate as f64 literals, so this
conversion always succeeds for the supported types.
Sourcefn fnul() -> Self
fn fnul() -> Self
Large order threshold: 10 + 6*(DIG - 3), where DIG = log10(2) * (DIGITS - 1).
Sourcefn elim() -> Self
fn elim() -> Self
Underflow elimination threshold: 2.303*(K*R1M5 - 3), K = min(|MIN_EXP|, MAX_EXP).
Sourcefn fma(self, a: Self, b: Self) -> Self
fn fma(self, a: Self, b: Self) -> Self
Fused multiply-add: self * a + b.
With std enabled, uses hardware FMA via the C library fma().
Without std, falls back to plain self * a + b to avoid the
slow software FMA in libm.
Named fma to avoid ambiguity with Float::mul_add.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.