\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -1.95442192702372847 \cdot 10^{61}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\mathbf{elif}\;z \le 4.6738271756222066 \cdot 10^{62}:\\
\;\;\;\;\frac{x}{\frac{z \cdot \left(y - t\right)}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\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 <= -1.9544219270237285e+61)) {
temp = ((x / z) / ((y - t) / 2.0));
} else {
double temp_1;
if ((z <= 4.673827175622207e+62)) {
temp_1 = (x / ((z * (y - t)) / 2.0));
} else {
temp_1 = (((cbrt(1.0) * cbrt(1.0)) / 1.0) * ((x / ((y - t) / 2.0)) / z));
}
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.0 |
| Herbie | 2.2 |
if z < -1.9544219270237285e+61Initial program 12.7
Simplified9.8
rmApplied *-un-lft-identity9.8
Applied times-frac9.8
Applied associate-/r*2.1
Simplified2.1
if -1.9544219270237285e+61 < z < 4.673827175622207e+62Initial program 2.2
Simplified2.2
if 4.673827175622207e+62 < z Initial program 12.7
Simplified10.3
rmApplied *-un-lft-identity10.3
Applied times-frac10.3
Applied *-un-lft-identity10.3
Applied times-frac2.3
Simplified2.3
rmApplied *-un-lft-identity2.3
Applied add-cube-cbrt2.3
Applied times-frac2.3
Applied associate-*l*2.3
Simplified2.3
Final simplification2.2
herbie shell --seed 2020057 +o rules:numerics
(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))))