\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.6422358087771794 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(1.5 \cdot \frac{a \cdot c}{b} - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 4.4072850734806817 \cdot 10^{-122}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 8.100785156979165 \cdot 10^{+130}:\\
\;\;\;\;\frac{\frac{a \cdot \left(c \cdot -3\right)}{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{a \cdot c}{b} \cdot -1.5}{a \cdot 3}\\
\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.6422358087771794e+154)
(/ (- (- (* 1.5 (/ (* a c) b)) b) b) (* a 3.0))
(if (<= b 4.4072850734806817e-122)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 8.100785156979165e+130)
(/
(/ (* a (* c -3.0)) (+ b (sqrt (- (* b b) (* c (* a 3.0))))))
(* a 3.0))
(/ (* (/ (* a c) b) -1.5) (* a 3.0))))))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.6422358087771794e+154) {
tmp = (((1.5 * ((a * c) / b)) - b) - b) / (a * 3.0);
} else if (b <= 4.4072850734806817e-122) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) - b) / (a * 3.0);
} else if (b <= 8.100785156979165e+130) {
tmp = ((a * (c * -3.0)) / (b + sqrt((b * b) - (c * (a * 3.0))))) / (a * 3.0);
} else {
tmp = (((a * c) / b) * -1.5) / (a * 3.0);
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.6422358087771794e154Initial program 64.0
Simplified64.0
Taylor expanded around -inf 11.3
if -1.6422358087771794e154 < b < 4.4072850734806817e-122Initial program 11.3
Simplified11.3
if 4.4072850734806817e-122 < b < 8.10078515697916522e130Initial program 42.1
Simplified42.1
rmApplied flip--_binary64_141742.2
Simplified15.3
Simplified15.3
if 8.10078515697916522e130 < b Initial program 61.7
Simplified61.7
Taylor expanded around inf 14.6
Simplified14.6
Final simplification12.9
herbie shell --seed 2020295
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))