\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -3.552145154192115 \cdot 10^{+134}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq -8.744224435785807 \cdot 10^{-308}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.651464782087897 \cdot 10^{+98}:\\
\;\;\;\;-\frac{c}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\end{array}(FPCore (a b_2 c) :precision binary64 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -3.552145154192115e+134)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 -8.744224435785807e-308)
(/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) a)
(if (<= b_2 1.651464782087897e+98)
(- (/ c (+ b_2 (sqrt (- (* b_2 b_2) (* c a))))))
(* (/ c b_2) -0.5)))))double code(double a, double b_2, double c) {
return (-b_2 + sqrt((b_2 * b_2) - (a * c))) / a;
}
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -3.552145154192115e+134) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= -8.744224435785807e-308) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) / a;
} else if (b_2 <= 1.651464782087897e+98) {
tmp = -(c / (b_2 + sqrt((b_2 * b_2) - (c * a))));
} else {
tmp = (c / b_2) * -0.5;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -3.5521451541921152e134Initial program 57.1
Simplified57.1
Taylor expanded around -inf 2.7
if -3.5521451541921152e134 < b_2 < -8.7442244357858071e-308Initial program 9.0
if -8.7442244357858071e-308 < b_2 < 1.651464782087897e98Initial program 32.0
Simplified32.0
rmApplied flip--_binary6432.0
Simplified16.9
Simplified16.9
rmApplied distribute-frac-neg_binary6416.9
Applied distribute-frac-neg_binary6416.9
Simplified8.7
if 1.651464782087897e98 < b_2 Initial program 59.7
Simplified59.7
Taylor expanded around inf 2.2
Final simplification6.4
herbie shell --seed 2020349
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))