Expand description
Numerical utilities for numerically stable computation
Provides compensated summation (Kahan) and other numerical primitives used in training loops and loss computation.
Functions§
- kahan_
mean - Numerically stable mean computation using Kahan summation
- kahan_
sum - Kahan compensated summation — reduces floating-point accumulation error from O(n * eps) to O(eps) for n addends.
- kahan_
sum_ f64 - Kahan compensated summation for f64 values
- kahan_
variance - Numerically stable variance computation (two-pass with Kahan)