\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 -5.1275435248176189 \cdot 10^{47} \lor \neg \left(z \cdot 3 \le 9.4080883970574118 \cdot 10^{48}\right):\\
\;\;\;\;\left(x - y \cdot \frac{1}{z \cdot 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 ((x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)));
}
double code(double x, double y, double z, double t) {
double temp;
if ((((z * 3.0) <= -5.127543524817619e+47) || !((z * 3.0) <= 9.408088397057412e+48))) {
temp = ((x - (y * (1.0 / (z * 3.0)))) + (t / ((z * 3.0) * y)));
} else {
temp = ((x - (y / (z * 3.0))) + ((1.0 / (z * 3.0)) * (t / y)));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.8 |
| Herbie | 0.5 |
if (* z 3.0) < -5.127543524817619e+47 or 9.408088397057412e+48 < (* z 3.0) Initial program 0.4
rmApplied div-inv0.4
if -5.127543524817619e+47 < (* z 3.0) < 9.408088397057412e+48Initial program 8.0
rmApplied *-un-lft-identity8.0
Applied times-frac0.6
Final simplification0.5
herbie shell --seed 2020058
(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))))