\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{1}{0.5 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)} \cdot cdouble f(double a, double b, double c) {
double r44648 = b;
double r44649 = -r44648;
double r44650 = r44648 * r44648;
double r44651 = 4.0;
double r44652 = a;
double r44653 = r44651 * r44652;
double r44654 = c;
double r44655 = r44653 * r44654;
double r44656 = r44650 - r44655;
double r44657 = sqrt(r44656);
double r44658 = r44649 + r44657;
double r44659 = 2.0;
double r44660 = r44659 * r44652;
double r44661 = r44658 / r44660;
return r44661;
}
double f(double a, double b, double c) {
double r44662 = 1.0;
double r44663 = 0.5;
double r44664 = b;
double r44665 = -r44664;
double r44666 = r44664 * r44664;
double r44667 = 4.0;
double r44668 = a;
double r44669 = r44667 * r44668;
double r44670 = c;
double r44671 = r44669 * r44670;
double r44672 = r44666 - r44671;
double r44673 = sqrt(r44672);
double r44674 = r44665 - r44673;
double r44675 = r44663 * r44674;
double r44676 = r44662 / r44675;
double r44677 = r44676 * r44670;
return r44677;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.3
rmApplied flip-+28.3
Simplified0.5
rmApplied *-un-lft-identity0.5
Applied *-un-lft-identity0.5
Applied times-frac0.5
Applied associate-/l*0.5
Simplified0.5
Taylor expanded around 0 0.5
rmApplied associate-*l/0.4
Applied associate-/r/0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020002 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, narrow range"
:precision binary64
:pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))