\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 \leq 1.681822738427985 \cdot 10^{+109}:\\
\;\;\;\;\left(27 \cdot \left(a \cdot b\right) - \left(t \cdot \left(9 \cdot y\right)\right) \cdot z\right) + \left(x + x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(9 \cdot y\right) \cdot z\right)\right) + b \cdot \left(27 \cdot a\right)\\
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
(FPCore (x y z t a b) :precision binary64 (if (<= t 1.681822738427985e+109) (+ (- (* 27.0 (* a b)) (* (* t (* 9.0 y)) z)) (+ x x)) (+ (- (* x 2.0) (* t (* (* 9.0 y) z))) (* b (* 27.0 a)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 1.681822738427985e+109) {
tmp = ((27.0 * (a * b)) - ((t * (9.0 * y)) * z)) + (x + x);
} else {
tmp = ((x * 2.0) - (t * ((9.0 * y) * z))) + (b * (27.0 * a));
}
return tmp;
}




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 | 2.7 |
|---|---|
| Target | 3.0 |
| Herbie | 1.1 |
if t < 1.68182273842798502e109Initial program 3.7
Taylor expanded around 0 0.7
Simplified0.7
rmApplied associate-*r*_binary640.8
Simplified0.8
rmApplied associate-*r*_binary641.2
Simplified1.2
if 1.68182273842798502e109 < t Initial program 0.8
rmApplied *-un-lft-identity_binary640.8
Applied associate-*r*_binary640.8
Simplified0.8
Final simplification1.1
herbie shell --seed 2021204
(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)))