Average Error: 4.9 → 4.9
Time: 12.1s
Precision: 64
$b \gt 0.0 \land {b}^{2} - 4 \cdot ac \ge 0.0$
$\frac{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}$
$\frac{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}$
\frac{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}
\frac{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}
double f(double b, double ac, double a) {
double r3551195 = b;
double r3551196 = -r3551195;
double r3551197 = 2.0;
double r3551198 = pow(r3551195, r3551197);
double r3551199 = 4.0;
double r3551200 = ac;
double r3551201 = r3551199 * r3551200;
double r3551202 = r3551198 - r3551201;
double r3551203 = sqrt(r3551202);
double r3551204 = r3551196 - r3551203;
double r3551205 = a;
double r3551206 = r3551197 * r3551205;
double r3551207 = r3551204 / r3551206;
return r3551207;
}


double f(double b, double ac, double a) {
double r3551208 = b;
double r3551209 = -r3551208;
double r3551210 = 2.0;
double r3551211 = pow(r3551208, r3551210);
double r3551212 = 4.0;
double r3551213 = ac;
double r3551214 = r3551212 * r3551213;
double r3551215 = r3551211 - r3551214;
double r3551216 = sqrt(r3551215);
double r3551217 = r3551209 - r3551216;
double r3551218 = a;
double r3551219 = r3551210 * r3551218;
double r3551220 = r3551217 / r3551219;
return r3551220;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 4.9

$\frac{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}$
2. Final simplification4.9

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

# Reproduce

herbie shell --seed 1
(FPCore (b ac a)
:name "(-b-sqrt(b^2-4ac))/(2a)"
:precision binary32
:pre (and (> b 0.0) (>= (- (pow b 2) (* 4 ac)) 0.0))
(/ (- (- b) (sqrt (- (pow b 2) (* 4 ac)))) (* 2 a)))