\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} \le -1.155592915 \cdot 10^{-316} \lor \neg \left(\frac{x \cdot 2}{y \cdot z - t \cdot z} \le 1.9845465115045894 \cdot 10^{-307} \lor \neg \left(\frac{x \cdot 2}{y \cdot z - t \cdot z} \le 1.45759195591732944 \cdot 10^{254}\right)\right):\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{x}{\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) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z)))))) <= -1.1555929154844e-316) || !((((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z)))))) <= 1.9845465115045894e-307) || !(((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z)))))) <= 1.4575919559173294e+254)))) {
VAR = ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z))))));
} else {
VAR = ((double) (((double) (1.0 / z)) * ((double) (x / ((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 | 7.0 |
|---|---|
| Target | 2.2 |
| Herbie | 1.1 |
if (/ (* x 2.0) (- (* y z) (* t z))) < -1.155592915e-316 or 1.9845465115045894e-307 < (/ (* x 2.0) (- (* y z) (* t z))) < 1.45759195591732944e254Initial program 1.1
if -1.155592915e-316 < (/ (* x 2.0) (- (* y z) (* t z))) < 1.9845465115045894e-307 or 1.45759195591732944e254 < (/ (* x 2.0) (- (* y z) (* t z))) Initial program 17.1
Simplified14.2
rmApplied *-un-lft-identity14.2
Applied times-frac14.1
Applied *-un-lft-identity14.1
Applied times-frac1.1
Simplified1.1
Final simplification1.1
herbie shell --seed 2020171
(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))))