\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;t \le 5.5318161723187204 \cdot 10^{-35}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{1}{z}}{\frac{y}{\frac{t}{3}}}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot 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 ((t <= 5.53181617231872e-35)) {
temp = ((x - (y / (z * 3.0))) + ((1.0 / z) / (y / (t / 3.0))));
} else {
temp = ((x - ((y / z) / 3.0)) + (t / ((z * 3.0) * y)));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.8 |
|---|---|
| Target | 1.7 |
| Herbie | 2.0 |
if t < 5.53181617231872e-35Initial program 4.7
rmApplied associate-/r*1.7
rmApplied *-un-lft-identity1.7
Applied times-frac1.7
Applied associate-/l*2.3
if 5.53181617231872e-35 < t Initial program 0.8
rmApplied associate-/r*0.8
Final simplification2.0
herbie shell --seed 2020066 +o rules:numerics
(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))))