\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \le -1.7729369216517423 \cdot 10^{+64}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - \frac{b_2}{a} \cdot 2\\
\mathbf{elif}\;b_2 \le 9.831724396970673 \cdot 10^{-110}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot \frac{-1}{2}\\
\end{array}double f(double a, double b_2, double c) {
double r458137 = b_2;
double r458138 = -r458137;
double r458139 = r458137 * r458137;
double r458140 = a;
double r458141 = c;
double r458142 = r458140 * r458141;
double r458143 = r458139 - r458142;
double r458144 = sqrt(r458143);
double r458145 = r458138 + r458144;
double r458146 = r458145 / r458140;
return r458146;
}
double f(double a, double b_2, double c) {
double r458147 = b_2;
double r458148 = -1.7729369216517423e+64;
bool r458149 = r458147 <= r458148;
double r458150 = 0.5;
double r458151 = c;
double r458152 = r458151 / r458147;
double r458153 = r458150 * r458152;
double r458154 = a;
double r458155 = r458147 / r458154;
double r458156 = 2.0;
double r458157 = r458155 * r458156;
double r458158 = r458153 - r458157;
double r458159 = 9.831724396970673e-110;
bool r458160 = r458147 <= r458159;
double r458161 = r458147 * r458147;
double r458162 = r458151 * r458154;
double r458163 = r458161 - r458162;
double r458164 = sqrt(r458163);
double r458165 = r458164 - r458147;
double r458166 = r458165 / r458154;
double r458167 = -0.5;
double r458168 = r458152 * r458167;
double r458169 = r458160 ? r458166 : r458168;
double r458170 = r458149 ? r458158 : r458169;
return r458170;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.7729369216517423e+64Initial program 37.7
Simplified37.7
Taylor expanded around -inf 37.7
Simplified37.7
Taylor expanded around -inf 5.2
if -1.7729369216517423e+64 < b_2 < 9.831724396970673e-110Initial program 12.0
Simplified12.0
Taylor expanded around -inf 12.0
Simplified12.0
if 9.831724396970673e-110 < b_2 Initial program 50.9
Simplified50.9
Taylor expanded around -inf 50.9
Simplified50.9
Taylor expanded around inf 10.8
Final simplification10.3
herbie shell --seed 2019138
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))