\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -6.5010644488975887 \cdot 10^{94} \lor \neg \left(x \le 3.8619926413929668 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{2}{z} \cdot \frac{x}{y - t}\\
\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 ((x * 2.0) / ((y * z) - (t * z)));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((x <= -6.501064448897589e+94) || !(x <= 3.861992641392967e-62))) {
VAR = ((2.0 / z) * (x / (y - t)));
} else {
VAR = (x / ((z * (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.8 |
|---|---|
| Target | 2.1 |
| Herbie | 2.6 |
if x < -6.501064448897589e+94 or 3.861992641392967e-62 < x Initial program 10.9
Simplified10.1
rmApplied associate-/l*10.2
Applied associate-/r/10.9
rmApplied clear-num11.0
Applied associate-*l/10.2
Simplified10.2
rmApplied div-inv10.3
Applied div-inv10.3
Applied times-frac3.2
Simplified3.1
if -6.501064448897589e+94 < x < 3.861992641392967e-62Initial program 3.7
Simplified2.3
Final simplification2.6
herbie shell --seed 2020078
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))
(/ (* x 2) (- (* y z) (* t z))))