\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - y \cdot z \leq -7.061304053484176 \cdot 10^{+159}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\
\mathbf{elif}\;x \cdot y - y \cdot z \leq -7.819455715384067 \cdot 10^{-206}:\\
\;\;\;\;t \cdot \left(y \cdot \left(x - z\right)\right)\\
\mathbf{elif}\;x \cdot y - y \cdot z \leq 2.8211894865769658 \cdot 10^{-242}:\\
\;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\
\mathbf{elif}\;x \cdot y - y \cdot z \leq 1.600834896909424 \cdot 10^{+294}:\\
\;\;\;\;\left(x \cdot y - y \cdot z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\
\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)) -7.061304053484176e+159)
(* (* y t) (- x z))
(if (<= (- (* x y) (* y z)) -7.819455715384067e-206)
(* t (* y (- x z)))
(if (<= (- (* x y) (* y z)) 2.8211894865769658e-242)
(* y (* t (- x z)))
(if (<= (- (* x y) (* y z)) 1.600834896909424e+294)
(* (- (* x y) (* y z)) t)
(* (* y t) (- x z)))))))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)) <= -7.061304053484176e+159) {
tmp = (y * t) * (x - z);
} else if (((x * y) - (y * z)) <= -7.819455715384067e-206) {
tmp = t * (y * (x - z));
} else if (((x * y) - (y * z)) <= 2.8211894865769658e-242) {
tmp = y * (t * (x - z));
} else if (((x * y) - (y * z)) <= 1.600834896909424e+294) {
tmp = ((x * y) - (y * z)) * t;
} else {
tmp = (y * t) * (x - z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.7 |
|---|---|
| Target | 3.2 |
| Herbie | 0.5 |
if (-.f64 (*.f64 x y) (*.f64 z y)) < -7.0613040534841755e159 or 1.6008348969094239e294 < (-.f64 (*.f64 x y) (*.f64 z y)) Initial program 31.9
Simplified1.5
if -7.0613040534841755e159 < (-.f64 (*.f64 x y) (*.f64 z y)) < -7.8194557153840671e-206Initial program 0.3
Simplified0.3
if -7.8194557153840671e-206 < (-.f64 (*.f64 x y) (*.f64 z y)) < 2.8211894865769658e-242Initial program 8.7
Simplified0.6
if 2.8211894865769658e-242 < (-.f64 (*.f64 x y) (*.f64 z y)) < 1.6008348969094239e294Initial program 0.3
Final simplification0.5
herbie shell --seed 2021176
(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))