\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\begin{array}{l}
\mathbf{if}\;t \le -0.332182428662519957 \lor \neg \left(t \le 1.6048558416687092 \cdot 10^{-74}\right):\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot \left(9 \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + {\left(\sqrt{27} \cdot \left(\sqrt{27} \cdot \left(a \cdot b\right)\right)\right)}^{1}\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return ((double) (((double) (((double) (x * 2.0)) - ((double) (((double) (((double) (y * 9.0)) * z)) * t)))) + ((double) (((double) (a * 27.0)) * b))));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if (((t <= -0.33218242866251996) || !(t <= 1.6048558416687092e-74))) {
VAR = ((double) (((double) (((double) (x * 2.0)) - ((double) (((double) (y * ((double) (9.0 * z)))) * t)))) + ((double) (((double) (a * 27.0)) * b))));
} else {
VAR = ((double) (((double) (((double) (x * 2.0)) - ((double) (((double) (y * 9.0)) * ((double) (z * t)))))) + ((double) pow(((double) (((double) sqrt(27.0)) * ((double) (((double) sqrt(27.0)) * ((double) (a * b)))))), 1.0))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 4.0 |
|---|---|
| Target | 2.7 |
| Herbie | 0.8 |
if t < -0.33218242866251996 or 1.6048558416687092e-74 < t Initial program 1.0
rmApplied associate-*l*1.0
if -0.33218242866251996 < t < 1.6048558416687092e-74Initial program 6.7
rmApplied associate-*l*0.6
rmApplied pow10.6
Applied pow10.6
Applied pow10.6
Applied pow-prod-down0.6
Applied pow-prod-down0.6
Simplified0.5
rmApplied add-sqr-sqrt0.5
Applied associate-*l*0.6
Final simplification0.8
herbie shell --seed 2020129
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))