\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\begin{array}{l}
\mathbf{if}\;b \leq -3.5005804636134674 \cdot 10^{+108}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \leq 2.234284491165597 \cdot 10^{-207}:\\
\;\;\;\;\frac{1}{\frac{a}{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b} \cdot 2}\\
\mathbf{elif}\;b \leq 1.7437407699301904 \cdot 10^{-49}:\\
\;\;\;\;\frac{\frac{4 \cdot \left(c \cdot a\right)}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -1\\
\end{array}double code(double a, double b, double c) {
return (((double) (((double) -(b)) + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (4.0 * a)) * c)))))))) / ((double) (2.0 * a)));
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -3.5005804636134674e+108)) {
VAR = ((double) (1.0 * ((double) ((c / b) - (b / a)))));
} else {
double VAR_1;
if ((b <= 2.234284491165597e-207)) {
VAR_1 = (1.0 / ((double) ((a / ((double) (((double) sqrt(((double) (((double) (b * b)) - ((double) (4.0 * ((double) (c * a)))))))) - b))) * 2.0)));
} else {
double VAR_2;
if ((b <= 1.7437407699301904e-49)) {
VAR_2 = ((((double) (4.0 * ((double) (c * a)))) / ((double) (((double) -(b)) - ((double) sqrt(((double) (((double) (b * b)) - ((double) (4.0 * ((double) (c * a))))))))))) / ((double) (a * 2.0)));
} else {
VAR_2 = ((double) ((c / b) * -1.0));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -3.50058046361346737e108Initial program 48.6
Simplified48.6
Taylor expanded around -inf 3.0
Simplified3.0
if -3.50058046361346737e108 < b < 2.23428449116559687e-207Initial program 10.8
Simplified10.8
rmApplied clear-num10.9
Simplified10.9
if 2.23428449116559687e-207 < b < 1.74374076993019036e-49Initial program 24.0
rmApplied flip-+24.0
Simplified17.8
Simplified17.8
if 1.74374076993019036e-49 < b Initial program 54.4
Simplified54.4
Taylor expanded around inf 7.9
Final simplification9.4
herbie shell --seed 2020196
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))