\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 -1.3667361231028956 \cdot 10^{+152}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\
\mathbf{elif}\;b \leq -7.59554765878054 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a \cdot 2} - \frac{b}{a \cdot 2}\\
\mathbf{elif}\;b \leq 1.1883717871229594 \cdot 10^{+34}:\\
\;\;\;\;\frac{\frac{a}{\sqrt{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}} \cdot \frac{c \cdot -4}{\sqrt{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;-\frac{c}{b}\\
\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 -1.3667361231028956e+152)
(- (/ c b) (/ b a))
(if (<= b -7.59554765878054e-309)
(- (/ (sqrt (- (* b b) (* c (* a 4.0)))) (* a 2.0)) (/ b (* a 2.0)))
(if (<= b 1.1883717871229594e+34)
(/
(*
(/ a (sqrt (+ b (sqrt (- (* b b) (* c (* a 4.0)))))))
(/ (* c -4.0) (sqrt (+ b (sqrt (- (* b b) (* c (* a 4.0))))))))
(* a 2.0))
(- (/ c b))))))double code(double a, double b, double c) {
return (((double) (((double) -(b)) + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (4.0 * a)) * c)))))))) / ((double) (2.0 * a)));
}
double code(double a, double b, double c) {
double tmp;
if ((b <= -1.3667361231028956e+152)) {
tmp = ((double) ((c / b) - (b / a)));
} else {
double tmp_1;
if ((b <= -7.59554765878054e-309)) {
tmp_1 = ((double) ((((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 4.0)))))))) / ((double) (a * 2.0))) - (b / ((double) (a * 2.0)))));
} else {
double tmp_2;
if ((b <= 1.1883717871229594e+34)) {
tmp_2 = (((double) ((a / ((double) sqrt(((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 4.0))))))))))))) * (((double) (c * -4.0)) / ((double) sqrt(((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 4.0))))))))))))))) / ((double) (a * 2.0)));
} else {
tmp_2 = ((double) -((c / b)));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.36673612310289565e152Initial program 63.4
Simplified63.4
Taylor expanded around -inf 2.3
if -1.36673612310289565e152 < b < -7.5955476587805401e-309Initial program 8.8
Simplified8.8
rmApplied div-sub_binary648.8
if -7.5955476587805401e-309 < b < 1.1883717871229594e34Initial program 27.8
Simplified27.8
rmApplied flip--_binary6427.9
Simplified17.4
Simplified17.4
rmApplied add-sqr-sqrt_binary6417.6
Applied times-frac_binary6414.9
if 1.1883717871229594e34 < b Initial program 56.6
Simplified56.6
Taylor expanded around inf 4.6
Simplified4.6
Final simplification8.2
herbie shell --seed 2020219
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))