\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.3217401295489042 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(1.5 \cdot \frac{a \cdot c}{b} - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2.0737225518150114 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3.4989832974040957 \cdot 10^{+108}:\\
\;\;\;\;\frac{\frac{-c \cdot \left(a \cdot 3\right)}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1.5 \cdot \frac{a \cdot c}{b}}{a \cdot 3}\\
\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.3217401295489042e+154)
(/ (- (- (* 1.5 (/ (* a c) b)) b) b) (* a 3.0))
(if (<= b 2.0737225518150114e-113)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 3.4989832974040957e+108)
(/
(/ (- (* c (* a 3.0))) (+ b (sqrt (- (* b b) (* c (* a 3.0))))))
(* a 3.0))
(/ (- (* 1.5 (/ (* a c) b))) (* a 3.0))))))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.3217401295489042e+154)) {
tmp = (((double) (((double) (((double) (1.5 * (((double) (a * c)) / b))) - b)) - b)) / ((double) (a * 3.0)));
} else {
double tmp_1;
if ((b <= 2.0737225518150114e-113)) {
tmp_1 = (((double) (((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 3.0)))))))) - b)) / ((double) (a * 3.0)));
} else {
double tmp_2;
if ((b <= 3.4989832974040957e+108)) {
tmp_2 = ((((double) -(((double) (c * ((double) (a * 3.0)))))) / ((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 3.0))))))))))) / ((double) (a * 3.0)));
} else {
tmp_2 = (((double) -(((double) (1.5 * (((double) (a * c)) / b))))) / ((double) (a * 3.0)));
}
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.3217401295489042e154Initial program 64.0
Simplified64.0
Taylor expanded around -inf 10.8
if -1.3217401295489042e154 < b < 2.0737225518150114e-113Initial program 11.4
Simplified11.4
if 2.0737225518150114e-113 < b < 3.4989832974040957e108Initial program 40.7
Simplified40.7
rmApplied flip--_binary6440.8
Simplified16.5
Simplified16.5
if 3.4989832974040957e108 < b Initial program 60.0
Simplified60.0
Taylor expanded around inf 14.6
Final simplification13.0
herbie shell --seed 2020204
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))