\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -7.085174189094956 \cdot 10^{+148}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq 3.5093565565557947 \cdot 10^{-308}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 3.263886109249808 \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 -7.085174189094956e+148)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 3.5093565565557947e-308)
(/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) a)
(if (<= b_2 3.263886109249808e+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 (-b_2 + sqrt((b_2 * b_2) - (a * c))) / a;
}
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -7.085174189094956e+148) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= 3.5093565565557947e-308) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) / a;
} else if (b_2 <= 3.263886109249808e+115) {
tmp = -c / (b_2 + sqrt((b_2 * b_2) - (c * a)));
} else {
tmp = (c / b_2) * -0.5;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -7.0851741890949556e148Initial program 62.0
Simplified62.0
Taylor expanded around -inf 1.4
if -7.0851741890949556e148 < b_2 < 3.5093565565557947e-308Initial program 8.8
if 3.5093565565557947e-308 < b_2 < 3.26388610924980808e115Initial program 32.3
Simplified32.3
rmApplied flip--_binary6432.3
Simplified16.1
Simplified16.1
rmApplied *-un-lft-identity_binary6416.1
Applied *-un-lft-identity_binary6416.1
Applied *-un-lft-identity_binary6416.1
Applied times-frac_binary6416.1
Applied times-frac_binary6416.1
Simplified16.1
Simplified8.7
if 3.26388610924980808e115 < b_2 Initial program 60.1
Simplified60.1
Taylor expanded around inf 2.1
Final simplification6.5
herbie shell --seed 2020356
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))