\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -1.571978557789964 \cdot 10^{-66} \lor \neg \left(x \le 4.11446484511653814 \cdot 10^{73}\right):\\
\;\;\;\;\frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\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.571978557789964e-66) || !(x <= 4.114464845116538e+73))) {
VAR = ((double) (((double) (x / ((double) (((double) (y - t)) / 2.0)))) / z));
} 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 | 6.8 |
|---|---|
| Target | 2.2 |
| Herbie | 2.3 |
if x < -1.571978557789964e-66 or 4.11446484511653814e73 < x Initial program 11.2
Simplified10.1
rmApplied *-un-lft-identity10.1
Applied times-frac10.1
Applied *-un-lft-identity10.1
Applied times-frac2.9
Simplified2.9
rmApplied associate-*l/2.8
Simplified2.8
if -1.571978557789964e-66 < x < 4.11446484511653814e73Initial program 3.2
Simplified1.9
Final simplification2.3
herbie shell --seed 2020162
(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))))