\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 -1.6639797539343423 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{b \cdot -2}{3}}{a}\\
\mathbf{elif}\;b \leq -9.85258107206253 \cdot 10^{-259}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 8.68809347721397 \cdot 10^{+54}:\\
\;\;\;\;\frac{-c}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}\\
\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 -1.6639797539343423e+153)
(/ (/ (* b -2.0) 3.0) a)
(if (<= b -9.85258107206253e-259)
(/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a))
(if (<= b 8.68809347721397e+54)
(/ (- c) (+ b (sqrt (fma a (* c -3.0) (* b b)))))
(* -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 <= -1.6639797539343423e+153) {
tmp = ((b * -2.0) / 3.0) / a;
} else if (b <= -9.85258107206253e-259) {
tmp = (sqrt((b * b) - ((3.0 * a) * c)) - b) / (3.0 * a);
} else if (b <= 8.68809347721397e+54) {
tmp = -c / (b + sqrt(fma(a, (c * -3.0), (b * b))));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
if b < -1.66397975393434225e153Initial program 63.6
Applied associate-/r*_binary6463.6
Taylor expanded in b around -inf 2.2
if -1.66397975393434225e153 < b < -9.85258107206253017e-259Initial program 7.9
if -9.85258107206253017e-259 < b < 8.688093477213969e54Initial program 28.4
Simplified28.5
Applied flip--_binary6428.6
Applied associate-*l/_binary6428.6
Simplified16.5
Taylor expanded in a around 0 9.2
Simplified9.2
if 8.688093477213969e54 < b Initial program 57.2
Taylor expanded in b around inf 3.7
Final simplification6.5
herbie shell --seed 2021329
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))