\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.3421727427471946 \cdot 10^{+111}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \leq -2.8405866436241524 \cdot 10^{-198}:\\
\;\;\;\;\left(\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b\right) \cdot \frac{1}{a \cdot 2}\\
\mathbf{elif}\;b \leq 1.722862686819048 \cdot 10^{+59}:\\
\;\;\;\;\frac{4}{2} \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{4}{2} \cdot \frac{c}{c \cdot \frac{a \cdot 2}{b} + b \cdot -2}\\
\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.3421727427471946e+111)) {
VAR = ((double) (1.0 * ((double) ((c / b) - (b / a)))));
} else {
double VAR_1;
if ((b <= -2.8405866436241524e-198)) {
VAR_1 = ((double) (((double) (((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 4.0)))))))) - b)) * (1.0 / ((double) (a * 2.0)))));
} else {
double VAR_2;
if ((b <= 1.722862686819048e+59)) {
VAR_2 = ((double) ((4.0 / 2.0) * (c / ((double) (((double) -(b)) - ((double) sqrt(((double) (((double) (b * b)) - ((double) (4.0 * ((double) (c * a)))))))))))));
} else {
VAR_2 = ((double) ((4.0 / 2.0) * (c / ((double) (((double) (c * (((double) (a * 2.0)) / b))) + ((double) (b * -2.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.34217274274719463e111Initial program 51.0
Taylor expanded around -inf 3.0
Simplified3.0
if -3.34217274274719463e111 < b < -2.8405866436241524e-198Initial program 7.4
rmApplied div-inv7.5
Simplified7.5
if -2.8405866436241524e-198 < b < 1.72286268681904807e59Initial program 27.1
rmApplied flip-+27.2
Simplified16.8
Simplified16.8
rmApplied *-un-lft-identity16.8
Applied times-frac16.8
Applied times-frac16.8
Simplified16.8
Simplified10.4
if 1.72286268681904807e59 < b Initial program 57.9
rmApplied flip-+57.9
Simplified30.5
Simplified30.5
rmApplied *-un-lft-identity30.5
Applied times-frac30.5
Applied times-frac30.5
Simplified30.5
Simplified27.1
Taylor expanded around inf 8.0
Simplified3.9
Final simplification6.8
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)))