\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.4427673897213551 \cdot 10^{+153}:\\
\;\;\;\;\frac{\left(-b\right) - b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 1.2177854566716303 \cdot 10^{-166}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\\
\mathbf{elif}\;b \leq 124046118059855380:\\
\;\;\;\;\frac{\left(a \cdot \left(c \cdot -3\right)\right) \cdot \frac{0.3333333333333333}{a}}{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.4427673897213551e+153)
(/ (- (- b) b) (* 3.0 a))
(if (<= b 1.2177854566716303e-166)
(/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a))
(if (<= b 124046118059855380.0)
(/
(* (* a (* c -3.0)) (/ 0.3333333333333333 a))
(+ 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.4427673897213551e+153) {
tmp = (-b - b) / (3.0 * a);
} else if (b <= 1.2177854566716303e-166) {
tmp = (sqrt((b * b) - ((3.0 * a) * c)) - b) / (3.0 * a);
} else if (b <= 124046118059855380.0) {
tmp = ((a * (c * -3.0)) * (0.3333333333333333 / a)) / (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.44276738972135514e153Initial program 63.1
Taylor expanded in b around -inf 3.4
if -1.44276738972135514e153 < b < 1.21778545667163e-166Initial program 10.3
Applied *-commutative_binary6410.3
if 1.21778545667163e-166 < b < 124046118059855376Initial program 35.4
Simplified35.5
Applied flip--_binary6435.5
Applied associate-*l/_binary6435.5
Simplified17.4
if 124046118059855376 < b Initial program 56.1
Simplified56.1
Taylor expanded in a around 0 5.1
Final simplification8.9
herbie shell --seed 2021344
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))