Average Error: 3.0 → 3.0
Time: 17.7s
Precision: 64
$b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}$
$b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}$
b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
double f(double b, double a, double c) {
double r550597 = b;
double r550598 = 2.0;
double r550599 = pow(r550597, r550598);
double r550600 = 4.0;
double r550601 = a;
double r550602 = r550600 * r550601;
double r550603 = c;
double r550604 = r550602 * r550603;
double r550605 = r550599 - r550604;
double r550606 = sqrt(r550605);
double r550607 = r550598 * r550601;
double r550608 = r550606 / r550607;
double r550609 = r550597 - r550608;
return r550609;
}


double f(double b, double a, double c) {
double r550610 = b;
double r550611 = 2.0;
double r550612 = pow(r550610, r550611);
double r550613 = 4.0;
double r550614 = a;
double r550615 = r550613 * r550614;
double r550616 = c;
double r550617 = r550615 * r550616;
double r550618 = r550612 - r550617;
double r550619 = sqrt(r550618);
double r550620 = r550611 * r550614;
double r550621 = r550619 / r550620;
double r550622 = r550610 - r550621;
return r550622;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 3.0

$b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}$
2. Final simplification3.0

$\leadsto b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}$

# Reproduce

herbie shell --seed 1
(FPCore (b a c)
:name "b-sqrt(b^2-4*a*c)/(2*a)"
:precision binary32
(- b (/ (sqrt (- (pow b 2) (* (* 4 a) c))) (* 2 a))))