\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \le -1.462318185401108278911963335029297785762 \cdot 10^{117} \lor \neg \left(\frac{x - y}{z - y} \le -7.398316728801853286900513540804094569714 \cdot 10^{-92}\right) \land \frac{x - y}{z - y} \le -0.0:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\end{array}double f(double x, double y, double z, double t) {
double r289735 = x;
double r289736 = y;
double r289737 = r289735 - r289736;
double r289738 = z;
double r289739 = r289738 - r289736;
double r289740 = r289737 / r289739;
double r289741 = t;
double r289742 = r289740 * r289741;
return r289742;
}
double f(double x, double y, double z, double t) {
double r289743 = x;
double r289744 = y;
double r289745 = r289743 - r289744;
double r289746 = z;
double r289747 = r289746 - r289744;
double r289748 = r289745 / r289747;
double r289749 = -1.4623181854011083e+117;
bool r289750 = r289748 <= r289749;
double r289751 = -7.398316728801853e-92;
bool r289752 = r289748 <= r289751;
double r289753 = !r289752;
double r289754 = -0.0;
bool r289755 = r289748 <= r289754;
bool r289756 = r289753 && r289755;
bool r289757 = r289750 || r289756;
double r289758 = t;
double r289759 = r289745 * r289758;
double r289760 = r289759 / r289747;
double r289761 = r289748 * r289758;
double r289762 = r289757 ? r289760 : r289761;
return r289762;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.4 |
|---|---|
| Target | 2.4 |
| Herbie | 1.2 |
if (/ (- x y) (- z y)) < -1.4623181854011083e+117 or -7.398316728801853e-92 < (/ (- x y) (- z y)) < -0.0Initial program 6.9
rmApplied associate-*l/3.0
if -1.4623181854011083e+117 < (/ (- x y) (- z y)) < -7.398316728801853e-92 or -0.0 < (/ (- x y) (- z y)) Initial program 1.4
Final simplification1.2
herbie shell --seed 2019304 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))