fn arithmetic_geo_mean_of_2(a: &Decimal, b: &Decimal) -> Decimal {
    const TOLERANCE: Decimal = Decimal::from_parts(5, 0, 0, false, 7);
    let diff = (a - b).abs();

    if diff < TOLERANCE {
        *a
    } else {
        arithmetic_geo_mean_of_2(&mean_of_2(a, b), &geo_mean_of_2(a, b))
    }
}
/// Returns the convergence of both the arithmetic and geometric mean.
/// Used internally.
Returns the convergence of both the arithmetic and geometric mean.
Used internally.
Returns the convergence of both the arithmetic and geometric mean . Used internally .
fn arithmetic_geo_mean_of_2(a: &Decimal, b: &Decimal) -> Decimal {
    const TOLERANCE: Decimal = Decimal::from_parts(5, 0, 0, false, 7);
    let diff = (a - b).abs();
    if diff < TOLERANCE {
        *a
    } else {
        arithmetic_geo_mean_of_2(&mean_of_2(a, b), &geo_mean_of_2(a, b))
    }
}
fn arithmetic_geo_mean_of_2 ( a : & Decimal , b : & Decimal ) -> Decimal { const TOLERANCE : Decimal = Decimal :: from_parts ( 5 , 0 , 0 , false , 7 ) ; let diff = ( a - b ) . abs ( ) ; if diff < TOLERANCE { * a } else { arithmetic_geo_mean_of_2 ( & mean_of_2 ( a , b ) , & geo_mean_of_2 ( a , b ) ) } }
Returns the convergence of both the arithmetic and geometric mean.
Returns the convergence of both the arithmetic and geometric mean .
a
&Decimal
b
&Decimal
a
&Decimal
b
&Decimal