\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.3249665758399062 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(1.5 \cdot \frac{a \cdot c}{b} - b\right) - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 8.969766515049942 \cdot 10^{-182}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3.2493324446871104 \cdot 10^{+131}:\\
\;\;\;\;\sqrt[3]{\frac{-1}{\frac{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{c}}} \cdot \left(\sqrt[3]{\frac{-1}{\frac{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{c}}} \cdot \sqrt[3]{\frac{-1}{\frac{b + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{c}}}\right)\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{c \cdot -3}{b + \left(b - 1.5 \cdot \frac{a \cdot c}{b}\right)}\\
\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.3249665758399062e+154)
(/ (- (- (* 1.5 (/ (* a c) b)) b) b) (* a 3.0))
(if (<= b 8.969766515049942e-182)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 3.2493324446871104e+131)
(*
(cbrt (/ -1.0 (/ (+ b (sqrt (- (* b b) (* c (* a 3.0))))) c)))
(*
(cbrt (/ -1.0 (/ (+ b (sqrt (- (* b b) (* c (* a 3.0))))) c)))
(cbrt (/ -1.0 (/ (+ b (sqrt (- (* b b) (* c (* a 3.0))))) c)))))
(*
0.3333333333333333
(/ (* c -3.0) (+ b (- b (* 1.5 (/ (* a 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.3249665758399062e+154) {
tmp = (((1.5 * ((a * c) / b)) - b) - b) / (a * 3.0);
} else if (b <= 8.969766515049942e-182) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) - b) / (a * 3.0);
} else if (b <= 3.2493324446871104e+131) {
tmp = cbrt(-1.0 / ((b + sqrt((b * b) - (c * (a * 3.0)))) / c)) * (cbrt(-1.0 / ((b + sqrt((b * b) - (c * (a * 3.0)))) / c)) * cbrt(-1.0 / ((b + sqrt((b * b) - (c * (a * 3.0)))) / c)));
} else {
tmp = 0.3333333333333333 * ((c * -3.0) / (b + (b - (1.5 * ((a * c) / b)))));
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.32496657583990621e154Initial program 64.0
Simplified64.0
Taylor expanded around -inf 11.8
if -1.32496657583990621e154 < b < 8.9697665150499419e-182Initial program 10.1
Simplified10.1
if 8.9697665150499419e-182 < b < 3.24933244468711035e131Initial program 38.0
Simplified38.0
rmApplied flip--_binary64_140038.0
Simplified15.4
Simplified15.4
rmApplied add-cube-cbrt_binary64_145716.0
Simplified16.1
Simplified7.3
if 3.24933244468711035e131 < b Initial program 61.4
Simplified61.4
rmApplied flip--_binary64_140061.4
Simplified35.6
Simplified35.6
rmApplied *-un-lft-identity_binary64_142535.6
Applied times-frac_binary64_143135.6
Simplified35.6
Simplified34.7
Taylor expanded around inf 6.9
Final simplification8.9
herbie shell --seed 2020281
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))