\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -1.0685273149765291 \cdot 10^{-7} \lor \neg \left(y \le 1.21955483733648284 \cdot 10^{-250}\right):\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x * y)) - ((double) (z * y)))) * t));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((y <= -1.0685273149765291e-07) || !(y <= 1.2195548373364828e-250))) {
VAR = ((double) (((double) (t * y)) * ((double) (x - z))));
} else {
VAR = ((double) (t * ((double) (y * ((double) (x - z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 3.2 |
| Herbie | 4.1 |
if y < -1.0685273149765291e-07 or 1.2195548373364828e-250 < y Initial program 9.8
Simplified9.8
rmApplied associate-*r*4.9
if -1.0685273149765291e-07 < y < 1.2195548373364828e-250Initial program 2.9
Simplified2.9
Final simplification4.1
herbie shell --seed 2020122 +o rules:numerics
(FPCore (x y z t)
:name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))
(* (- (* x y) (* z y)) t))