\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \cdot 2 \le -1.7261318963864587 \cdot 10^{-129} \lor \neg \left(x \cdot 2 \le 1.8045065908215711 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{\frac{x \cdot 2}{y - t}}{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 (((((double) (x * 2.0)) <= -1.7261318963864587e-129) || !(((double) (x * 2.0)) <= 1.804506590821571e-24))) {
VAR = ((double) (((double) (((double) (x * 2.0)) / ((double) (y - t)))) / 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.7 |
|---|---|
| Target | 2.2 |
| Herbie | 2.5 |
if (* x 2.0) < -1.7261318963864587e-129 or 1.8045065908215711e-24 < (* x 2.0) Initial program 9.0
Simplified7.8
rmApplied div-inv8.0
Simplified7.4
rmApplied associate-*r/2.9
rmApplied associate-*r/2.8
if -1.7261318963864587e-129 < (* x 2.0) < 1.8045065908215711e-24Initial program 3.4
Simplified2.0
Final simplification2.5
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))))