\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.738191357919323 \cdot 10^{+116}:\\
\;\;\;\;\frac{-b}{a}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\\
\mathbf{if}\;b \leq 3.504400908400674 \cdot 10^{-178}:\\
\;\;\;\;\frac{\left(t_0 - b\right) \cdot 0.5}{a}\\
\mathbf{elif}\;b \leq 2.980663629993403 \cdot 10^{+79}:\\
\;\;\;\;\frac{\left(c \cdot \left(a \cdot -4\right)\right) \cdot \frac{0.5}{a}}{b + t_0}\\
\mathbf{else}:\\
\;\;\;\;-\frac{c}{b}\\
\end{array}\\
\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 -3.738191357919323e+116)
(/ (- b) a)
(let* ((t_0 (sqrt (fma a (* c -4.0) (* b b)))))
(if (<= b 3.504400908400674e-178)
(/ (* (- t_0 b) 0.5) a)
(if (<= b 2.980663629993403e+79)
(/ (* (* c (* a -4.0)) (/ 0.5 a)) (+ b t_0))
(- (/ 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 <= -3.738191357919323e+116) {
tmp = -b / a;
} else {
double t_0 = sqrt(fma(a, (c * -4.0), (b * b)));
double tmp_1;
if (b <= 3.504400908400674e-178) {
tmp_1 = ((t_0 - b) * 0.5) / a;
} else if (b <= 2.980663629993403e+79) {
tmp_1 = ((c * (a * -4.0)) * (0.5 / a)) / (b + t_0);
} else {
tmp_1 = -(c / b);
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
if b < -3.7381913579193229e116Initial program 51.5
Simplified51.5
Taylor expanded in b around -inf 4.2
Simplified4.2
if -3.7381913579193229e116 < b < 3.50440090840067388e-178Initial program 10.7
Simplified10.8
Applied associate-*r/_binary6410.7
Applied *-un-lft-identity_binary6410.7
Applied cancel-sign-sub-inv_binary6410.7
if 3.50440090840067388e-178 < b < 2.9806636299934028e79Initial program 35.4
Simplified35.4
Applied flip--_binary6435.4
Applied associate-*l/_binary6435.5
Simplified15.3
if 2.9806636299934028e79 < b Initial program 58.3
Simplified58.3
Taylor expanded in a around 0 3.0
Simplified3.0
Final simplification8.7
herbie shell --seed 2022019
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))