\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 -2.0801679587946785 \cdot 10^{+111}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \leq -8.299193755122384 \cdot 10^{-299}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\mathbf{elif}\;b \leq 2.425599302719474 \cdot 10^{+102}:\\
\;\;\;\;\left(-4\right) \cdot \frac{\frac{c}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -1\\
\end{array}(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b -2.0801679587946785e+111)
(* 1.0 (- (/ c b) (/ b a)))
(if (<= b -8.299193755122384e-299)
(/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
(if (<= b 2.425599302719474e+102)
(* (- 4.0) (/ (/ c (+ b (sqrt (- (* b b) (* c (* a 4.0)))))) 2.0))
(* (/ c b) -1.0)))))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 tmp;
if ((b <= -2.0801679587946785e+111)) {
tmp = ((double) (1.0 * ((double) ((c / b) - (b / a)))));
} else {
double tmp_1;
if ((b <= -8.299193755122384e-299)) {
tmp_1 = (((double) (((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 4.0)))))))) - b)) / ((double) (a * 2.0)));
} else {
double tmp_2;
if ((b <= 2.425599302719474e+102)) {
tmp_2 = ((double) (((double) -(4.0)) * ((c / ((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 4.0))))))))))) / 2.0)));
} else {
tmp_2 = ((double) ((c / b) * -1.0));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -2.08016795879467846e111Initial program 49.5
Simplified49.5
Taylor expanded around -inf 3.4
Simplified3.4
if -2.08016795879467846e111 < b < -8.29919375512238394e-299Initial program 8.9
Simplified8.9
if -8.29919375512238394e-299 < b < 2.42559930271947385e102Initial program 31.7
Simplified31.7
rmApplied flip--_binary6431.7
Simplified15.8
Simplified15.8
rmApplied *-un-lft-identity_binary6415.8
Applied distribute-lft-neg-in_binary6415.8
Applied times-frac_binary6413.2
Applied times-frac_binary648.6
Simplified8.6
if 2.42559930271947385e102 < b Initial program 59.9
Simplified59.9
Taylor expanded around inf 2.3
Final simplification6.4
herbie shell --seed 2020205
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))