\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 2.3524160019579928 \cdot 10^{-257} \lor \neg \left(z \cdot 3 \le 1.74245869165650498 \cdot 10^{35}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{y}{\frac{t}{z \cdot 3}}}\\
\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)) <= 2.3524160019579928e-257) || !(((double) (z * 3.0)) <= 1.742458691656505e+35))) {
VAR = ((double) (((double) (x - ((double) (y / ((double) (z * 3.0)))))) + ((double) (1.0 / ((double) (y / ((double) (t / ((double) (z * 3.0))))))))));
} 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.5 |
|---|---|
| Target | 1.7 |
| Herbie | 1.3 |
if (* z 3.0) < 2.3524160019579928e-257 or 1.74245869165650498e35 < (* z 3.0) Initial program 2.6
rmApplied associate-/r*1.5
rmApplied clear-num1.5
if 2.3524160019579928e-257 < (* z 3.0) < 1.74245869165650498e35Initial program 7.0
rmApplied *-un-lft-identity7.0
Applied times-frac0.5
Final simplification1.3
herbie shell --seed 2020162
(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))))