\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 -6.393909460190851 \cdot 10^{+142}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq 3.821524395718537 \cdot 10^{-287}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3.786479868770222 \cdot 10^{+62}:\\
\;\;\;\;\frac{c}{\left(-b\right) - \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\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 -6.393909460190851e+142)
(- (* (/ c b) 0.5) (* 0.6666666666666666 (/ b a)))
(if (<= b 3.821524395718537e-287)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 3.786479868770222e+62)
(/ c (- (- b) (sqrt (- (* b b) (* 3.0 (* c a))))))
(* (/ c b) -0.5)))))double code(double a, double b, double c) {
return (((double) (((double) -(b)) + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (3.0 * a)) * c)))))))) / ((double) (3.0 * a)));
}
double code(double a, double b, double c) {
double VAR;
if ((b <= -6.393909460190851e+142)) {
VAR = ((double) (((double) ((c / b) * 0.5)) - ((double) (0.6666666666666666 * (b / a)))));
} else {
double VAR_1;
if ((b <= 3.821524395718537e-287)) {
VAR_1 = (((double) (((double) sqrt(((double) (((double) (b * b)) - ((double) (c * ((double) (a * 3.0)))))))) - b)) / ((double) (a * 3.0)));
} else {
double VAR_2;
if ((b <= 3.786479868770222e+62)) {
VAR_2 = (c / ((double) (((double) -(b)) - ((double) sqrt(((double) (((double) (b * b)) - ((double) (3.0 * ((double) (c * a)))))))))));
} else {
VAR_2 = ((double) ((c / b) * -0.5));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -6.3939094601908506e142Initial program 59.7
Taylor expanded around -inf 2.6
Simplified2.6
if -6.3939094601908506e142 < b < 3.8215243957185368e-287Initial program 10.2
if 3.8215243957185368e-287 < b < 3.78647986877022217e62Initial program 31.9
rmApplied flip-+31.9
Simplified17.8
Simplified17.7
rmApplied *-un-lft-identity17.7
Applied times-frac17.7
Applied times-frac17.6
Simplified17.6
Simplified9.2
if 3.78647986877022217e62 < b Initial program 57.9
Taylor expanded around inf 3.8
Final simplification7.3
herbie shell --seed 2020198
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))