\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\begin{array}{l}
\mathbf{if}\;b \le -1.3324370156406744 \cdot 10^{154}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{{\left(-b\right)}^{3} - {\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}^{3}} \cdot \left(\left(-b\right) \cdot \left(-b\right) + \left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(-b\right) \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\end{array}\\
\mathbf{elif}\;b \le -2.6712931574782514 \cdot 10^{-254}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{c}{\frac{b}{a}} - 2 \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \le 5.8141352325258771 \cdot 10^{110}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(4, a \cdot c, 0\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\\
\end{array}\\
\mathbf{elif}\;b \ge 0.0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{c}{\frac{b}{a}} - 2 \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\
\end{array}double code(double a, double b, double c) {
double VAR;
if ((b >= 0.0)) {
VAR = ((2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c)))));
} else {
VAR = ((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
}
return VAR;
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -1.3324370156406744e+154)) {
double VAR_1;
if ((b >= 0.0)) {
VAR_1 = (((2.0 * c) / (pow(-b, 3.0) - pow(sqrt(((b * b) - ((4.0 * a) * c))), 3.0))) * ((-b * -b) + ((sqrt(((b * b) - ((4.0 * a) * c))) * sqrt(((b * b) - ((4.0 * a) * c)))) + (-b * sqrt(((b * b) - ((4.0 * a) * c)))))));
} else {
VAR_1 = (1.0 * ((c / b) - (b / a)));
}
VAR = VAR_1;
} else {
double VAR_2;
if ((b <= -2.6712931574782514e-254)) {
double VAR_3;
if ((b >= 0.0)) {
VAR_3 = ((2.0 * c) / ((2.0 * (c / (b / a))) - (2.0 * b)));
} else {
VAR_3 = ((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
}
VAR_2 = VAR_3;
} else {
double VAR_4;
if ((b <= 5.814135232525877e+110)) {
double VAR_5;
if ((b >= 0.0)) {
VAR_5 = ((2.0 * c) / (-b - sqrt(((b * b) - ((4.0 * a) * c)))));
} else {
VAR_5 = ((fma(4.0, (a * c), 0.0) / (-b - sqrt(((b * b) - ((4.0 * a) * c))))) / (2.0 * a));
}
VAR_4 = VAR_5;
} else {
double VAR_6;
if ((b >= 0.0)) {
VAR_6 = ((2.0 * c) / ((2.0 * (c / (b / a))) - (2.0 * b)));
} else {
VAR_6 = ((-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a));
}
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 < -1.3324370156406744e+154Initial program 64.0
Taylor expanded around -inf 10.8
Taylor expanded around 0 2.6
Simplified2.6
rmApplied flip3--2.6
Applied associate-/r/2.6
if -1.3324370156406744e+154 < b < -2.6712931574782514e-254 or 5.814135232525877e+110 < b Initial program 17.5
Taylor expanded around inf 7.2
rmApplied *-commutative7.2
Applied associate-/l*5.6
if -2.6712931574782514e-254 < b < 5.814135232525877e+110Initial program 8.7
rmApplied flip-+8.8
Simplified8.8
Final simplification6.4
herbie shell --seed 2020071 +o rules:numerics
(FPCore (a b c)
:name "jeff quadratic root 2"
:precision binary64
(if (>= b 0.0) (/ (* 2 c) (- (- b) (sqrt (- (* b b) (* (* 4 a) c))))) (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a))))