\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -2.0096426986404563 \cdot 10^{-132} \lor \neg \left(x \le 2.20614508628987107 \cdot 10^{42}\right):\\
\;\;\;\;\frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\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 (((x <= -2.0096426986404563e-132) || !(x <= 2.206145086289871e+42))) {
VAR = ((double) (((double) (x / ((double) (((double) (y - t)) / 2.0)))) / z));
} 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.9 |
|---|---|
| Target | 2.1 |
| Herbie | 2.6 |
if x < -2.0096426986404563e-132 or 2.20614508628987107e42 < x Initial program 9.7
Simplified8.6
rmApplied *-un-lft-identity8.6
Applied times-frac8.6
Applied *-un-lft-identity8.6
Applied times-frac3.1
Simplified3.1
rmApplied associate-*l/3.0
Simplified3.0
if -2.0096426986404563e-132 < x < 2.20614508628987107e42Initial program 3.8
Simplified2.2
rmApplied *-un-lft-identity2.2
Applied times-frac2.2
Applied associate-/r*2.2
Simplified2.2
Final simplification2.6
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))))