\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -9.156580055033079 \cdot 10^{+151}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq 4.664337940942095 \cdot 10^{-142}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a} - \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.350743022224145 \cdot 10^{-69}:\\
\;\;\;\;\frac{-\frac{c}{a}}{\frac{b_2}{a} + \frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a}}\\
\mathbf{elif}\;b_2 \leq 5.38924907603627 \cdot 10^{+103}:\\
\;\;\;\;\frac{\frac{-c \cdot a}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}}}{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 -9.156580055033079e+151)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 4.664337940942095e-142)
(- (/ (sqrt (- (* b_2 b_2) (* c a))) a) (/ b_2 a))
(if (<= b_2 1.350743022224145e-69)
(/ (- (/ c a)) (+ (/ b_2 a) (/ (sqrt (- (* b_2 b_2) (* c a))) a)))
(if (<= b_2 5.38924907603627e+103)
(/ (/ (- (* c a)) (+ b_2 (sqrt (- (* b_2 b_2) (* c a))))) 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 <= -9.156580055033079e+151) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= 4.664337940942095e-142) {
tmp = (sqrt((b_2 * b_2) - (c * a)) / a) - (b_2 / a);
} else if (b_2 <= 1.350743022224145e-69) {
tmp = -(c / a) / ((b_2 / a) + (sqrt((b_2 * b_2) - (c * a)) / a));
} else if (b_2 <= 5.38924907603627e+103) {
tmp = (-(c * a) / (b_2 + sqrt((b_2 * b_2) - (c * a)))) / 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 < -9.1565800550330794e151Initial program 63.2
Simplified63.2
Taylor expanded around -inf 2.3
if -9.1565800550330794e151 < b_2 < 4.664337940942095e-142Initial program 11.1
Simplified11.1
rmApplied div-sub_binary6411.1
if 4.664337940942095e-142 < b_2 < 1.3507430222241449e-69Initial program 27.8
Simplified27.8
rmApplied div-sub_binary6427.8
rmApplied flip--_binary6441.0
Simplified21.2
if 1.3507430222241449e-69 < b_2 < 5.38924907603627023e103Initial program 44.1
Simplified44.1
rmApplied flip--_binary6444.1
Simplified15.4
Simplified15.4
if 5.38924907603627023e103 < b_2 Initial program 60.1
Simplified60.1
Taylor expanded around inf 2.4
Final simplification9.2
herbie shell --seed 2020292
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))