\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -2.037157504084274034815349795281714872542 \cdot 10^{-36}:\\
\;\;\;\;\frac{\frac{x \cdot 2}{z}}{y - t}\\
\mathbf{elif}\;z \le 3.818366843617034597316373479678641130316 \cdot 10^{83}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z}\\
\end{array}double f(double x, double y, double z, double t) {
double r334787 = x;
double r334788 = 2.0;
double r334789 = r334787 * r334788;
double r334790 = y;
double r334791 = z;
double r334792 = r334790 * r334791;
double r334793 = t;
double r334794 = r334793 * r334791;
double r334795 = r334792 - r334794;
double r334796 = r334789 / r334795;
return r334796;
}
double f(double x, double y, double z, double t) {
double r334797 = z;
double r334798 = -2.037157504084274e-36;
bool r334799 = r334797 <= r334798;
double r334800 = x;
double r334801 = 2.0;
double r334802 = r334800 * r334801;
double r334803 = r334802 / r334797;
double r334804 = y;
double r334805 = t;
double r334806 = r334804 - r334805;
double r334807 = r334803 / r334806;
double r334808 = 3.8183668436170346e+83;
bool r334809 = r334797 <= r334808;
double r334810 = r334797 * r334806;
double r334811 = r334802 / r334810;
double r334812 = r334801 / r334806;
double r334813 = r334800 * r334812;
double r334814 = r334813 / r334797;
double r334815 = r334809 ? r334811 : r334814;
double r334816 = r334799 ? r334807 : r334815;
return r334816;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 2.2 |
| Herbie | 2.4 |
if z < -2.037157504084274e-36Initial program 9.3
Simplified7.6
rmApplied associate-/r*2.2
if -2.037157504084274e-36 < z < 3.8183668436170346e+83Initial program 2.5
Simplified2.5
rmApplied div-inv2.9
rmApplied add-cube-cbrt2.9
Applied times-frac2.9
Simplified2.9
Simplified2.9
rmApplied frac-times2.9
Applied associate-*r/2.5
Simplified2.5
if 3.8183668436170346e+83 < z Initial program 12.9
Simplified10.2
rmApplied div-inv10.3
rmApplied add-cube-cbrt10.3
Applied times-frac9.6
Simplified9.6
Simplified9.6
rmApplied associate-*l/9.6
Applied associate-*r/2.5
Simplified2.5
Final simplification2.4
herbie shell --seed 2019323
(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.045027827330126e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))
(/ (* x 2) (- (* y z) (* t z))))