\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.3450496563396583 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq 4.525283768938065 \cdot 10^{-198}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 2.7099763392697605 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{-c \cdot a}{a}}{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 -1.3450496563396583e+154)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 4.525283768938065e-198)
(/ (- (sqrt (- (* b_2 b_2) (* c a))) b_2) a)
(if (<= b_2 2.7099763392697605e+106)
(/ (/ (- (* c a)) a) (+ 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 <= -1.3450496563396583e+154) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= 4.525283768938065e-198) {
tmp = (sqrt((b_2 * b_2) - (c * a)) - b_2) / a;
} else if (b_2 <= 2.7099763392697605e+106) {
tmp = (-(c * a) / a) / (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 < -1.34504965633965828e154Initial program 64.0
Simplified64.0
Taylor expanded around -inf 2.0
if -1.34504965633965828e154 < b_2 < 4.525283768938065e-198Initial program 10.4
Simplified10.4
if 4.525283768938065e-198 < b_2 < 2.7099763392697605e106Initial program 36.7
Simplified36.7
rmApplied div-inv_binary6436.7
rmApplied flip--_binary6436.7
Applied associate-*l/_binary6436.8
Simplified14.5
if 2.7099763392697605e106 < b_2 Initial program 60.2
Simplified60.2
Taylor expanded around inf 2.5
Final simplification8.7
herbie shell --seed 2020288
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))