\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \cdot 2 \le -1.58093999559816937 \cdot 10^{78} \lor \neg \left(x \cdot 2 \le 1.4938831530347273 \cdot 10^{125}\right):\\
\;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{2}{z}}{y - t}\\
\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.5809399955981694e+78) || !(((double) (x * 2.0)) <= 1.4938831530347273e+125))) {
VAR = ((double) (((double) (x * ((double) (2.0 / ((double) (y - t)))))) / z));
} else {
VAR = ((double) (((double) (x * ((double) (2.0 / z)))) / ((double) (y - t))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.3 |
| Herbie | 3.0 |
if (* x 2.0) < -1.58093999559816937e78 or 1.4938831530347273e125 < (* x 2.0) Initial program 13.8
Simplified13.5
rmApplied *-un-lft-identity13.5
Applied times-frac12.7
Applied associate-*r*14.5
Simplified14.4
rmApplied associate-*l/3.6
if -1.58093999559816937e78 < (* x 2.0) < 1.4938831530347273e125Initial program 3.9
Simplified2.8
rmApplied *-un-lft-identity2.8
Applied times-frac2.7
Applied associate-*r*2.8
Simplified2.8
rmApplied associate-*r/2.7
rmApplied *-un-lft-identity2.7
Applied associate-/r*2.7
Simplified2.8
Final simplification3.0
herbie shell --seed 2020179
(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))))