\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
t_0 := -a \cdot c\\
\mathbf{if}\;b_2 \leq -8.652110117963774 \cdot 10^{+151}:\\
\;\;\;\;\frac{-2 \cdot b_2}{a}\\
\mathbf{elif}\;b_2 \leq -2.650105651345541 \cdot 10^{-96}:\\
\;\;\;\;\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\
\mathbf{elif}\;b_2 \leq 2.0458807915557303 \cdot 10^{-221}:\\
\;\;\;\;\frac{\left(-b_2\right) + \mathsf{hypot}\left(b_2, \sqrt{t_0}\right)}{a}\\
\mathbf{elif}\;b_2 \leq 1.6819277248169715 \cdot 10^{-81}:\\
\;\;\;\;\left(\sqrt{\mathsf{fma}\left(b_2, b_2, t_0\right)} - b_2\right) \cdot \frac{1}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\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
(let* ((t_0 (- (* a c))))
(if (<= b_2 -8.652110117963774e+151)
(/ (* -2.0 b_2) a)
(if (<= b_2 -2.650105651345541e-96)
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a)
(if (<= b_2 2.0458807915557303e-221)
(/ (+ (- b_2) (hypot b_2 (sqrt t_0))) a)
(if (<= b_2 1.6819277248169715e-81)
(* (- (sqrt (fma b_2 b_2 t_0)) b_2) (/ 1.0 a))
(* -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 t_0 = -(a * c);
double tmp;
if (b_2 <= -8.652110117963774e+151) {
tmp = (-2.0 * b_2) / a;
} else if (b_2 <= -2.650105651345541e-96) {
tmp = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
} else if (b_2 <= 2.0458807915557303e-221) {
tmp = (-b_2 + hypot(b_2, sqrt(t_0))) / a;
} else if (b_2 <= 1.6819277248169715e-81) {
tmp = (sqrt(fma(b_2, b_2, t_0)) - b_2) * (1.0 / a);
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
if b_2 < -8.65211011796377423e151Initial program 63.4
Taylor expanded in b_2 around -inf 2.4
if -8.65211011796377423e151 < b_2 < -2.65010565134554118e-96Initial program 5.1
if -2.65010565134554118e-96 < b_2 < 2.04588079155573025e-221Initial program 14.5
Applied egg-rr13.4
if 2.04588079155573025e-221 < b_2 < 1.6819277248169715e-81Initial program 22.3
Applied egg-rr22.7
Applied egg-rr22.3
if 1.6819277248169715e-81 < b_2 Initial program 52.6
Taylor expanded in b_2 around inf 9.6
Final simplification9.8
herbie shell --seed 2022129
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))