\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -2.0987659544316741 \cdot 10^{+148}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\
\mathbf{elif}\;b_2 \leq 1.2616642087724312 \cdot 10^{-272}:\\
\;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\
\mathbf{elif}\;b_2 \leq 2.2347560056365885 \cdot 10^{+106}:\\
\;\;\;\;\frac{b_2}{-a} - \frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + \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 -2.0987659544316741e+148)
(* (/ c b_2) -0.5)
(if (<= b_2 1.2616642087724312e-272)
(/ c (- (sqrt (- (* b_2 b_2) (* c a))) b_2))
(if (<= b_2 2.2347560056365885e+106)
(- (/ b_2 (- a)) (/ (sqrt (- (* b_2 b_2) (* c a))) a))
(+ (* -2.0 (/ b_2 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 <= -2.0987659544316741e+148) {
tmp = (c / b_2) * -0.5;
} else if (b_2 <= 1.2616642087724312e-272) {
tmp = c / (sqrt((b_2 * b_2) - (c * a)) - b_2);
} else if (b_2 <= 2.2347560056365885e+106) {
tmp = (b_2 / -a) - (sqrt((b_2 * b_2) - (c * a)) / a);
} else {
tmp = (-2.0 * (b_2 / a)) + ((c / b_2) * 0.5);
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -2.09876595443167415e148Initial program 63.8
rmApplied div-sub_binary6463.8
Simplified63.8
Taylor expanded around -inf 1.9
Simplified1.9
if -2.09876595443167415e148 < b_2 < 1.26166420877243118e-272Initial program 32.8
rmApplied flip--_binary6432.9
Simplified16.2
Simplified16.2
rmApplied *-un-lft-identity_binary6416.2
Applied *-un-lft-identity_binary6416.2
Applied times-frac_binary6416.2
Simplified16.2
Simplified8.8
if 1.26166420877243118e-272 < b_2 < 2.23475600563658851e106Initial program 8.1
rmApplied div-sub_binary648.1
Simplified8.1
if 2.23475600563658851e106 < b_2 Initial program 48.7
Taylor expanded around inf 3.8
Simplified3.8
Final simplification6.6
herbie shell --seed 2021096
(FPCore (a b_2 c)
:name "quad2m (problem 3.2.1, negative)"
:precision binary64
(/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))