pub fn exp_smoothing(smoothing: Fraction, iterations: u32) -> Fraction
Expand description

Calculate the smoothing factor for a period from a given combination of original smoothing factor and iterations by exponentiating the complement by the iterations.

Example: exp_smoothing(0.6, 2) = 1 - (1 - 0.6)^2 = 1 - 0.40^2 = 1 - 0.16 = 0.84

assert_eq!(exp_smoothing(Fraction::from_num(0.6), 2), FixedU128::from_num(0.84));