\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -5.31684019028634685 \cdot 10^{113}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\mathbf{elif}\;z \le 1.193046430717286 \cdot 10^{-177}:\\
\;\;\;\;\frac{x}{\frac{z \cdot \left(y - t\right)}{2}}\\
\mathbf{elif}\;z \le 1.42402060742132382 \cdot 10^{236}:\\
\;\;\;\;\left(\left(\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}\right) \cdot x\right) \cdot \frac{\sqrt[3]{\frac{2}{y - t}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((z <= -5.316840190286347e+113)) {
VAR = ((double) (((double) (x / z)) / ((double) (((double) (y - t)) / 2.0))));
} else {
double VAR_1;
if ((z <= 1.193046430717286e-177)) {
VAR_1 = ((double) (x / ((double) (((double) (z * ((double) (y - t)))) / 2.0))));
} else {
double VAR_2;
if ((z <= 1.4240206074213238e+236)) {
VAR_2 = ((double) (((double) (((double) (((double) cbrt(((double) (2.0 / ((double) (y - t)))))) * ((double) cbrt(((double) (2.0 / ((double) (y - t)))))))) * x)) * ((double) (((double) cbrt(((double) (2.0 / ((double) (y - t)))))) / z))));
} else {
VAR_2 = ((double) (((double) (x / z)) / ((double) (((double) (y - t)) / 2.0))));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




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 z < -5.31684019028634685e113 or 1.42402060742132382e236 < z Initial program 14.7
Simplified10.2
rmApplied *-un-lft-identity10.2
Applied times-frac10.2
Applied associate-/r*2.3
Simplified2.3
if -5.31684019028634685e113 < z < 1.193046430717286e-177Initial program 3.4
Simplified3.3
if 1.193046430717286e-177 < z < 1.42402060742132382e236Initial program 5.6
Simplified5.1
rmApplied div-inv5.2
Simplified4.8
rmApplied *-un-lft-identity4.8
Applied add-cube-cbrt5.5
Applied times-frac5.5
Applied associate-*r*2.7
Simplified2.7
Final simplification2.8
herbie shell --seed 2020168
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
: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.0450278273301259e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))