\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 -7.00016478612933466 \cdot 10^{-10} \lor \neg \left(z \cdot 3 \le 3.77744482229590179 \cdot 10^{36}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{\left(z \cdot 3\right) \cdot y}{t}}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{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)) <= -7.000164786129335e-10) || !(((double) (z * 3.0)) <= 3.777444822295902e+36))) {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (1.0 / ((double) (((double) (((double) (z * 3.0)) * y)) / t))))));
} else {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (((double) (1.0 / ((double) (z * 3.0)))) * ((double) (t / y))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.7 |
|---|---|
| Target | 1.7 |
| Herbie | 0.4 |
if (* z 3.0) < -7.000164786129335e-10 or 3.777444822295902e+36 < (* z 3.0) Initial program 0.4
rmApplied clear-num0.5
if -7.000164786129335e-10 < (* z 3.0) < 3.777444822295902e+36Initial program 9.4
rmApplied *-un-lft-identity9.4
Applied times-frac0.4
Final simplification0.4
herbie shell --seed 2020120
(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))))