\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;y \cdot z - z \cdot t \leq -2.1972034064024037 \cdot 10^{+202} \lor \neg \left(y \cdot z - z \cdot t \leq 2.478330206236893 \cdot 10^{+183}\right):\\
\;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - z \cdot t}\\
\end{array}double code(double x, double y, double z, double t) {
return (((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) (y * z)) - ((double) (z * t)))) <= -2.1972034064024037e+202) || !(((double) (((double) (y * z)) - ((double) (z * t)))) <= 2.478330206236893e+183))) {
VAR = (((double) ((x / z) * 2.0)) / ((double) (y - t)));
} else {
VAR = (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (z * t)))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.9 |
|---|---|
| Target | 2.1 |
| Herbie | 1.4 |
if (- (* y z) (* t z)) < -2.19720340640240374e202 or 2.47833020623689287e183 < (- (* y z) (* t z)) Initial program 14.7
Simplified12.2
rmApplied *-un-lft-identity12.2
Applied times-frac11.3
Applied associate-*r*0.7
Simplified0.7
rmApplied associate-*r/0.7
if -2.19720340640240374e202 < (- (* y z) (* t z)) < 2.47833020623689287e183Initial program 1.9
Final simplification1.4
herbie shell --seed 2020199
(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))))