\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;z \cdot 3 \le -1.29452495187302556 \cdot 10^{-26} \lor \neg \left(z \cdot 3 \le 1.65639586377778049 \cdot 10^{-42}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3 \cdot \left(z \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z} \cdot \frac{\frac{t}{3}}{y}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (((double) (z * 3.0)) * y))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (z * 3.0)) <= -1.2945249518730256e-26) || !(((double) (z * 3.0)) <= 1.6563958637777805e-42))) {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (t / ((double) (3.0 * ((double) (z * y))))))));
} else {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (((double) (1.0 / z)) * ((double) (((double) (t / 3.0)) / y))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.7 |
| Herbie | 0.5 |
if (* z 3.0) < -1.2945249518730256e-26 or 1.6563958637777805e-42 < (* z 3.0) Initial program 0.6
Taylor expanded around 0 0.6
if -1.2945249518730256e-26 < (* z 3.0) < 1.6563958637777805e-42Initial program 12.4
rmApplied associate-/r*3.5
rmApplied *-un-lft-identity3.5
Applied *-un-lft-identity3.5
Applied times-frac3.5
Applied times-frac0.3
Simplified0.3
Final simplification0.5
herbie shell --seed 2020123
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y))
(+ (- x (/ y (* z 3))) (/ t (* (* z 3) y))))