\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.1639527502413392 \cdot 10^{+40}:\\
\;\;\;\;0.5 \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\
\mathbf{elif}\;b_2 \leq -7.947315750646704 \cdot 10^{-83}:\\
\;\;\;\;\frac{\sqrt{\sqrt{b_2 \cdot b_2 - c \cdot a}} \cdot \sqrt{\sqrt{b_2 \cdot b_2 - c \cdot a}} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.696534500200679 \cdot 10^{+77}:\\
\;\;\;\;\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 -1.1639527502413392e+40)
(- (* 0.5 (/ c b_2)) (* 2.0 (/ b_2 a)))
(if (<= b_2 -7.947315750646704e-83)
(/
(-
(*
(sqrt (sqrt (- (* b_2 b_2) (* c a))))
(sqrt (sqrt (- (* b_2 b_2) (* c a)))))
b_2)
a)
(if (<= b_2 1.696534500200679e+77)
(/ (- 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 <= -1.1639527502413392e+40) {
tmp = (0.5 * (c / b_2)) - (2.0 * (b_2 / a));
} else if (b_2 <= -7.947315750646704e-83) {
tmp = ((sqrt(sqrt((b_2 * b_2) - (c * a))) * sqrt(sqrt((b_2 * b_2) - (c * a)))) - b_2) / a;
} else if (b_2 <= 1.696534500200679e+77) {
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 < -1.16395275024133921e40Initial program 37.4
Simplified37.4
Taylor expanded around -inf 6.0
if -1.16395275024133921e40 < b_2 < -7.94731575064670391e-83Initial program 4.9
Simplified4.9
rmApplied add-sqr-sqrt_binary645.1
if -7.94731575064670391e-83 < b_2 < 1.6965345002006789e77Initial program 24.5
Simplified24.5
rmApplied flip--_binary6427.0
Simplified16.8
Simplified16.8
rmApplied *-un-lft-identity_binary6416.8
Applied *-un-lft-identity_binary6416.8
Applied *-un-lft-identity_binary6416.8
Applied times-frac_binary6416.8
Applied times-frac_binary6416.8
Simplified16.8
Simplified11.9
if 1.6965345002006789e77 < b_2 Initial program 58.4
Simplified58.4
Taylor expanded around inf 2.9
Final simplification7.7
herbie shell --seed 2020270
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))