\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{1}{2} \cdot \frac{4 \cdot a}{\frac{a}{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}double f(double a, double b, double c) {
double r82056 = b;
double r82057 = -r82056;
double r82058 = r82056 * r82056;
double r82059 = 4.0;
double r82060 = a;
double r82061 = r82059 * r82060;
double r82062 = c;
double r82063 = r82061 * r82062;
double r82064 = r82058 - r82063;
double r82065 = sqrt(r82064);
double r82066 = r82057 + r82065;
double r82067 = 2.0;
double r82068 = r82067 * r82060;
double r82069 = r82066 / r82068;
return r82069;
}
double f(double a, double b, double c) {
double r82070 = 1.0;
double r82071 = 2.0;
double r82072 = r82070 / r82071;
double r82073 = 4.0;
double r82074 = a;
double r82075 = r82073 * r82074;
double r82076 = c;
double r82077 = b;
double r82078 = -r82077;
double r82079 = r82077 * r82077;
double r82080 = r82075 * r82076;
double r82081 = r82079 - r82080;
double r82082 = sqrt(r82081);
double r82083 = r82078 - r82082;
double r82084 = r82076 / r82083;
double r82085 = r82074 / r82084;
double r82086 = r82075 / r82085;
double r82087 = r82072 * r82086;
return r82087;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 28.2
rmApplied flip-+28.2
Simplified0.4
rmApplied clear-num0.5
Simplified0.5
rmApplied *-un-lft-identity0.5
Applied times-frac0.4
Applied times-frac0.5
Applied associate-/r*0.4
Simplified0.4
rmApplied *-un-lft-identity0.4
Applied *-un-lft-identity0.4
Applied times-frac0.4
Applied *-un-lft-identity0.4
Applied times-frac0.4
Applied div-inv0.4
Applied *-un-lft-identity0.4
Applied times-frac0.4
Applied times-frac0.4
Simplified0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2019209 +o rules:numerics
(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)))