\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.3306748570243904 \cdot 10^{+154}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -2.785220397969887 \cdot 10^{-291}:\\
\;\;\;\;\frac{\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3}}{a}\\
\mathbf{elif}\;b \leq 1.362728423927137 \cdot 10^{+124}:\\
\;\;\;\;\frac{\frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}}{\frac{\sqrt[3]{3}}{\frac{c \cdot -3}{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 -1.3306748570243904e+154)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -2.785220397969887e-291)
(/ (/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) 3.0) a)
(if (<= b 1.362728423927137e+124)
(/
(/ 1.0 (* (cbrt 3.0) (cbrt 3.0)))
(/ (cbrt 3.0) (/ (* c -3.0) (+ 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 <= -1.3306748570243904e+154) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -2.785220397969887e-291) {
tmp = ((sqrt((b * b) - ((3.0 * a) * c)) - b) / 3.0) / a;
} else if (b <= 1.362728423927137e+124) {
tmp = (1.0 / (cbrt(3.0) * cbrt(3.0))) / (cbrt(3.0) / ((c * -3.0) / (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 < -1.3306748570243904e154Initial program 64.0
Simplified64.0
Taylor expanded around -inf 3.2
Simplified3.2
if -1.3306748570243904e154 < b < -2.78522039796988684e-291Initial program 8.3
Simplified8.3
rmApplied associate-/r*_binary648.3
if -2.78522039796988684e-291 < b < 1.3627284239271371e124Initial program 32.5
Simplified32.5
rmApplied associate-/r*_binary6432.6
Simplified32.6
rmApplied flip--_binary6432.6
Simplified15.7
Simplified15.7
rmApplied add-cube-cbrt_binary6415.7
Applied *-un-lft-identity_binary6415.7
Applied times-frac_binary6415.8
Applied associate-/l*_binary6415.9
Simplified13.9
rmApplied associate-/r*_binary648.4
Simplified8.3
if 1.3627284239271371e124 < b Initial program 61.5
Simplified61.5
Taylor expanded around inf 2.0
Final simplification6.5
herbie shell --seed 2021175
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))