\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.212113506128886 \cdot 10^{+52}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq -1.566285583643343 \cdot 10^{-266}:\\
\;\;\;\;\frac{1}{\frac{3}{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a}}}\\
\mathbf{elif}\;b \leq 7.178750185064038 \cdot 10^{+92}:\\
\;\;\;\;\frac{c}{\left(-b\right) - \sqrt{b \cdot b + a \cdot \left(c \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.212113506128886e+52)
(- (* 0.5 (/ c b)) (* 0.6666666666666666 (/ b a)))
(if (<= b -1.566285583643343e-266)
(/ 1.0 (/ 3.0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) a)))
(if (<= b 7.178750185064038e+92)
(/ c (- (- b) (sqrt (+ (* b b) (* a (* c -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.212113506128886e+52) {
tmp = (0.5 * (c / b)) - (0.6666666666666666 * (b / a));
} else if (b <= -1.566285583643343e-266) {
tmp = 1.0 / (3.0 / ((sqrt((b * b) - (c * (a * 3.0))) - b) / a));
} else if (b <= 7.178750185064038e+92) {
tmp = c / (-b - sqrt((b * b) + (a * (c * -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.21211350612888562e52Initial program 38.4
Taylor expanded around -inf 6.7
if -5.21211350612888562e52 < b < -1.5662855836433431e-266Initial program 9.6
rmApplied clear-num_binary64_17989.8
Simplified9.8
if -1.5662855836433431e-266 < b < 7.178750185064038e92Initial program 30.5
rmApplied flip-+_binary64_177330.6
Simplified16.3
rmApplied clear-num_binary64_179816.5
Simplified9.4
rmApplied add-sqr-sqrt_binary64_18219.4
Applied times-frac_binary64_18059.4
Simplified9.4
Simplified9.0
rmApplied sub-neg_binary64_17929.0
Simplified9.0
if 7.178750185064038e92 < b Initial program 59.3
Taylor expanded around inf 3.1
Final simplification7.3
herbie shell --seed 2020289
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))