\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 r347716 = x;
double r347717 = y;
double r347718 = r347716 - r347717;
double r347719 = z;
double r347720 = r347719 - r347717;
double r347721 = r347718 / r347720;
double r347722 = t;
double r347723 = r347721 * r347722;
return r347723;
}
double f(double x, double y, double z, double t) {
double r347724 = x;
double r347725 = y;
double r347726 = r347724 - r347725;
double r347727 = z;
double r347728 = r347727 - r347725;
double r347729 = r347726 / r347728;
double r347730 = -1.4623181854011083e+117;
bool r347731 = r347729 <= r347730;
double r347732 = -7.398316728801853e-92;
bool r347733 = r347729 <= r347732;
double r347734 = !r347733;
double r347735 = -0.0;
bool r347736 = r347729 <= r347735;
bool r347737 = r347734 && r347736;
bool r347738 = r347731 || r347737;
double r347739 = t;
double r347740 = r347726 * r347739;
double r347741 = r347740 / r347728;
double r347742 = r347729 * r347739;
double r347743 = r347738 ? r347741 : r347742;
return r347743;
}




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
(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))