\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.4839011960233026 \cdot 10^{+51}:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{c}{\frac{b_2}{a}} - b_2\right) - b_2}{a}\\
\mathbf{elif}\;b_2 \leq -7.399951737087807 \cdot 10^{-272}:\\
\;\;\;\;\left(\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;b_2 \leq 7.171533889314125 \cdot 10^{+60}:\\
\;\;\;\;-\frac{c}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\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 -2.4839011960233026e+51)
(/ (- (- (* 0.5 (/ c (/ b_2 a))) b_2) b_2) a)
(if (<= b_2 -7.399951737087807e-272)
(* (- (sqrt (- (* b_2 b_2) (* c a))) b_2) (/ 1.0 a))
(if (<= b_2 7.171533889314125e+60)
(- (/ c (+ b_2 (sqrt (- (* b_2 b_2) (* c a))))))
(* -0.5 (/ c b_2))))))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 <= -2.4839011960233026e+51) {
tmp = (((0.5 * (c / (b_2 / a))) - b_2) - b_2) / a;
} else if (b_2 <= -7.399951737087807e-272) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) * (1.0 / a);
} else if (b_2 <= 7.171533889314125e+60) {
tmp = -(c / (b_2 + sqrt((b_2 * b_2) - (c * a))));
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -2.4839011960233026e51Initial program 38.4
Simplified38.4
Taylor expanded around -inf 10.2
Simplified5.2
if -2.4839011960233026e51 < b_2 < -7.39995173708780702e-272Initial program 8.5
Simplified8.5
rmApplied div-inv_binary648.6
if -7.39995173708780702e-272 < b_2 < 7.17153388931412499e60Initial program 29.8
Simplified29.8
rmApplied flip--_binary6429.9
Simplified18.0
Simplified18.0
rmApplied distribute-frac-neg_binary6418.0
Applied distribute-frac-neg_binary6418.0
Simplified10.2
if 7.17153388931412499e60 < b_2 Initial program 57.7
Simplified57.7
Taylor expanded around inf 3.6
Final simplification7.0
herbie shell --seed 2020224
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))