\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -4.3543135764255064 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b_2}, -2 \cdot \frac{b_2}{a}\right)\\
\mathbf{elif}\;b_2 \leq 3.021168818743586 \cdot 10^{-70}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, \frac{a}{b_2}, 2 \cdot \frac{b_2}{-c}\right)}\\
\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 -4.3543135764255064e+153)
(fma 0.5 (/ c b_2) (* -2.0 (/ b_2 a)))
(if (<= b_2 3.021168818743586e-70)
(/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) a)
(/ 1.0 (fma 0.5 (/ a b_2) (* 2.0 (/ b_2 (- c))))))))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 <= -4.3543135764255064e+153) {
tmp = fma(0.5, (c / b_2), (-2.0 * (b_2 / a)));
} else if (b_2 <= 3.021168818743586e-70) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) / a;
} else {
tmp = 1.0 / fma(0.5, (a / b_2), (2.0 * (b_2 / -c)));
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
if b_2 < -4.3543135764255064e153Initial program 63.8
Simplified63.8
Taylor expanded in b_2 around -inf 2.0
Simplified2.0
if -4.3543135764255064e153 < b_2 < 3.02116881874358578e-70Initial program 13.0
Simplified13.0
Applied *-un-lft-identity_binary6413.0
Applied associate-/r*_binary6413.0
if 3.02116881874358578e-70 < b_2 Initial program 53.5
Simplified53.5
Applied clear-num_binary6453.5
Simplified48.3
Taylor expanded in b_2 around inf 40.4
Simplified9.5
Final simplification10.4
herbie shell --seed 2021224
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))