\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -1.51847795867609119 \cdot 10^{-57} \lor \neg \left(x \le 3.501200984228306 \cdot 10^{-154}\right):\\
\;\;\;\;1 \cdot \frac{x \cdot \frac{2}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{x}{\frac{z \cdot \left(y - t\right)}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r504824 = x;
double r504825 = 2.0;
double r504826 = r504824 * r504825;
double r504827 = y;
double r504828 = z;
double r504829 = r504827 * r504828;
double r504830 = t;
double r504831 = r504830 * r504828;
double r504832 = r504829 - r504831;
double r504833 = r504826 / r504832;
return r504833;
}
double f(double x, double y, double z, double t) {
double r504834 = x;
double r504835 = -1.5184779586760912e-57;
bool r504836 = r504834 <= r504835;
double r504837 = 3.501200984228306e-154;
bool r504838 = r504834 <= r504837;
double r504839 = !r504838;
bool r504840 = r504836 || r504839;
double r504841 = 1.0;
double r504842 = 2.0;
double r504843 = y;
double r504844 = t;
double r504845 = r504843 - r504844;
double r504846 = r504842 / r504845;
double r504847 = r504834 * r504846;
double r504848 = z;
double r504849 = r504847 / r504848;
double r504850 = r504841 * r504849;
double r504851 = r504848 * r504845;
double r504852 = r504851 / r504842;
double r504853 = r504834 / r504852;
double r504854 = r504841 * r504853;
double r504855 = r504840 ? r504850 : r504854;
return r504855;
}




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.8 |
if x < -1.5184779586760912e-57 or 3.501200984228306e-154 < x Initial program 8.6
Simplified7.7
rmApplied *-un-lft-identity7.7
Applied *-un-lft-identity7.7
Applied times-frac7.7
Simplified7.7
rmApplied div-inv7.9
Simplified7.3
rmApplied associate-*r/3.1
if -1.5184779586760912e-57 < x < 3.501200984228306e-154Initial program 3.5
Simplified2.1
rmApplied *-un-lft-identity2.1
Applied *-un-lft-identity2.1
Applied times-frac2.1
Simplified2.1
Final simplification2.8
herbie shell --seed 2020046 +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))))