\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 -1.3740666575718133 \cdot 10^{+149}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq -4.511854892223982 \cdot 10^{-306}:\\
\;\;\;\;\frac{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{3}}{a}\\
\mathbf{elif}\;b \leq 2.7144293381871665 \cdot 10^{+129}:\\
\;\;\;\;-\frac{c}{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 -1.3740666575718133e+149)
(- (* (/ c b) 0.5) (* 0.6666666666666666 (/ b a)))
(if (<= b -4.511854892223982e-306)
(/ (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) 3.0) a)
(if (<= b 2.7144293381871665e+129)
(- (/ c (+ b (sqrt (- (* b b) (* c (* a 3.0)))))))
(* (/ c b) -0.5)))))double code(double a, double b, double c) {
return (((double) (((double) -(b)) + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (3.0 * a)) * c)))))))) / ((double) (3.0 * a)));
}
double code(double a, double b, double c) {
double tmp;
if ((b <= -1.3740666575718133e+149)) {
tmp = ((double) (((double) ((c / b) * 0.5)) - ((double) (0.6666666666666666 * (b / a)))));
} else {
double tmp_1;
if ((b <= -4.511854892223982e-306)) {
tmp_1 = ((((double) (((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 3.0)))))))) - b)) / 3.0) / a);
} else {
double tmp_2;
if ((b <= 2.7144293381871665e+129)) {
tmp_2 = ((double) -((c / ((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 3.0)))))))))))));
} else {
tmp_2 = ((double) ((c / b) * -0.5));
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.3740666575718133e149Initial program 61.9
Simplified61.9
Taylor expanded around -inf 3.2
Simplified3.2
if -1.3740666575718133e149 < b < -4.51185489222398209e-306Initial program 8.5
Simplified8.5
rmApplied associate-/r*_binary648.5
if -4.51185489222398209e-306 < b < 2.7144293381871665e129Initial program 33.9
Simplified33.9
rmApplied flip--_binary6433.9
Simplified16.3
Simplified16.3
rmApplied distribute-frac-neg_binary6416.3
Applied distribute-frac-neg_binary6416.3
Simplified8.4
if 2.7144293381871665e129 < b Initial program 61.7
Simplified61.7
Taylor expanded around inf 2.4
Final simplification6.6
herbie shell --seed 2020210
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))