\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.027360149222957 \cdot 10^{+147}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq -7.490208502750257 \cdot 10^{-179}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c}}{a \cdot 3} - \frac{b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2.4581016233270703 \cdot 10^{+134}:\\
\;\;\;\;\frac{-c}{b + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}\\
\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 -5.027360149222957e+147)
(* (/ b a) -0.6666666666666666)
(if (<= b -7.490208502750257e-179)
(- (/ (sqrt (- (* b b) (* (* a 3.0) c))) (* a 3.0)) (/ b (* a 3.0)))
(if (<= b 2.4581016233270703e+134)
(/ (- c) (+ b (sqrt (- (* b b) (* 3.0 (* a c))))))
(* -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 <= -5.027360149222957e+147) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= -7.490208502750257e-179) {
tmp = (sqrt((b * b) - ((a * 3.0) * c)) / (a * 3.0)) - (b / (a * 3.0));
} else if (b <= 2.4581016233270703e+134) {
tmp = -c / (b + sqrt((b * b) - (3.0 * (a * c))));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -5.02736014922295721e147Initial program 62.2
Simplified62.2
Taylor expanded around -inf 2.3
Simplified2.3
if -5.02736014922295721e147 < b < -7.4902085027502569e-179Initial program 7.1
Simplified7.1
rmApplied div-sub_binary647.1
if -7.4902085027502569e-179 < b < 2.4581016233270703e134Initial program 30.0
Simplified30.0
rmApplied div-inv_binary6430.1
Simplified30.1
rmApplied flip--_binary6430.3
Simplified16.6
Simplified16.6
rmApplied associate-*l/_binary6415.5
Simplified15.4
Taylor expanded around 0 10.1
if 2.4581016233270703e134 < b Initial program 62.2
Simplified62.2
Taylor expanded around inf 1.5
Final simplification6.7
herbie shell --seed 2021126
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))