\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \le -8.3941872384105394 \cdot 10^{29} \lor \neg \left(t \le 6.79285486492489634 \cdot 10^{-15}\right):\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\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 (((t <= -8.39418723841054e+29) || !(t <= 6.792854864924896e-15))) {
VAR = ((double) (((double) (x - ((double) (((double) (y / z)) / 3.0)))) + ((double) (t / ((double) (((double) (z * 3.0)) * y))))));
} 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.4 |
|---|---|
| Target | 1.6 |
| Herbie | 0.3 |
if t < -8.3941872384105394e29 or 6.79285486492489634e-15 < t Initial program 0.4
rmApplied associate-/r*0.4
if -8.3941872384105394e29 < t < 6.79285486492489634e-15Initial program 5.6
rmApplied *-un-lft-identity5.6
Applied times-frac0.2
Final simplification0.3
herbie shell --seed 2020149
(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))))