\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;y \le -2.68352422182606035 \cdot 10^{45}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\
\mathbf{elif}\;y \le 2.165575148717488 \cdot 10^{-97}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot x\right) - y \cdot \left(t \cdot z\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 <= -2.6835242218260603e+45)) {
VAR = ((double) (((double) (y * t)) * ((double) (x - z))));
} else {
double VAR_1;
if ((y <= 2.165575148717488e-97)) {
VAR_1 = ((double) (t * ((double) (y * ((double) (x - z))))));
} else {
VAR_1 = ((double) (((double) (y * ((double) (t * x)))) - ((double) (y * ((double) (t * z))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.9 |
|---|---|
| Target | 3.3 |
| Herbie | 2.9 |
if y < -2.68352422182606035e45Initial program 18.0
Simplified4.1
rmApplied associate-*r*4.3
if -2.68352422182606035e45 < y < 2.165575148717488e-97Initial program 2.4
rmApplied *-un-lft-identity2.4
Applied associate-*r*2.4
Simplified2.4
if 2.165575148717488e-97 < y Initial program 10.3
Simplified3.1
rmApplied sub-neg3.1
Applied distribute-lft-in3.1
Applied distribute-lft-in3.1
Final simplification2.9
herbie shell --seed 2020185
(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))