\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{c \cdot 4}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot 2}double f(double a, double b, double c) {
double r46410 = b;
double r46411 = -r46410;
double r46412 = r46410 * r46410;
double r46413 = 4.0;
double r46414 = a;
double r46415 = r46413 * r46414;
double r46416 = c;
double r46417 = r46415 * r46416;
double r46418 = r46412 - r46417;
double r46419 = sqrt(r46418);
double r46420 = r46411 + r46419;
double r46421 = 2.0;
double r46422 = r46421 * r46414;
double r46423 = r46420 / r46422;
return r46423;
}
double f(double a, double b, double c) {
double r46424 = c;
double r46425 = 4.0;
double r46426 = r46424 * r46425;
double r46427 = b;
double r46428 = -r46427;
double r46429 = r46427 * r46427;
double r46430 = a;
double r46431 = r46425 * r46430;
double r46432 = r46431 * r46424;
double r46433 = r46429 - r46432;
double r46434 = sqrt(r46433);
double r46435 = r46428 - r46434;
double r46436 = 2.0;
double r46437 = r46435 * r46436;
double r46438 = r46426 / r46437;
return r46438;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.5
rmApplied flip-+28.5
Simplified0.5
rmApplied div-inv0.5
Applied associate-/l*0.5
Simplified0.5
rmApplied associate-/r*0.3
Simplified0.3
rmApplied div-inv0.5
Applied associate-/l*0.5
Simplified0.5
Final simplification0.3
herbie shell --seed 2019303
(FPCore (a b c)
:name "Quadratic roots, narrow range"
:precision binary64
:pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))