\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -1.8696670555545807 \cdot 10^{29} \lor \neg \left(x \le 1.30690342494927769 \cdot 10^{-156}\right):\\
\;\;\;\;\frac{1}{z} \cdot \frac{x}{\frac{y - t}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z \cdot \left(y - t\right)}{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 (((x <= -1.8696670555545807e+29) || !(x <= 1.3069034249492777e-156))) {
VAR = ((double) (((double) (1.0 / z)) * ((double) (x / ((double) (((double) (y - t)) / 2.0))))));
} else {
VAR = ((double) (x / ((double) (((double) (z * ((double) (y - t)))) / 2.0))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 2.4 |
| Herbie | 2.9 |
if x < -1.8696670555545807e29 or 1.30690342494927769e-156 < x Initial program 10.1
Simplified9.1
rmApplied *-un-lft-identity9.1
Applied times-frac9.1
Applied *-un-lft-identity9.1
Applied times-frac3.3
Simplified3.3
if -1.8696670555545807e29 < x < 1.30690342494927769e-156Initial program 3.6
Simplified2.3
Final simplification2.9
herbie shell --seed 2020164
(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))))