\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -0.0008038623376922219:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq -2.762899027788645 \cdot 10^{-190}:\\
\;\;\;\;\left(\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;b_2 \leq 2.6131658992292902 \cdot 10^{+152}:\\
\;\;\;\;\frac{-c}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{0.5 \cdot \frac{a}{b_2} - 2 \cdot \frac{b_2}{c}}\\
\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 -0.0008038623376922219)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 -2.762899027788645e-190)
(* (- (sqrt (- (* b_2 b_2) (* c a))) b_2) (/ 1.0 a))
(if (<= b_2 2.6131658992292902e+152)
(/ (- c) (+ b_2 (sqrt (- (* b_2 b_2) (* c a)))))
(/ 1.0 (- (* 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 <= -0.0008038623376922219) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= -2.762899027788645e-190) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) * (1.0 / a);
} else if (b_2 <= 2.6131658992292902e+152) {
tmp = -c / (b_2 + sqrt((b_2 * b_2) - (c * a)));
} else {
tmp = 1.0 / ((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
Results
if b_2 < -8.0386233769222186e-4Initial program 31.4
Simplified31.4
Taylor expanded around -inf 7.8
if -8.0386233769222186e-4 < b_2 < -2.7628990277886451e-190Initial program 8.6
Simplified8.6
rmApplied div-inv_binary648.7
if -2.7628990277886451e-190 < b_2 < 2.61316589922929024e152Initial program 30.8
Simplified30.8
rmApplied flip--_binary6431.0
Simplified15.7
Simplified15.7
rmApplied *-un-lft-identity_binary6415.7
Applied *-un-lft-identity_binary6415.7
Applied *-un-lft-identity_binary6415.7
Applied times-frac_binary6415.7
Applied times-frac_binary6415.7
Simplified15.7
Simplified9.2
if 2.61316589922929024e152 < b_2 Initial program 63.6
Simplified63.6
rmApplied flip--_binary6463.6
Simplified37.4
Simplified37.4
rmApplied clear-num_binary6437.4
Simplified37.1
Taylor expanded around inf 2.1
Final simplification7.5
herbie shell --seed 2020275
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))