\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 -1.47025786267833131 \cdot 10^{34}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{\left(z \cdot 3\right) \cdot y}{t}}\\
\mathbf{elif}\;z \cdot 3 \le 5.67346849327476735 \cdot 10^{-85}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(3 \cdot y\right)}\\
\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) <= -1.4702578626783313e+34)) {
temp = ((x - (y / (z * 3.0))) + (1.0 / (((z * 3.0) * y) / t)));
} else {
double temp_1;
if (((z * 3.0) <= 5.673468493274767e-85)) {
temp_1 = ((x - (y / (z * 3.0))) + ((1.0 / (z * 3.0)) * (t / y)));
} else {
temp_1 = ((x - (y / (z * 3.0))) + (t / (z * (3.0 * y))));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.6 |
|---|---|
| Target | 1.9 |
| Herbie | 0.6 |
if (* z 3.0) < -1.4702578626783313e+34Initial program 0.4
rmApplied clear-num0.4
if -1.4702578626783313e+34 < (* z 3.0) < 5.673468493274767e-85Initial program 10.5
rmApplied *-un-lft-identity10.5
Applied times-frac0.4
if 5.673468493274767e-85 < (* z 3.0) Initial program 0.9
rmApplied associate-*l*0.9
Final simplification0.6
herbie shell --seed 2020056 +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))))