\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 -8.959285179359827 \cdot 10^{+136}:\\
\;\;\;\;\frac{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}{2 \cdot a}\\
\mathbf{elif}\;b \leq 1.1385720630965241 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{2 \cdot a}\\
\mathbf{elif}\;b \leq 1.435883796381114 \cdot 10^{+111}:\\
\;\;\;\;\frac{1}{\frac{0.5}{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{0.5}{\frac{c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}}\\
\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 -8.959285179359827e+136)
(/ (* 2.0 (- (/ (* a c) b) b)) (* 2.0 a))
(if (<= b 1.1385720630965241e-296)
(/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* 2.0 a))
(if (<= b 1.435883796381114e+111)
(/ 1.0 (/ 0.5 (/ c (- (- b) (sqrt (- (* b b) (* c (* a 4.0))))))))
(/ 1.0 (/ 0.5 (/ c (* 2.0 (- (/ (* a c) b) b)))))))))double code(double a, double b, double c) {
return (-b + sqrt((b * b) - ((4.0 * a) * c))) / (2.0 * a);
}
double code(double a, double b, double c) {
double tmp;
if (b <= -8.959285179359827e+136) {
tmp = (2.0 * (((a * c) / b) - b)) / (2.0 * a);
} else if (b <= 1.1385720630965241e-296) {
tmp = (sqrt((b * b) - (c * (a * 4.0))) - b) / (2.0 * a);
} else if (b <= 1.435883796381114e+111) {
tmp = 1.0 / (0.5 / (c / (-b - sqrt((b * b) - (c * (a * 4.0))))));
} else {
tmp = 1.0 / (0.5 / (c / (2.0 * (((a * c) / b) - b))));
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -8.9592851793598274e136Initial program 56.2
Taylor expanded around -inf 11.5
Simplified11.5
if -8.9592851793598274e136 < b < 1.1385720630965241e-296Initial program 9.5
if 1.1385720630965241e-296 < b < 1.43588379638111404e111Initial program 33.2
rmApplied flip-+_binary6433.3
Simplified15.7
rmApplied associate-/r*_binary6415.7
Simplified13.4
rmApplied clear-num_binary6413.6
Simplified8.3
if 1.43588379638111404e111 < b Initial program 60.9
rmApplied flip-+_binary6460.9
Simplified34.4
rmApplied associate-/r*_binary6434.4
Simplified34.2
rmApplied clear-num_binary6434.3
Simplified32.7
Taylor expanded around inf 8.2
Simplified8.2
Final simplification9.1
herbie shell --seed 2020273
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))