\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.0226793514904988 \cdot 10^{+71}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} + \frac{b_2}{a} \cdot -2\\
\mathbf{elif}\;b_2 \leq 5.740357605763107 \cdot 10^{-120}:\\
\;\;\;\;\left(\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2\right) \cdot \frac{1}{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 -1.0226793514904988e+71)
(+ (* 0.5 (/ c b_2)) (* (/ b_2 a) -2.0))
(if (<= b_2 5.740357605763107e-120)
(* (- (sqrt (- (* b_2 b_2) (* c a))) b_2) (/ 1.0 a))
(* (/ c b_2) -0.5))))double code(double a, double b_2, double c) {
return (((double) (((double) -(b_2)) + ((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (a * c)))))))) / a);
}
double code(double a, double b_2, double c) {
double VAR;
if ((b_2 <= -1.0226793514904988e+71)) {
VAR = ((double) (((double) (0.5 * (c / b_2))) + ((double) ((b_2 / a) * -2.0))));
} else {
double VAR_1;
if ((b_2 <= 5.740357605763107e-120)) {
VAR_1 = ((double) (((double) (((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))) - b_2)) * (1.0 / a)));
} else {
VAR_1 = ((double) ((c / b_2) * -0.5));
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.0226793514904988e71Initial program 41.4
Simplified41.4
rmApplied div-inv41.5
Taylor expanded around -inf 5.0
Simplified5.0
if -1.0226793514904988e71 < b_2 < 5.740357605763107e-120Initial program 12.4
Simplified12.4
rmApplied div-inv12.5
if 5.740357605763107e-120 < b_2 Initial program 51.6
Simplified51.6
Taylor expanded around inf 11.0
Final simplification10.5
herbie shell --seed 2020198
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))