\frac{x \cdot 2.0}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -5.4355961856746975 \cdot 10^{+39}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \left(2.0 \cdot \sqrt[3]{x}\right)}{y - t} \cdot \frac{\sqrt[3]{x}}{z}\\
\mathbf{elif}\;z \le 1.3604186575337987 \cdot 10^{-93}:\\
\;\;\;\;\frac{2.0 \cdot x}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \left(2.0 \cdot \sqrt[3]{x}\right)}{y - t} \cdot \frac{\sqrt[3]{x}}{z}\\
\end{array}double f(double x, double y, double z, double t) {
double r28155776 = x;
double r28155777 = 2.0;
double r28155778 = r28155776 * r28155777;
double r28155779 = y;
double r28155780 = z;
double r28155781 = r28155779 * r28155780;
double r28155782 = t;
double r28155783 = r28155782 * r28155780;
double r28155784 = r28155781 - r28155783;
double r28155785 = r28155778 / r28155784;
return r28155785;
}
double f(double x, double y, double z, double t) {
double r28155786 = z;
double r28155787 = -5.4355961856746975e+39;
bool r28155788 = r28155786 <= r28155787;
double r28155789 = x;
double r28155790 = cbrt(r28155789);
double r28155791 = 2.0;
double r28155792 = r28155791 * r28155790;
double r28155793 = r28155790 * r28155792;
double r28155794 = y;
double r28155795 = t;
double r28155796 = r28155794 - r28155795;
double r28155797 = r28155793 / r28155796;
double r28155798 = r28155790 / r28155786;
double r28155799 = r28155797 * r28155798;
double r28155800 = 1.3604186575337987e-93;
bool r28155801 = r28155786 <= r28155800;
double r28155802 = r28155791 * r28155789;
double r28155803 = r28155786 * r28155796;
double r28155804 = r28155802 / r28155803;
double r28155805 = r28155801 ? r28155804 : r28155799;
double r28155806 = r28155788 ? r28155799 : r28155805;
return r28155806;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.9 |
|---|---|
| Target | 2.0 |
| Herbie | 1.9 |
if z < -5.4355961856746975e+39 or 1.3604186575337987e-93 < z Initial program 10.1
Simplified2.4
rmApplied *-un-lft-identity2.4
Applied add-cube-cbrt2.9
Applied times-frac2.9
Applied associate-*r*1.6
Simplified1.6
if -5.4355961856746975e+39 < z < 1.3604186575337987e-93Initial program 2.3
Simplified10.8
rmApplied *-un-lft-identity10.8
Applied add-cube-cbrt11.6
Applied times-frac11.6
Applied associate-*r*9.5
Simplified9.5
rmApplied associate-*r/10.9
Simplified10.0
rmApplied div-inv10.1
Applied associate-/l*2.4
Simplified2.3
Final simplification1.9
herbie shell --seed 2019165
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))