\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\begin{array}{l}
\mathbf{if}\;b \leq 0.015588398575903462:\\
\;\;\;\;\frac{\frac{\left(b \cdot b - 4 \cdot \left(a \cdot c\right)\right) - b \cdot b}{b + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{3} \cdot {c}^{4}}{{b}^{7}} \cdot -5 - \left(\frac{c}{b} + \left(\frac{a \cdot {c}^{2}}{{b}^{3}} + 2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}}\right)\right)\\
\end{array}(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b 0.015588398575903462)
(/
(/
(- (- (* b b) (* 4.0 (* a c))) (* b b))
(+ b (sqrt (- (* b b) (* 4.0 (* a c))))))
(* a 2.0))
(-
(* (/ (* (pow a 3.0) (pow c 4.0)) (pow b 7.0)) -5.0)
(+
(/ c b)
(+
(/ (* a (pow c 2.0)) (pow b 3.0))
(* 2.0 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0))))))))double code(double a, double b, double c) {
return (-b + sqrt((b * b) - ((4.0 * a) * c))) / (2.0 * a);
}
double code(double a, double b, double c) {
double tmp;
if (b <= 0.015588398575903462) {
tmp = ((((b * b) - (4.0 * (a * c))) - (b * b)) / (b + sqrt((b * b) - (4.0 * (a * c))))) / (a * 2.0);
} else {
tmp = (((pow(a, 3.0) * pow(c, 4.0)) / pow(b, 7.0)) * -5.0) - ((c / b) + (((a * pow(c, 2.0)) / pow(b, 3.0)) + (2.0 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0)))));
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < 0.0155883985759034619Initial program 9.0
Simplified9.0
rmApplied flip--_binary648.8
Simplified8.0
Simplified8.0
if 0.0155883985759034619 < b Initial program 30.0
Simplified30.0
Taylor expanded around inf 4.9
Final simplification5.2
herbie shell --seed 2021139
(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.0 a) c)))) (* 2.0 a)))