\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.4567324551787413 \cdot 10^{+135}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\
\mathbf{if}\;b_2 \leq -5.819383246893776 \cdot 10^{-242}:\\
\;\;\;\;\frac{t_0 - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 3.685097484787006 \cdot 10^{+117}:\\
\;\;\;\;\frac{-c}{b_2 + t_0}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\end{array}\\
\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 -2.4567324551787413e+135)
(/ (* b_2 -2.0) a)
(let* ((t_0 (sqrt (- (* b_2 b_2) (* a c)))))
(if (<= b_2 -5.819383246893776e-242)
(/ (- t_0 b_2) a)
(if (<= b_2 3.685097484787006e+117)
(/ (- c) (+ b_2 t_0))
(* -0.5 (/ c b_2)))))))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 <= -2.4567324551787413e+135) {
tmp = (b_2 * -2.0) / a;
} else {
double t_0 = sqrt((b_2 * b_2) - (a * c));
double tmp_1;
if (b_2 <= -5.819383246893776e-242) {
tmp_1 = (t_0 - b_2) / a;
} else if (b_2 <= 3.685097484787006e+117) {
tmp_1 = -c / (b_2 + t_0);
} else {
tmp_1 = -0.5 * (c / b_2);
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -2.4567324551787413e135Initial program 56.2
Simplified56.2
Taylor expanded around -inf 2.7
Simplified2.7
if -2.4567324551787413e135 < b_2 < -5.8193832468937762e-242Initial program 7.7
Simplified7.7
rmApplied *-un-lft-identity_binary647.7
Applied associate-/r*_binary647.7
if -5.8193832468937762e-242 < b_2 < 3.6850974847870061e117Initial program 30.1
Simplified30.1
rmApplied clear-num_binary6430.1
Simplified30.1
rmApplied flip--_binary6430.2
Applied associate-/r/_binary6430.2
Applied associate-/r*_binary6430.2
Simplified30.1
Taylor expanded around 0 9.3
Simplified9.3
if 3.6850974847870061e117 < b_2 Initial program 59.6
Simplified59.6
Taylor expanded around inf 2.4
Final simplification6.5
herbie shell --seed 2021198
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))