\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 -4.153332913727811 \cdot 10^{+138}:\\
\;\;\;\;\frac{\frac{b \cdot -2}{3}}{a}\\
\mathbf{elif}\;b \leq 1.9180183270872948 \cdot 10^{-83}:\\
\;\;\;\;\frac{\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a}}{3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\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 -4.153332913727811e+138)
(/ (/ (* b -2.0) 3.0) a)
(if (<= b 1.9180183270872948e-83)
(/ (/ (- (sqrt (+ (* b b) (* c (* a -3.0)))) b) a) 3.0)
(* -0.5 (/ c b)))))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 <= -4.153332913727811e+138) {
tmp = ((b * -2.0) / 3.0) / a;
} else if (b <= 1.9180183270872948e-83) {
tmp = ((sqrt((b * b) + (c * (a * -3.0))) - b) / a) / 3.0;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -4.1533329137278107e138Initial program 57.5
rmApplied associate-/r*_binary6457.5
Simplified57.5
Taylor expanded around -inf 2.9
Simplified2.9
if -4.1533329137278107e138 < b < 1.9180183270872948e-83Initial program 12.4
rmApplied add-cube-cbrt_binary6413.3
Applied times-frac_binary6413.3
Applied associate-*l/_binary6413.3
Simplified12.5
rmApplied fma-udef_binary6412.5
if 1.9180183270872948e-83 < b Initial program 52.4
Taylor expanded around inf 9.6
Final simplification10.2
herbie shell --seed 2021211
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))