\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - y \cdot z \leq -1.5582939101302764 \cdot 10^{+275}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\
\mathbf{elif}\;x \cdot y - y \cdot z \leq -3.958165785224774 \cdot 10^{-133}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\
\mathbf{elif}\;x \cdot y - y \cdot z \leq 1.1155150438433126 \cdot 10^{-191} \lor \neg \left(x \cdot y - y \cdot z \leq 6.8524311405980945 \cdot 10^{+96}\right):\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\
\end{array}(FPCore (x y z t) :precision binary64 (* (- (* x y) (* z y)) t))
(FPCore (x y z t)
:precision binary64
(if (<= (- (* x y) (* y z)) -1.5582939101302764e+275)
(* y (* t (- x z)))
(if (<= (- (* x y) (* y z)) -3.958165785224774e-133)
(* t (* y (- x z)))
(if (or (<= (- (* x y) (* y z)) 1.1155150438433126e-191)
(not (<= (- (* x y) (* y z)) 6.8524311405980945e+96)))
(* (- x z) (* y t))
(* (- (* x y) (* y z)) t)))))double code(double x, double y, double z, double t) {
return ((x * y) - (z * y)) * t;
}
double code(double x, double y, double z, double t) {
double tmp;
if (((x * y) - (y * z)) <= -1.5582939101302764e+275) {
tmp = y * (t * (x - z));
} else if (((x * y) - (y * z)) <= -3.958165785224774e-133) {
tmp = t * (y * (x - z));
} else if ((((x * y) - (y * z)) <= 1.1155150438433126e-191) || !(((x * y) - (y * z)) <= 6.8524311405980945e+96)) {
tmp = (x - z) * (y * t);
} else {
tmp = ((x * y) - (y * z)) * t;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 3.2 |
| Herbie | 1.0 |
if (-.f64 (*.f64 x y) (*.f64 z y)) < -1.55829391013027639e275Initial program 48.4
Simplified0.2
if -1.55829391013027639e275 < (-.f64 (*.f64 x y) (*.f64 z y)) < -3.95816578522477369e-133Initial program 0.3
Taylor expanded around 0 0.3
Simplified0.3
if -3.95816578522477369e-133 < (-.f64 (*.f64 x y) (*.f64 z y)) < 1.1155150438433126e-191 or 6.8524311405980945e96 < (-.f64 (*.f64 x y) (*.f64 z y)) Initial program 11.7
Taylor expanded around 0 11.7
Simplified11.7
rmApplied associate-*r*_binary64_163862.3
if 1.1155150438433126e-191 < (-.f64 (*.f64 x y) (*.f64 z y)) < 6.8524311405980945e96Initial program 0.2
Final simplification1.0
herbie shell --seed 2021098
(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))