\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -3.5647687804893846 \cdot 10^{-4}:\\
\;\;\;\;1 \cdot \frac{\frac{1}{y - t}}{\frac{\frac{z}{x}}{2}}\\
\mathbf{elif}\;z \le 1.4378345516742572 \cdot 10^{-160}:\\
\;\;\;\;1 \cdot \frac{x}{z \cdot \frac{y - t}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r481764 = x;
double r481765 = 2.0;
double r481766 = r481764 * r481765;
double r481767 = y;
double r481768 = z;
double r481769 = r481767 * r481768;
double r481770 = t;
double r481771 = r481770 * r481768;
double r481772 = r481769 - r481771;
double r481773 = r481766 / r481772;
return r481773;
}
double f(double x, double y, double z, double t) {
double r481774 = z;
double r481775 = -0.00035647687804893846;
bool r481776 = r481774 <= r481775;
double r481777 = 1.0;
double r481778 = y;
double r481779 = t;
double r481780 = r481778 - r481779;
double r481781 = r481777 / r481780;
double r481782 = x;
double r481783 = r481774 / r481782;
double r481784 = 2.0;
double r481785 = r481783 / r481784;
double r481786 = r481781 / r481785;
double r481787 = r481777 * r481786;
double r481788 = 1.4378345516742572e-160;
bool r481789 = r481774 <= r481788;
double r481790 = r481780 / r481784;
double r481791 = r481774 * r481790;
double r481792 = r481782 / r481791;
double r481793 = r481777 * r481792;
double r481794 = r481782 / r481774;
double r481795 = r481794 / r481790;
double r481796 = r481789 ? r481793 : r481795;
double r481797 = r481776 ? r481787 : r481796;
return r481797;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.2 |
| Herbie | 2.9 |
if z < -0.00035647687804893846Initial program 9.9
Simplified8.3
rmApplied *-un-lft-identity8.3
Applied times-frac8.2
Applied *-un-lft-identity8.2
Applied times-frac2.3
Simplified2.3
rmApplied *-un-lft-identity2.3
Applied associate-*l*2.3
Simplified2.2
rmApplied div-inv2.2
Applied *-un-lft-identity2.2
Applied times-frac2.3
Applied associate-/l*2.3
Simplified2.3
if -0.00035647687804893846 < z < 1.4378345516742572e-160Initial program 3.1
Simplified3.1
rmApplied *-un-lft-identity3.1
Applied times-frac3.1
Applied *-un-lft-identity3.1
Applied times-frac10.8
Simplified10.8
rmApplied *-un-lft-identity10.8
Applied associate-*l*10.8
Simplified10.7
rmApplied div-inv10.8
Applied associate-/l*3.2
Simplified3.1
if 1.4378345516742572e-160 < z Initial program 7.0
Simplified5.8
rmApplied *-un-lft-identity5.8
Applied times-frac5.7
Applied associate-/r*3.3
Simplified3.3
Final simplification2.9
herbie shell --seed 2020089 +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))))