\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -8.7095500561207664 \cdot 10^{-135} \lor \neg \left(x \le 4.34026309072543928 \cdot 10^{-65}\right):\\
\;\;\;\;\frac{x \cdot \frac{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 (((x <= -8.709550056120766e-135) || !(x <= 4.340263090725439e-65))) {
VAR = ((double) (((double) (x * ((double) (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.0 |
| Herbie | 2.8 |
if x < -8.709550056120766e-135 or 4.340263090725439e-65 < x Initial program 8.5
Simplified7.6
rmApplied div-inv7.7
Simplified7.2
rmApplied associate-*r/3.0
if -8.709550056120766e-135 < x < 4.340263090725439e-65Initial program 3.6
Simplified2.4
Final simplification2.8
herbie shell --seed 2020140
(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))))