\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.23401914471045 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b_2}, -2 \cdot \frac{b_2}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt{b_2 \cdot b_2 - c \cdot a}\\
\mathbf{if}\;b_2 \leq 2.9407118485521444 \cdot 10^{-128}:\\
\;\;\;\;\frac{t_0 - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{c}{b_2} \cdot -0.5\\
\mathbf{if}\;b_2 \leq 1.547379492825384 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b_2 \leq 124431463817995.98:\\
\;\;\;\;\mathsf{fma}\left(t_0, \frac{1}{a}, -\frac{b_2}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}\\
\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.23401914471045e+152)
(fma 0.5 (/ c b_2) (* -2.0 (/ b_2 a)))
(let* ((t_0 (sqrt (- (* b_2 b_2) (* c a)))))
(if (<= b_2 2.9407118485521444e-128)
(/ (- t_0 b_2) a)
(let* ((t_1 (* (/ c b_2) -0.5)))
(if (<= b_2 1.547379492825384e-89)
t_1
(if (<= b_2 124431463817995.98)
(fma t_0 (/ 1.0 a) (- (/ b_2 a)))
t_1)))))))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.23401914471045e+152) {
tmp = fma(0.5, (c / b_2), (-2.0 * (b_2 / a)));
} else {
double t_0 = sqrt((b_2 * b_2) - (c * a));
double tmp_1;
if (b_2 <= 2.9407118485521444e-128) {
tmp_1 = (t_0 - b_2) / a;
} else {
double t_1 = (c / b_2) * -0.5;
double tmp_2;
if (b_2 <= 1.547379492825384e-89) {
tmp_2 = t_1;
} else if (b_2 <= 124431463817995.98) {
tmp_2 = fma(t_0, (1.0 / a), -(b_2 / a));
} else {
tmp_2 = t_1;
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
if b_2 < -2.2340191447104499e152Initial program 63.1
Simplified63.1
Taylor expanded in b_2 around -inf 2.5
Simplified2.5
if -2.2340191447104499e152 < b_2 < 2.94071184855214437e-128Initial program 10.6
Simplified10.6
Applied egg10.6
if 2.94071184855214437e-128 < b_2 < 1.5473794928253839e-89 or 124431463817995.984 < b_2 Initial program 53.8
Simplified53.8
Taylor expanded in b_2 around inf 8.5
if 1.5473794928253839e-89 < b_2 < 124431463817995.984Initial program 38.7
Simplified38.7
Applied egg38.7
Applied egg38.7
Applied egg39.1
Final simplification11.5
herbie shell --seed 2022125
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))