\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -9.156580055033079 \cdot 10^{+151}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.4844516945955604 \cdot 10^{-140}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 5.835011607741609 \cdot 10^{-124} \lor \neg \left(b_2 \leq 1.8362622646806402 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c \cdot a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}}{a}\\
\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 -9.156580055033079e+151)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 1.4844516945955604e-140)
(/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) a)
(if (or (<= b_2 5.835011607741609e-124)
(not (<= b_2 1.8362622646806402e+105)))
(* (/ c b_2) -0.5)
(/ (/ (* c a) (- (- b_2) (sqrt (- (* b_2 b_2) (* c a))))) a)))))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 <= -9.156580055033079e+151) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= 1.4844516945955604e-140) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) / a;
} else if ((b_2 <= 5.835011607741609e-124) || !(b_2 <= 1.8362622646806402e+105)) {
tmp = (c / b_2) * -0.5;
} else {
tmp = ((c * a) / (-b_2 - sqrt((b_2 * b_2) - (c * a)))) / a;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -9.1565800550330794e151Initial program 63.2
Taylor expanded around -inf 2.3
if -9.1565800550330794e151 < b_2 < 1.4844516945955604e-140Initial program 11.1
if 1.4844516945955604e-140 < b_2 < 5.835011607741609e-124 or 1.8362622646806402e105 < b_2 Initial program 58.6
Taylor expanded around inf 4.2
if 5.835011607741609e-124 < b_2 < 1.8362622646806402e105Initial program 41.4
rmApplied flip-+_binary6441.4
Simplified15.6
Final simplification9.3
herbie shell --seed 2020292
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))