\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -7.87198614559774051 \cdot 10^{-149} \lor \neg \left(x \le 5.9189247350309146 \cdot 10^{32}\right):\\
\;\;\;\;\frac{1}{z} \cdot \frac{x}{\frac{y - t}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{\frac{y - t}{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 <= -7.87198614559774e-149) || !(x <= 5.9189247350309146e+32))) {
VAR = ((1.0 / z) * (x / ((y - t) / 2.0)));
} else {
VAR = ((x / z) * (1.0 / ((y - t) / 2.0)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 2.3 |
| Herbie | 2.9 |
if x < -7.87198614559774e-149 or 5.9189247350309146e+32 < x Initial program 9.6
Simplified8.7
rmApplied *-un-lft-identity8.7
Applied times-frac8.7
Applied *-un-lft-identity8.7
Applied times-frac3.2
Simplified3.2
if -7.87198614559774e-149 < x < 5.9189247350309146e+32Initial program 3.7
Simplified2.2
rmApplied *-un-lft-identity2.2
Applied times-frac2.2
Applied *-un-lft-identity2.2
Applied times-frac8.0
Simplified8.0
rmApplied div-inv8.1
Applied associate-*r*2.4
Simplified2.4
Final simplification2.9
herbie shell --seed 2020075 +o rules:numerics
(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))))