\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -4.85974510053629948 \cdot 10^{93}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\
\mathbf{elif}\;t \le 251943645497111511000:\\
\;\;\;\;\left(\left(x - z\right) \cdot t\right) \cdot y + \left(y \cdot \mathsf{fma}\left(-z, 1, z\right)\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - 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 ((t <= -4.8597451005362995e+93)) {
VAR = ((double) (t * ((double) (y * ((double) (x - z))))));
} else {
double VAR_1;
if ((t <= 2.519436454971115e+20)) {
VAR_1 = ((double) (((double) (((double) (((double) (x - z)) * t)) * y)) + ((double) (((double) (y * ((double) fma(((double) -(z)), 1.0, z)))) * t))));
} else {
VAR_1 = ((double) (((double) (t * y)) * ((double) (x - 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.8 |
|---|---|
| Target | 2.8 |
| Herbie | 2.9 |
if t < -4.8597451005362995e+93Initial program 3.9
Simplified3.9
if -4.8597451005362995e+93 < t < 2.519436454971115e+20Initial program 8.2
Simplified8.2
rmApplied add-cube-cbrt8.6
Applied add-cube-cbrt9.0
Applied prod-diff9.0
Applied distribute-lft-in9.0
Applied distribute-lft-in9.0
Simplified6.7
Simplified2.8
rmApplied *-un-lft-identity2.8
Applied associate-*r*2.8
Simplified2.3
if 2.519436454971115e+20 < t Initial program 2.9
Simplified2.9
rmApplied associate-*r*4.3
Final simplification2.9
herbie shell --seed 2020123 +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))