\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.1352611747204783 \cdot 10^{+136}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq -7.818817745763073 \cdot 10^{-303}:\\
\;\;\;\;\frac{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{3}}{a}\\
\mathbf{elif}\;b \leq 3.376433332167536 \cdot 10^{+75}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{c \cdot -3}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\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 -2.1352611747204783e+136)
(- (* 0.5 (/ c b)) (* 0.6666666666666666 (/ b a)))
(if (<= b -7.818817745763073e-303)
(/ (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) 3.0) a)
(if (<= b 3.376433332167536e+75)
(*
0.3333333333333333
(/ (* c -3.0) (+ b (sqrt (- (* b b) (* c (* a 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.1352611747204783e+136) {
tmp = (0.5 * (c / b)) - (0.6666666666666666 * (b / a));
} else if (b <= -7.818817745763073e-303) {
tmp = ((sqrt((b * b) - (c * (a * 3.0))) - b) / 3.0) / a;
} else if (b <= 3.376433332167536e+75) {
tmp = 0.3333333333333333 * ((c * -3.0) / (b + sqrt((b * b) - (c * (a * 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.1352611747204783e136Initial program 56.7
Simplified56.7
Taylor expanded around -inf 2.7
if -2.1352611747204783e136 < b < -7.8188177457630729e-303Initial program 8.6
Simplified8.6
rmApplied associate-/r*_binary64_10348.7
if -7.8188177457630729e-303 < b < 3.3764333321675361e75Initial program 31.7
Simplified31.7
rmApplied flip--_binary64_106331.8
Simplified17.4
Simplified17.4
rmApplied *-un-lft-identity_binary64_108817.4
Applied times-frac_binary64_109417.4
Simplified17.4
Simplified9.9
if 3.3764333321675361e75 < b Initial program 57.8
Simplified57.8
Taylor expanded around inf 3.0
Final simplification6.8
herbie shell --seed 2020303
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))