\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 4.25354810227258:\\
\;\;\;\;\frac{\frac{\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) - b \cdot b}{b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c \cdot c}{b \cdot b} \cdot 0.25 - \frac{a}{\log \left(e^{\frac{{b}^{6}}{a \cdot {c}^{4}}}\right)} \cdot 0.140625}{\frac{c}{b} \cdot -0.5 - \frac{a \cdot \left(c \cdot c\right)}{{b}^{3}} \cdot -0.375}\\
\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 4.25354810227258)
(/
(/
(- (- (* b b) (* (* 3.0 a) c)) (* b b))
(+ b (sqrt (- (* b b) (* (* 3.0 a) c)))))
(* 3.0 a))
(/
(-
(* (/ (* c c) (* b b)) 0.25)
(* (/ a (log (exp (/ (pow b 6.0) (* a (pow c 4.0)))))) 0.140625))
(- (* (/ c b) -0.5) (* (/ (* a (* c c)) (pow b 3.0)) -0.375)))))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 <= 4.25354810227258) {
tmp = ((((b * b) - ((3.0 * a) * c)) - (b * b)) / (b + sqrt((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
} else {
tmp = ((((c * c) / (b * b)) * 0.25) - ((a / log(exp(pow(b, 6.0) / (a * pow(c, 4.0))))) * 0.140625)) / (((c / b) * -0.5) - (((a * (c * c)) / pow(b, 3.0)) * -0.375));
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < 4.2535481022725801Initial program 12.5
Simplified12.5
rmApplied flip--_binary64_244012.5
Simplified11.5
Simplified11.5
if 4.2535481022725801 < b Initial program 32.6
Simplified32.6
Taylor expanded around inf 8.6
Simplified8.6
rmApplied flip-+_binary64_24398.6
Simplified8.8
rmApplied add-log-exp_binary64_25048.6
Simplified8.6
Final simplification9.2
herbie shell --seed 2020339
(FPCore (a b c)
:name "Cubic critical, narrow range"
:precision binary64
:pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))