\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -7.70031330541463201 \cdot 10^{138}:\\
\;\;\;\;1 \cdot \left(\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\right)\\
\mathbf{elif}\;b_2 \le 8.0203295214211515 \cdot 10^{-175}:\\
\;\;\;\;1 \cdot \frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\
\mathbf{elif}\;b_2 \le 42194588.455395833:\\
\;\;\;\;1 \cdot \frac{\frac{0 + a \cdot c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\frac{-1}{2} \cdot \frac{c}{b_2}\right)\\
\end{array}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 temp;
if ((b_2 <= -7.700313305414632e+138)) {
temp = (1.0 * ((0.5 * (c / b_2)) - (2.0 * (b_2 / a))));
} else {
double temp_1;
if ((b_2 <= 8.020329521421151e-175)) {
temp_1 = (1.0 * ((-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a));
} else {
double temp_2;
if ((b_2 <= 42194588.45539583)) {
temp_2 = (1.0 * (((0.0 + (a * c)) / (-b_2 - sqrt(((b_2 * b_2) - (a * c))))) / a));
} else {
temp_2 = (1.0 * (-0.5 * (c / b_2)));
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -7.700313305414632e+138Initial program 57.3
rmApplied *-un-lft-identity57.3
Applied *-un-lft-identity57.3
Applied times-frac57.3
Simplified57.3
Taylor expanded around -inf 2.9
if -7.700313305414632e+138 < b_2 < 8.020329521421151e-175Initial program 10.4
rmApplied *-un-lft-identity10.4
Applied *-un-lft-identity10.4
Applied times-frac10.4
Simplified10.4
if 8.020329521421151e-175 < b_2 < 42194588.45539583Initial program 31.5
rmApplied *-un-lft-identity31.5
Applied *-un-lft-identity31.5
Applied times-frac31.5
Simplified31.5
rmApplied flip-+31.5
Simplified17.1
if 42194588.45539583 < b_2 Initial program 55.9
rmApplied *-un-lft-identity55.9
Applied *-un-lft-identity55.9
Applied times-frac55.9
Simplified55.9
Taylor expanded around inf 5.9
Final simplification9.0
herbie shell --seed 2020065 +o rules:numerics
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))