\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 -2.452019057043114 \cdot 10^{+129}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq 1.03289464838539 \cdot 10^{-299}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{a \cdot 3} - \frac{b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.1209799556123897 \cdot 10^{+93}:\\
\;\;\;\;\frac{1}{3 \cdot \frac{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{c \cdot -3}}\\
\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 -2.452019057043114e+129)
(- (* 0.5 (/ c b)) (* 0.6666666666666666 (/ b a)))
(if (<= b 1.03289464838539e-299)
(- (/ (sqrt (- (* b b) (* c (* a 3.0)))) (* a 3.0)) (/ b (* a 3.0)))
(if (<= b 1.1209799556123897e+93)
(/ 1.0 (* 3.0 (/ (+ b (sqrt (- (* b b) (* c (* a 3.0))))) (* 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 <= -2.452019057043114e+129) {
tmp = (0.5 * (c / b)) - (0.6666666666666666 * (b / a));
} else if (b <= 1.03289464838539e-299) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) / (a * 3.0)) - (b / (a * 3.0));
} else if (b <= 1.1209799556123897e+93) {
tmp = 1.0 / (3.0 * ((b + sqrt((b * b) - (c * (a * 3.0)))) / (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 < -2.45201905704311411e129Initial program 54.7
Simplified54.7
Taylor expanded around -inf 3.2
if -2.45201905704311411e129 < b < 1.03289464838539e-299Initial program 9.1
Simplified9.1
rmApplied div-sub_binary64_14479.1
if 1.03289464838539e-299 < b < 1.12097995561238967e93Initial program 31.5
Simplified31.5
rmApplied associate-/r*_binary64_138631.6
rmApplied flip--_binary64_141731.6
Simplified16.1
Simplified16.1
rmApplied clear-num_binary64_144116.3
Simplified8.8
if 1.12097995561238967e93 < b Initial program 59.1
Simplified59.1
Taylor expanded around inf 2.5
Final simplification6.7
herbie shell --seed 2020346
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))