\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.05350087668616 \cdot 10^{+142}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq -3.0932591459060287 \cdot 10^{-302}:\\
\;\;\;\;\frac{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{3}}{a}\\
\mathbf{elif}\;b \leq 2.3119185569929864 \cdot 10^{+122}:\\
\;\;\;\;-\frac{c}{b + \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\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.05350087668616e+142)
(- (* (/ c b) 0.5) (* 0.6666666666666666 (/ b a)))
(if (<= b -3.0932591459060287e-302)
(/ (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) 3.0) a)
(if (<= b 2.3119185569929864e+122)
(- (/ c (+ b (sqrt (- (* b b) (* 3.0 (* c a)))))))
(* (/ 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 <= -5.05350087668616e+142)) {
tmp = ((double) (((double) ((c / b) * 0.5)) - ((double) (0.6666666666666666 * (b / a)))));
} else {
double tmp_1;
if ((b <= -3.0932591459060287e-302)) {
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.3119185569929864e+122)) {
tmp_2 = ((double) -((c / ((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (3.0 * ((double) (c * a)))))))))))));
} 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 < -5.05350087668616048e142Initial program 59.6
Simplified59.6
Taylor expanded around -inf 3.2
Simplified3.2
if -5.05350087668616048e142 < b < -3.09325914590602866e-302Initial program 8.5
Simplified8.5
rmApplied associate-/r*_binary648.5
if -3.09325914590602866e-302 < b < 2.3119185569929864e122Initial program 33.8
Simplified33.8
rmApplied flip--_binary6433.8
Simplified16.1
Simplified16.1
rmApplied distribute-frac-neg_binary6416.1
Applied distribute-frac-neg_binary6416.1
Simplified8.3
rmApplied associate-*l*_binary648.3
if 2.3119185569929864e122 < b Initial program 61.3
Simplified61.3
Taylor expanded around inf 2.2
Final simplification6.3
herbie shell --seed 2020205
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))