/// get the analytical mininum of a quadratic fit to two input bounds
get the analytical mininum of a quadratic fit to two input bounds
get the analytical mininum of a quadratic fit to two input bounds
fn quadratic_min(low: Bound, high: Bound) -> f64
{
    let d_value = high.value - low.value;
    let d_alpha = high.alpha - low.alpha;
    let d_alpha2 = d_alpha * d_alpha;
    // get quadratic coefficients
    // f(x) = bx^2 + cx + d
    let b = (d_value - low.slope * d_alpha) / d_alpha2;
    let c = low.slope;
    // The derivative of f has a single root
    low.alpha - c / (2.0 * b)
}
fn quadratic_min ( low : Bound , high : Bound ) -> f64 { let d_value = high . value - low . value ; let d_alpha = high . alpha - low . alpha ; let d_alpha2 = d_alpha * d_alpha ; // get quadratic coefficients // f(x) = bx^2 + cx + d let b = ( d_value - low . slope * d_alpha ) / d_alpha2 ; let c = low . slope ; // The derivative of f has a single root low . alpha - c / ( 2.0 * b ) }
get the analytical mininum of a quadratic fit to two input bounds
get the analytical mininum of a quadratic fit to two input bounds
low
Bound
high
Bound