\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \leq -9.261977123010992 \cdot 10^{+16} \lor \neg \left(t \leq 4.213354480677583 \cdot 10^{+62}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.261977123010992e+16) (not (<= t 4.213354480677583e+62))) (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) (+ x (/ (* -0.3333333333333333 (- y (/ t y))) z))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.261977123010992e+16) || !(t <= 4.213354480677583e+62)) {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
} else {
tmp = x + ((-0.3333333333333333 * (y - (t / y))) / z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.3 |
|---|---|
| Target | 1.7 |
| Herbie | 0.5 |
if t < -92619771230109920 or 4.21335448067758332e62 < t Initial program 0.6
if -92619771230109920 < t < 4.21335448067758332e62Initial program 4.7
Simplified0.4
rmApplied associate-*l/_binary640.4
Final simplification0.5
herbie shell --seed 2020219
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))