\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -5.62056246049488059 \cdot 10^{171}:\\
\;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\
\mathbf{elif}\;x \cdot y - z \cdot y \le -4.0135363704689411 \cdot 10^{-187}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\
\mathbf{elif}\;x \cdot y - z \cdot y \le 4.81516 \cdot 10^{-320}:\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\
\mathbf{elif}\;x \cdot y - z \cdot y \le 1.04309193842541907 \cdot 10^{285}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(t \cdot y\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 ((((double) (((double) (x * y)) - ((double) (z * y)))) <= -5.620562460494881e+171)) {
VAR = ((double) (((double) (t * y)) * ((double) (x - z))));
} else {
double VAR_1;
if ((((double) (((double) (x * y)) - ((double) (z * y)))) <= -4.013536370468941e-187)) {
VAR_1 = ((double) (((double) (((double) (x * y)) - ((double) (z * y)))) * t));
} else {
double VAR_2;
if ((((double) (((double) (x * y)) - ((double) (z * y)))) <= 4.8151637843688e-320)) {
VAR_2 = ((double) (y * ((double) (((double) (x - z)) * t))));
} else {
double VAR_3;
if ((((double) (((double) (x * y)) - ((double) (z * y)))) <= 1.0430919384254191e+285)) {
VAR_3 = ((double) (((double) (((double) (x * y)) - ((double) (z * y)))) * t));
} else {
VAR_3 = ((double) (((double) (x - z)) * ((double) (t * y))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
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.1 |
| Herbie | 0.5 |
if (- (* x y) (* z y)) < -5.62056246049488059e171 or 1.04309193842541907e285 < (- (* x y) (* z y)) Initial program 31.3
rmApplied distribute-rgt-out--31.3
Applied associate-*l*1.5
rmApplied add-cube-cbrt2.5
Applied associate-*l*2.5
rmApplied pow12.5
Applied pow12.5
Applied pow-prod-down2.5
Applied pow12.5
Applied pow12.5
Applied pow-prod-down2.5
Applied pow-prod-down2.5
Applied pow12.5
Applied pow-prod-down2.5
Simplified1.3
if -5.62056246049488059e171 < (- (* x y) (* z y)) < -4.0135363704689411e-187 or 4.81516e-320 < (- (* x y) (* z y)) < 1.04309193842541907e285Initial program 0.3
if -4.0135363704689411e-187 < (- (* x y) (* z y)) < 4.81516e-320Initial program 12.5
rmApplied distribute-rgt-out--12.5
Applied associate-*l*0.9
Final simplification0.5
herbie shell --seed 2020181
(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))