\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\begin{array}{l}
\mathbf{if}\;b \leq -5.57038506551463 \cdot 10^{+71}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq -4.701392099071718 \cdot 10^{-290}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.482784977563538 \cdot 10^{+92}:\\
\;\;\;\;c \cdot \frac{-1}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b -5.57038506551463e+71)
(- (* 0.5 (/ c b)) (* 0.6666666666666666 (/ b a)))
(if (<= b -4.701392099071718e-290)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 1.482784977563538e+92)
(* c (/ -1.0 (+ b (sqrt (- (* b b) (* c (* a 3.0)))))))
(* (/ c b) -0.5)))))double code(double a, double b, double c) {
return (-b + sqrt((b * b) - ((3.0 * a) * c))) / (3.0 * a);
}
double code(double a, double b, double c) {
double tmp;
if (b <= -5.57038506551463e+71) {
tmp = (0.5 * (c / b)) - (0.6666666666666666 * (b / a));
} else if (b <= -4.701392099071718e-290) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) - b) / (a * 3.0);
} else if (b <= 1.482784977563538e+92) {
tmp = c * (-1.0 / (b + sqrt((b * b) - (c * (a * 3.0)))));
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -5.5703850655146297e71Initial program 41.3
Simplified41.3
Taylor expanded around -inf 5.5
if -5.5703850655146297e71 < b < -4.70139209907171802e-290Initial program 9.5
Simplified9.5
if -4.70139209907171802e-290 < b < 1.48278497756353789e92Initial program 32.0
Simplified32.0
rmApplied flip--_binary64_177432.0
Simplified16.8
Simplified16.8
rmApplied clear-num_binary64_179816.9
Simplified9.8
rmApplied associate-*r/_binary64_17419.7
Applied associate-/r/_binary64_17459.6
Simplified9.6
if 1.48278497756353789e92 < b Initial program 59.6
Simplified59.6
Taylor expanded around inf 2.6
Final simplification7.1
herbie shell --seed 2020277
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))