\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -4.0639773095563594 \cdot 10^{+117}:\\
\;\;\;\;\left(\sqrt[3]{0.5} \cdot \sqrt[3]{0.5}\right) \cdot \left(\sqrt[3]{0.5} \cdot \frac{c}{b_2}\right) + -2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq 4.75264682550615 \cdot 10^{-107}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a} - \frac{b_2}{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 -4.0639773095563594e+117)
(+
(* (* (cbrt 0.5) (cbrt 0.5)) (* (cbrt 0.5) (/ c b_2)))
(* -2.0 (/ b_2 a)))
(if (<= b_2 4.75264682550615e-107)
(- (/ (sqrt (- (* b_2 b_2) (* c a))) a) (/ b_2 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 <= -4.0639773095563594e+117) {
tmp = ((cbrt(0.5) * cbrt(0.5)) * (cbrt(0.5) * (c / b_2))) + (-2.0 * (b_2 / a));
} else if (b_2 <= 4.75264682550615e-107) {
tmp = (sqrt((b_2 * b_2) - (c * a)) / a) - (b_2 / 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 < -4.0639773095563594e117Initial program 50.7
Simplified50.7
Taylor expanded around -inf 2.7
Simplified2.7
rmApplied add-cube-cbrt_binary642.7
Applied associate-*l*_binary642.7
Simplified2.7
if -4.0639773095563594e117 < b_2 < 4.75264682550615004e-107Initial program 11.6
Simplified11.6
rmApplied div-sub_binary6411.6
if 4.75264682550615004e-107 < b_2 Initial program 52.4
Simplified52.4
Taylor expanded around inf 10.4
Final simplification9.8
herbie shell --seed 2021173
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))