\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \cdot 2 \le -2.9080428238520309 \cdot 10^{55} \lor \neg \left(x \cdot 2 \le 1.58427096156901342 \cdot 10^{25} \lor \neg \left(x \cdot 2 \le 4.11619513766925435 \cdot 10^{272}\right)\right):\\
\;\;\;\;\frac{1}{z} \cdot \frac{x}{\frac{y - t}{2}}\\
\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 (((((double) (x * 2.0)) <= -2.908042823852031e+55) || !((((double) (x * 2.0)) <= 1.5842709615690134e+25) || !(((double) (x * 2.0)) <= 4.1161951376692544e+272)))) {
VAR = ((double) (((double) (1.0 / z)) * ((double) (x / ((double) (((double) (y - t)) / 2.0))))));
} else {
VAR = ((double) (((double) (x / z)) / ((double) (((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 | 6.4 |
|---|---|
| Target | 2.1 |
| Herbie | 2.5 |
if (* x 2.0) < -2.908042823852031e+55 or 1.5842709615690134e+25 < (* x 2.0) < 4.1161951376692544e+272Initial program 10.9
Simplified10.3
rmApplied *-un-lft-identity10.3
Applied times-frac10.3
Applied *-un-lft-identity10.3
Applied times-frac2.7
Simplified2.7
if -2.908042823852031e+55 < (* x 2.0) < 1.5842709615690134e+25 or 4.1161951376692544e+272 < (* x 2.0) Initial program 3.8
Simplified2.5
rmApplied *-un-lft-identity2.5
Applied times-frac2.5
Applied associate-/r*2.5
Simplified2.5
Final simplification2.5
herbie shell --seed 2020148
(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))))