\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -8.8263896362557053 \cdot 10^{-53}:\\
\;\;\;\;\frac{\sqrt{1}}{1} \cdot \frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\mathbf{elif}\;x \le 3.4056700725501648 \cdot 10^{171}:\\
\;\;\;\;\frac{x}{\left(y - t\right) \cdot z} \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{\frac{y - t}{2}} \cdot \sqrt[3]{\frac{y - t}{2}}}}{z} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{\frac{y - t}{2}}}\\
\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 ((x <= -8.826389636255705e-53)) {
temp = ((sqrt(1.0) / 1.0) * ((x / ((y - t) / 2.0)) / z));
} else {
double temp_1;
if ((x <= 3.405670072550165e+171)) {
temp_1 = ((x / ((y - t) * z)) * 2.0);
} else {
temp_1 = ((((cbrt(x) * cbrt(x)) / (cbrt(((y - t) / 2.0)) * cbrt(((y - t) / 2.0)))) / z) * (cbrt(x) / cbrt(((y - t) / 2.0))));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.1 |
|---|---|
| Target | 2.1 |
| Herbie | 2.7 |
if x < -8.826389636255705e-53Initial program 9.9
Simplified8.9
rmApplied *-un-lft-identity8.9
Applied times-frac8.9
Applied *-un-lft-identity8.9
Applied times-frac2.4
Simplified2.4
rmApplied *-un-lft-identity2.4
Applied add-sqr-sqrt2.4
Applied times-frac2.4
Applied associate-*l*2.4
Simplified2.3
if -8.826389636255705e-53 < x < 3.405670072550165e+171Initial program 4.3
Simplified2.9
rmApplied *-un-lft-identity2.9
Applied times-frac2.9
Applied *-un-lft-identity2.9
Applied times-frac6.9
Simplified6.9
rmApplied associate-/r/6.9
Applied associate-*r*6.9
Simplified2.9
if 3.405670072550165e+171 < x Initial program 17.8
Simplified17.5
rmApplied *-un-lft-identity17.5
Applied times-frac17.5
Applied *-un-lft-identity17.5
Applied times-frac4.6
Simplified4.6
rmApplied add-cube-cbrt5.5
Applied add-cube-cbrt5.6
Applied times-frac5.6
Applied associate-*r*1.8
Simplified1.7
Final simplification2.7
herbie shell --seed 2020049 +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))))