\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{\frac{4 \cdot \left(a \cdot c\right)}{2 \cdot a}}{-\left(b + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}double f(double a, double b, double c) {
double r36325 = b;
double r36326 = -r36325;
double r36327 = r36325 * r36325;
double r36328 = 4.0;
double r36329 = a;
double r36330 = r36328 * r36329;
double r36331 = c;
double r36332 = r36330 * r36331;
double r36333 = r36327 - r36332;
double r36334 = sqrt(r36333);
double r36335 = r36326 + r36334;
double r36336 = 2.0;
double r36337 = r36336 * r36329;
double r36338 = r36335 / r36337;
return r36338;
}
double f(double a, double b, double c) {
double r36339 = 4.0;
double r36340 = a;
double r36341 = c;
double r36342 = r36340 * r36341;
double r36343 = r36339 * r36342;
double r36344 = 2.0;
double r36345 = r36344 * r36340;
double r36346 = r36343 / r36345;
double r36347 = b;
double r36348 = r36347 * r36347;
double r36349 = r36339 * r36340;
double r36350 = r36349 * r36341;
double r36351 = r36348 - r36350;
double r36352 = sqrt(r36351);
double r36353 = r36347 + r36352;
double r36354 = -r36353;
double r36355 = r36346 / r36354;
return r36355;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 52.5
rmApplied flip-+52.5
Simplified0.4
rmApplied div-inv0.4
Applied associate-/l*0.5
Simplified0.4
rmApplied sub-neg0.4
Applied distribute-lft-in0.4
Simplified0.4
Simplified0.4
rmApplied distribute-rgt-out0.4
Applied associate-/r*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020043
(FPCore (a b c)
:name "Quadratic roots, wide range"
:precision binary64
:pre (and (< 4.9303800000000003e-32 a 2.02824e+31) (< 4.9303800000000003e-32 b 2.02824e+31) (< 4.9303800000000003e-32 c 2.02824e+31))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))