\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 -3.6161208674775763 \cdot 10^{+152}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq 2.2617122697789544 \cdot 10^{-159}:\\
\;\;\;\;\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.7374191487467014 \cdot 10^{+101}:\\
\;\;\;\;\frac{1}{\left(b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right) \cdot \frac{-1}{c}}\\
\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 -3.6161208674775763e+152)
(- (* 0.5 (/ c b)) (* 0.6666666666666666 (/ b a)))
(if (<= b 2.2617122697789544e-159)
(- (/ (sqrt (- (* b b) (* c (* a 3.0)))) (* a 3.0)) (/ b (* a 3.0)))
(if (<= b 1.7374191487467014e+101)
(/ 1.0 (* (+ b (sqrt (- (* b b) (* c (* a 3.0))))) (/ -1.0 c)))
(* (/ 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 <= -3.6161208674775763e+152) {
tmp = (0.5 * (c / b)) - (0.6666666666666666 * (b / a));
} else if (b <= 2.2617122697789544e-159) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) / (a * 3.0)) - (b / (a * 3.0));
} else if (b <= 1.7374191487467014e+101) {
tmp = 1.0 / ((b + sqrt((b * b) - (c * (a * 3.0)))) * (-1.0 / c));
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -3.61612086747757626e152Initial program 63.2
Simplified63.2
Taylor expanded around -inf 1.9
if -3.61612086747757626e152 < b < 2.26171226977895444e-159Initial program 10.2
Simplified10.2
rmApplied div-sub_binary64_109310.2
if 2.26171226977895444e-159 < b < 1.73741914874670135e101Initial program 39.2
Simplified39.2
rmApplied flip--_binary64_106339.2
Simplified16.1
Simplified16.1
rmApplied clear-num_binary64_108716.4
Simplified6.1
if 1.73741914874670135e101 < b Initial program 60.0
Simplified60.0
Taylor expanded around inf 2.5
Final simplification6.5
herbie shell --seed 2020280
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))