\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -49355.0736941491268:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\mathbf{elif}\;z \le 1.74137454924600484 \cdot 10^{79}:\\
\;\;\;\;1 \cdot \frac{x}{\frac{z \cdot \left(y - t\right)}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x}}{\frac{z}{\sqrt[3]{x}}} \cdot \frac{\sqrt[3]{x}}{\frac{y - t}{2}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((x * 2.0) / ((y * z) - (t * z)));
}
double code(double x, double y, double z, double t) {
double temp;
if ((z <= -49355.07369414913)) {
temp = ((x / z) / ((y - t) / 2.0));
} else {
double temp_1;
if ((z <= 1.741374549246005e+79)) {
temp_1 = (1.0 * (x / ((z * (y - t)) / 2.0)));
} else {
temp_1 = ((cbrt(x) / (z / cbrt(x))) * (cbrt(x) / ((y - t) / 2.0)));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.2 |
| Herbie | 2.1 |
if z < -49355.07369414913Initial program 11.2
Simplified9.2
rmApplied *-un-lft-identity9.2
Applied times-frac9.2
Applied associate-/r*1.7
Simplified1.7
if -49355.07369414913 < z < 1.741374549246005e+79Initial program 2.4
Simplified2.4
rmApplied *-un-lft-identity2.4
Applied *-un-lft-identity2.4
Applied times-frac2.4
Simplified2.4
if 1.741374549246005e+79 < z Initial program 12.7
Simplified10.3
rmApplied *-un-lft-identity10.3
Applied times-frac10.2
Applied add-cube-cbrt10.6
Applied times-frac1.9
Simplified1.9
Final simplification2.1
herbie shell --seed 2020060
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))
(/ (* x 2) (- (* y z) (* t z))))