\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.330798537410596 \cdot 10^{+154}:\\
\;\;\;\;\frac{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}{2 \cdot a}\\
\mathbf{elif}\;b \leq 9.437780463281094 \cdot 10^{-94}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{2 \cdot a}\\
\mathbf{elif}\;b \leq 7.001585617859764 \cdot 10^{+131}:\\
\;\;\;\;\frac{\frac{a \cdot \left(c \cdot -4\right)}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a \cdot c}{b} \cdot -2}{2 \cdot a}\\
\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.330798537410596e+154)
(/ (* 2.0 (- (/ (* a c) b) b)) (* 2.0 a))
(if (<= b 9.437780463281094e-94)
(/ (- (sqrt (+ (* b b) (* a (* c -4.0)))) b) (* 2.0 a))
(if (<= b 7.001585617859764e+131)
(/
(/ (* a (* c -4.0)) (+ b (sqrt (- (* b b) (* c (* a 4.0))))))
(* 2.0 a))
(/ (* (/ (* a c) b) -2.0) (* 2.0 a))))))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 <= -1.330798537410596e+154) {
tmp = (2.0 * (((a * c) / b) - b)) / (2.0 * a);
} else if (b <= 9.437780463281094e-94) {
tmp = (sqrt((b * b) + (a * (c * -4.0))) - b) / (2.0 * a);
} else if (b <= 7.001585617859764e+131) {
tmp = ((a * (c * -4.0)) / (b + sqrt((b * b) - (c * (a * 4.0))))) / (2.0 * a);
} else {
tmp = (((a * c) / b) * -2.0) / (2.0 * a);
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.33079853741059594e154Initial program 64.0
Simplified64.0
Taylor expanded around -inf 11.5
Simplified11.5
if -1.33079853741059594e154 < b < 9.4377804632810941e-94Initial program 11.8
Simplified11.8
rmApplied sub-neg_binary64_40711.8
Simplified11.9
if 9.4377804632810941e-94 < b < 7.0015856178597638e131Initial program 42.4
Simplified42.4
rmApplied flip--_binary64_38942.4
Simplified16.3
Simplified16.3
if 7.0015856178597638e131 < b Initial program 61.9
Simplified61.9
Taylor expanded around inf 15.2
Simplified15.2
Final simplification13.4
herbie shell --seed 2020303
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))