\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.560568612734722 \cdot 10^{+153}:\\
\;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\
\mathbf{elif}\;b \leq 2.0627980826047655 \cdot 10^{-71}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, b, \sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}\right)}{2 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;-\frac{c}{b}\\
\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.560568612734722e+153)
(/ (- (- b) b) (* 2.0 a))
(if (<= b 2.0627980826047655e-71)
(/ (fma -1.0 b (sqrt (- (* b b) (* (* a 4.0) c)))) (* 2.0 a))
(- (/ c 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 <= -5.560568612734722e+153) {
tmp = (-b - b) / (2.0 * a);
} else if (b <= 2.0627980826047655e-71) {
tmp = fma(-1.0, b, sqrt(((b * b) - ((a * 4.0) * c)))) / (2.0 * a);
} else {
tmp = -(c / b);
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
if b < -5.5605686127347219e153Initial program 63.9
Taylor expanded in b around -inf 2.7
Simplified2.7
if -5.5605686127347219e153 < b < 2.0627980826047655e-71Initial program 12.8
Applied neg-mul-1_binary6412.8
Applied fma-def_binary6412.8
if 2.0627980826047655e-71 < b Initial program 53.1
Taylor expanded in b around inf 9.8
Simplified9.8
Final simplification10.5
herbie shell --seed 2022125
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))