\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.1065019085411032 \cdot 10^{+141}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq -2.9484258421575806 \cdot 10^{-255}:\\
\;\;\;\;\left(\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;b_2 \leq 1.1504443903175268 \cdot 10^{+115}:\\
\;\;\;\;-\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 -1.1065019085411032e+141)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 -2.9484258421575806e-255)
(* (- (sqrt (- (* b_2 b_2) (* c a))) b_2) (/ 1.0 a))
(if (<= b_2 1.1504443903175268e+115)
(- (/ 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 (((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 tmp;
if ((b_2 <= -1.1065019085411032e+141)) {
tmp = ((double) (((double) (0.5 * (c / b_2))) - ((double) (2.0 * (b_2 / a)))));
} else {
double tmp_1;
if ((b_2 <= -2.9484258421575806e-255)) {
tmp_1 = ((double) (((double) (((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))) - b_2)) * (1.0 / a)));
} else {
double tmp_2;
if ((b_2 <= 1.1504443903175268e+115)) {
tmp_2 = ((double) -((c / ((double) (b_2 + ((double) sqrt(((double) (((double) (b_2 * b_2)) - ((double) (c * a)))))))))));
} else {
tmp_2 = ((double) ((c / b_2) * -0.5));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.10650190854110324e141Initial program 59.3
Simplified59.3
Taylor expanded around -inf 2.1
if -1.10650190854110324e141 < b_2 < -2.9484258421575806e-255Initial program 8.1
Simplified8.1
rmApplied div-inv_binary648.3
if -2.9484258421575806e-255 < b_2 < 1.15044439031752677e115Initial program 31.5
Simplified31.5
rmApplied flip--_binary6431.6
Simplified15.8
Simplified15.8
rmApplied distribute-frac-neg_binary6415.8
Applied distribute-frac-neg_binary6415.8
Simplified8.4
if 1.15044439031752677e115 < b_2 Initial program 60.5
Simplified60.5
Taylor expanded around inf 2.5
Final simplification6.3
herbie shell --seed 2020210
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))