\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\begin{array}{l}
\mathbf{if}\;b \le -5.57107022210947071 \cdot 10^{156}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\
\end{array}\\
\mathbf{elif}\;b \le 2.9914658520063943 \cdot 10^{-176}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\frac{\left(4 \cdot a\right) \cdot c}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\end{array}\\
\mathbf{elif}\;b \le 4.6787838706469509 \cdot 10^{107}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{\frac{\left({b}^{2} - {b}^{2}\right) + \left(4 \cdot a\right) \cdot c}{2}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\\
\end{array}double code(double a, double b, double c) {
double VAR;
if ((b >= 0.0)) {
VAR = ((-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
VAR = ((2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c)))));
}
return VAR;
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -5.571070222109471e+156)) {
double VAR_1;
if ((b >= 0.0)) {
VAR_1 = ((-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
VAR_1 = ((2.0 * c) / ((2.0 * ((a * c) / b)) - (2.0 * b)));
}
VAR = VAR_1;
} else {
double VAR_2;
if ((b <= 2.9914658520063943e-176)) {
double VAR_3;
if ((b >= 0.0)) {
VAR_3 = ((((4.0 * a) * c) / (sqrt(((b * b) - ((4.0 * a) * c))) - b)) / (2.0 * a));
} else {
VAR_3 = ((2.0 * c) / (-b + sqrt(((b * b) - ((4.0 * a) * c)))));
}
VAR_2 = VAR_3;
} else {
double VAR_4;
if ((b <= 4.678783870646951e+107)) {
double VAR_5;
if ((b >= 0.0)) {
VAR_5 = ((-b - sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
} else {
VAR_5 = ((2.0 * c) / ((2.0 * ((a * c) / b)) - (2.0 * b)));
}
VAR_4 = VAR_5;
} else {
double VAR_6;
if ((b >= 0.0)) {
VAR_6 = (1.0 * ((c / b) - (b / a)));
} else {
VAR_6 = ((c / (((pow(b, 2.0) - pow(b, 2.0)) + ((4.0 * a) * c)) / 2.0)) * (-b - sqrt(((b * b) - ((4.0 * a) * c)))));
}
VAR_4 = VAR_6;
}
VAR_2 = VAR_4;
}
VAR = VAR_2;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -5.571070222109471e+156 or 2.9914658520063943e-176 < b < 4.678783870646951e+107Initial program 20.8
Taylor expanded around -inf 6.5
if -5.571070222109471e+156 < b < 2.9914658520063943e-176Initial program 9.8
rmApplied flip--10.0
Simplified10.0
Simplified10.0
if 4.678783870646951e+107 < b Initial program 47.5
Taylor expanded around inf 10.6
Taylor expanded around 0 4.2
Simplified4.2
rmApplied flip-+4.2
Applied associate-/r/4.2
Simplified4.2
Final simplification7.8
herbie shell --seed 2020075
(FPCore (a b c)
:name "jeff quadratic root 1"
:precision binary64
(if (>= b 0.0) (/ (- (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) (/ (* 2 c) (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))))))