\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 -4.8789212851081629 \cdot 10^{97}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot 3} \cdot \frac{1}{y}\\
\mathbf{elif}\;z \cdot 3 \le 9.9293498959749377 \cdot 10^{-50}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{y}}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{\left(z \cdot 3\right) \cdot y}{t}}\\
\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 VAR;
if (((z * 3.0) <= -4.878921285108163e+97)) {
VAR = ((x - (y / (z * 3.0))) + ((t / (z * 3.0)) * (1.0 / y)));
} else {
double VAR_1;
if (((z * 3.0) <= 9.929349895974938e-50)) {
VAR_1 = ((x - (y / (z * 3.0))) + ((t / y) / (z * 3.0)));
} else {
VAR_1 = ((x - (y / (z * 3.0))) + (1.0 / (((z * 3.0) * y) / t)));
}
VAR = VAR_1;
}
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 | 0.8 |
if (* z 3.0) < -4.878921285108163e+97Initial program 0.5
rmApplied associate-/r*1.2
rmApplied div-inv1.2
if -4.878921285108163e+97 < (* z 3.0) < 9.929349895974938e-50Initial program 8.4
rmApplied associate-/r*2.7
rmApplied div-inv2.7
rmApplied associate-*l/1.0
Simplified1.0
if 9.929349895974938e-50 < (* z 3.0) Initial program 0.5
rmApplied clear-num0.5
Final simplification0.8
herbie shell --seed 2020105
(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))))