\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 -2.730148424505267 \cdot 10^{+150}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} + \frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq -3.352581098106061 \cdot 10^{-289}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 7.484148894778323 \cdot 10^{+146}:\\
\;\;\;\;\frac{\frac{c}{b + \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)}}}{-1}\\
\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 -2.730148424505267e+150)
(+ (* 0.5 (/ c b)) (* (/ b a) -0.6666666666666666))
(if (<= b -3.352581098106061e-289)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 7.484148894778323e+146)
(/ (/ c (+ b (sqrt (- (* b b) (* 3.0 (* c a)))))) -1.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 <= -2.730148424505267e+150) {
tmp = (0.5 * (c / b)) + ((b / a) * -0.6666666666666666);
} else if (b <= -3.352581098106061e-289) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) - b) / (a * 3.0);
} else if (b <= 7.484148894778323e+146) {
tmp = (c / (b + sqrt((b * b) - (3.0 * (c * a))))) / -1.0;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -2.73014842450526683e150Initial program 62.1
Simplified62.1
Taylor expanded around -inf 2.6
Simplified2.6
if -2.73014842450526683e150 < b < -3.3525810981060608e-289Initial program 8.8
Simplified8.8
rmApplied *-un-lft-identity_binary648.8
if -3.3525810981060608e-289 < b < 7.48414889477832338e146Initial program 33.1
Simplified33.1
rmApplied associate-/r*_binary6433.1
Simplified33.1
rmApplied flip--_binary6433.1
Simplified15.9
Simplified15.9
rmApplied clear-num_binary6416.0
Simplified9.1
rmApplied div-inv_binary649.1
Simplified8.5
if 7.48414889477832338e146 < b Initial program 63.1
Simplified63.1
Taylor expanded around inf 1.8
Final simplification6.7
herbie shell --seed 2021174
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))