\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{\frac{c}{2 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}{\frac{1}{4}}double f(double a, double b, double c) {
double r40952 = b;
double r40953 = -r40952;
double r40954 = r40952 * r40952;
double r40955 = 4.0;
double r40956 = a;
double r40957 = r40955 * r40956;
double r40958 = c;
double r40959 = r40957 * r40958;
double r40960 = r40954 - r40959;
double r40961 = sqrt(r40960);
double r40962 = r40953 + r40961;
double r40963 = 2.0;
double r40964 = r40963 * r40956;
double r40965 = r40962 / r40964;
return r40965;
}
double f(double a, double b, double c) {
double r40966 = c;
double r40967 = 2.0;
double r40968 = b;
double r40969 = -r40968;
double r40970 = r40968 * r40968;
double r40971 = 4.0;
double r40972 = a;
double r40973 = r40971 * r40972;
double r40974 = r40973 * r40966;
double r40975 = r40970 - r40974;
double r40976 = sqrt(r40975);
double r40977 = r40969 - r40976;
double r40978 = r40967 * r40977;
double r40979 = r40966 / r40978;
double r40980 = 1.0;
double r40981 = r40980 / r40971;
double r40982 = r40979 / r40981;
return r40982;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 44.1
rmApplied flip-+44.1
Simplified0.4
rmApplied div-inv0.5
Applied associate-/l*0.5
Simplified0.4
rmApplied *-un-lft-identity0.4
Applied times-frac0.4
Simplified0.4
rmApplied pow10.4
Applied pow10.4
Applied pow-prod-down0.4
Simplified0.2
Final simplification0.2
herbie shell --seed 2019326 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, medium range"
:precision binary64
:pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))