\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 -8.363321097884155 \cdot 10^{+91}:\\
\;\;\;\;\frac{\frac{b \cdot -2}{3}}{a}\\
\mathbf{elif}\;b \leq 1.9677039219986912 \cdot 10^{-169}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 2.2080465071725722 \cdot 10^{+76}:\\
\;\;\;\;\frac{a}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\frac{\frac{c \cdot -3}{b + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}}{3}}{\sqrt[3]{a}}\\
\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 -8.363321097884155e+91)
(/ (/ (* b -2.0) 3.0) a)
(if (<= b 1.9677039219986912e-169)
(/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a))
(if (<= b 2.2080465071725722e+76)
(*
(/ a (* (cbrt a) (cbrt a)))
(/
(/ (/ (* c -3.0) (+ b (sqrt (- (* b b) (* 3.0 (* a c)))))) 3.0)
(cbrt a)))
(* -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 <= -8.363321097884155e+91) {
tmp = ((b * -2.0) / 3.0) / a;
} else if (b <= 1.9677039219986912e-169) {
tmp = (sqrt((b * b) - ((3.0 * a) * c)) - b) / (3.0 * a);
} else if (b <= 2.2080465071725722e+76) {
tmp = (a / (cbrt(a) * cbrt(a))) * ((((c * -3.0) / (b + sqrt((b * b) - (3.0 * (a * c))))) / 3.0) / cbrt(a));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -8.36332109788415504e91Initial program 45.3
Simplified45.3
rmApplied associate-/r*_binary64_513745.3
Simplified45.2
Taylor expanded around -inf 4.5
if -8.36332109788415504e91 < b < 1.9677039219986912e-169Initial program 10.6
if 1.9677039219986912e-169 < b < 2.2080465071725722e76Initial program 35.6
Simplified35.6
rmApplied associate-/r*_binary64_513735.6
Simplified35.6
rmApplied flip--_binary64_516835.6
Simplified16.5
Simplified16.5
rmApplied add-cube-cbrt_binary64_522817.1
Applied *-un-lft-identity_binary64_519317.1
Applied *-un-lft-identity_binary64_519317.1
Applied times-frac_binary64_519914.1
Applied times-frac_binary64_519914.1
Applied times-frac_binary64_519910.5
if 2.2080465071725722e76 < b Initial program 58.1
Simplified58.1
rmApplied associate-/r*_binary64_513758.1
Simplified58.1
rmApplied flip--_binary64_516858.2
Simplified29.5
Simplified29.5
Taylor expanded around 0 3.1
Final simplification7.6
herbie shell --seed 2021097
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))