\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 -5.948493915058576 \cdot 10^{+108}:\\
\;\;\;\;1 \cdot \left(\frac{c}{b} - \frac{b}{a}\right)\\
\mathbf{elif}\;b \leq -2.6603754368549326 \cdot 10^{-241}:\\
\;\;\;\;\frac{1}{a} \cdot \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{2}\\
\mathbf{elif}\;b \leq 2.4801938863971876 \cdot 10^{+91}:\\
\;\;\;\;\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 -5.948493915058576e+108)
(* 1.0 (- (/ c b) (/ b a)))
(if (<= b -2.6603754368549326e-241)
(* (/ 1.0 a) (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) 2.0))
(if (<= b 2.4801938863971876e+91)
(* (- 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 <= -5.948493915058576e+108)) {
tmp = ((double) (1.0 * ((double) ((c / b) - (b / a)))));
} else {
double tmp_1;
if ((b <= -2.6603754368549326e-241)) {
tmp_1 = ((double) ((1.0 / a) * (((double) (((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 4.0)))))))) - b)) / 2.0)));
} else {
double tmp_2;
if ((b <= 2.4801938863971876e+91)) {
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 < -5.948493915058576e108Initial program 49.6
Simplified49.6
Taylor expanded around -inf 3.0
Simplified3.0
if -5.948493915058576e108 < b < -2.66037543685493258e-241Initial program 8.4
Simplified8.4
rmApplied *-un-lft-identity_binary648.4
Applied times-frac_binary648.6
if -2.66037543685493258e-241 < b < 2.4801938863971876e91Initial program 30.1
Simplified30.1
rmApplied flip--_binary6430.2
Simplified16.2
Simplified16.2
rmApplied *-un-lft-identity_binary6416.2
Applied distribute-lft-neg-in_binary6416.2
Applied times-frac_binary6413.9
Applied times-frac_binary649.5
Simplified9.5
if 2.4801938863971876e91 < b Initial program 59.2
Simplified59.2
Taylor expanded around inf 3.1
Final simplification6.7
herbie shell --seed 2020210
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))