\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -3.2825768280390323 \cdot 10^{+153}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq -1.0770271972015288 \cdot 10^{-294}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.5027731307248138 \cdot 10^{+94}:\\
\;\;\;\;-\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.2825768280390323e+153)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 -1.0770271972015288e-294)
(/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) a)
(if (<= b_2 1.5027731307248138e+94)
(- (/ 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.2825768280390323e+153) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= -1.0770271972015288e-294) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) / a;
} else if (b_2 <= 1.5027731307248138e+94) {
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.2825768280390323e153Initial program 63.7
Simplified63.7
Taylor expanded around -inf 2.4
if -3.2825768280390323e153 < b_2 < -1.077027197201529e-294Initial program 9.0
Simplified9.0
if -1.077027197201529e-294 < b_2 < 1.5027731307248138e94Initial program 31.8
Simplified31.8
rmApplied flip--_binary6431.9
Simplified16.9
Simplified16.9
rmApplied distribute-frac-neg_binary6416.9
Applied distribute-frac-neg_binary6416.9
Simplified9.2
if 1.5027731307248138e94 < b_2 Initial program 58.3
Simplified58.3
Taylor expanded around inf 2.7
Final simplification6.8
herbie shell --seed 2020253
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))