\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -1.68361982243040008 \cdot 10^{31} \lor \neg \left(t \le 4.2319166616304514 \cdot 10^{-10}\right):\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y\\
\end{array}double f(double x, double y, double z, double t) {
double r538510 = x;
double r538511 = y;
double r538512 = r538510 * r538511;
double r538513 = z;
double r538514 = r538513 * r538511;
double r538515 = r538512 - r538514;
double r538516 = t;
double r538517 = r538515 * r538516;
return r538517;
}
double f(double x, double y, double z, double t) {
double r538518 = t;
double r538519 = -1.6836198224304e+31;
bool r538520 = r538518 <= r538519;
double r538521 = 4.2319166616304514e-10;
bool r538522 = r538518 <= r538521;
double r538523 = !r538522;
bool r538524 = r538520 || r538523;
double r538525 = x;
double r538526 = z;
double r538527 = r538525 - r538526;
double r538528 = y;
double r538529 = r538518 * r538528;
double r538530 = r538527 * r538529;
double r538531 = r538527 * r538518;
double r538532 = r538531 * r538528;
double r538533 = r538524 ? r538530 : r538532;
return r538533;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.1 |
|---|---|
| Target | 3.3 |
| Herbie | 2.8 |
if t < -1.6836198224304e+31 or 4.2319166616304514e-10 < t Initial program 3.4
Simplified3.4
rmApplied associate-*r*3.7
rmApplied *-commutative3.7
if -1.6836198224304e+31 < t < 4.2319166616304514e-10Initial program 9.3
Simplified9.3
rmApplied associate-*r*8.6
rmApplied *-commutative8.6
rmApplied associate-*r*2.3
Final simplification2.8
herbie shell --seed 2020018
(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))