\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;y \cdot z - t \cdot z = -inf.0 \lor \neg \left(y \cdot z - t \cdot z \le 8.65665439724964936 \cdot 10^{235}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\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) (y * z)) - ((double) (t * z)))) <= -inf.0) || !(((double) (((double) (y * z)) - ((double) (t * z)))) <= 8.656654397249649e+235))) {
VAR = ((double) (((double) (x / z)) / ((double) (((double) (y - t)) / 2.0))));
} else {
VAR = ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z))))));
}
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.3 |
if (- (* y z) (* t z)) < -inf.0 or 8.65665439724964936e235 < (- (* y z) (* t z)) Initial program 20.5
Simplified17.1
rmApplied *-un-lft-identity17.1
Applied times-frac17.0
Applied associate-/r*0.2
Simplified0.2
if -inf.0 < (- (* y z) (* t z)) < 8.65665439724964936e235Initial program 1.7
Final simplification1.3
herbie shell --seed 2020161
(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))))