\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.5123246473038562 \cdot 10^{+135}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq -2.1998622489132126 \cdot 10^{-305}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 4.0379898751727945 \cdot 10^{+122}:\\
\;\;\;\;\frac{c}{\left(-b\right) - \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.5123246473038562e+135)
(- (* 0.5 (/ c b)) (* 0.6666666666666666 (/ b a)))
(if (<= b -2.1998622489132126e-305)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 4.0379898751727945e+122)
(/ c (- (- 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.5123246473038562e+135) {
tmp = (0.5 * (c / b)) - (0.6666666666666666 * (b / a));
} else if (b <= -2.1998622489132126e-305) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) - b) / (a * 3.0);
} else if (b <= 4.0379898751727945e+122) {
tmp = c / (-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.51232464730385623e135Initial program 55.7
Simplified55.7
rmApplied flip--_binary64_550963.7
Simplified62.6
Simplified62.6
rmApplied clear-num_binary64_553362.6
Simplified62.4
Taylor expanded around -inf 2.4
if -2.51232464730385623e135 < b < -2.1998622489132126e-305Initial program 9.2
if -2.1998622489132126e-305 < b < 4.03798987517279446e122Initial program 34.2
Simplified34.2
rmApplied flip--_binary64_550934.2
Simplified16.4
Simplified16.4
rmApplied clear-num_binary64_553316.5
Simplified9.1
rmApplied div-inv_binary64_55319.1
Simplified8.6
if 4.03798987517279446e122 < b Initial program 60.7
Simplified60.7
rmApplied flip--_binary64_550960.7
Simplified35.7
Simplified35.7
rmApplied clear-num_binary64_553335.8
Simplified34.2
Taylor expanded around inf 2.6
Final simplification6.8
herbie shell --seed 2020349
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))