\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 -2.2157830961809245 \cdot 10^{135}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z}}{3 \cdot y}\\
\mathbf{elif}\;z \cdot 3 \le 1.42727684565750601:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{z \cdot 3} \cdot \frac{t}{y}\\
\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 VAR;
if (((z * 3.0) <= -2.2157830961809245e+135)) {
VAR = ((x - (y / (z * 3.0))) + ((t / z) / (3.0 * y)));
} else {
double VAR_1;
if (((z * 3.0) <= 1.427276845657506)) {
VAR_1 = ((x - (y / (z * 3.0))) + ((1.0 / (z * 3.0)) * (t / y)));
} else {
VAR_1 = ((x - ((y / z) / 3.0)) + (t / ((z * 3.0) * y)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 3.7 |
|---|---|
| Target | 1.8 |
| Herbie | 1.0 |
if (* z 3.0) < -2.2157830961809245e+135Initial program 0.8
rmApplied associate-*l*0.8
rmApplied associate-/r*1.9
if -2.2157830961809245e+135 < (* z 3.0) < 1.427276845657506Initial program 7.1
rmApplied *-un-lft-identity7.1
Applied times-frac1.0
if 1.427276845657506 < (* z 3.0) Initial program 0.6
rmApplied associate-/r*0.6
Final simplification1.0
herbie shell --seed 2020091
(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))))