\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} = -\infty:\\
\;\;\;\;\frac{\frac{\left(x - y\right) \cdot t}{z - y}}{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\end{array}double f(double x, double y, double z, double t) {
double r419317 = x;
double r419318 = y;
double r419319 = r419317 - r419318;
double r419320 = z;
double r419321 = r419320 - r419318;
double r419322 = r419319 / r419321;
double r419323 = t;
double r419324 = r419322 * r419323;
return r419324;
}
double f(double x, double y, double z, double t) {
double r419325 = x;
double r419326 = y;
double r419327 = r419325 - r419326;
double r419328 = z;
double r419329 = r419328 - r419326;
double r419330 = r419327 / r419329;
double r419331 = -inf.0;
bool r419332 = r419330 <= r419331;
double r419333 = t;
double r419334 = r419327 * r419333;
double r419335 = r419334 / r419329;
double r419336 = 1.0;
double r419337 = r419335 / r419336;
double r419338 = r419330 * r419333;
double r419339 = r419332 ? r419337 : r419338;
return r419339;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.2 |
| Herbie | 1.6 |
if (/ (- x y) (- z y)) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied add-cube-cbrt64.0
Applied times-frac64.0
Applied associate-*l*8.2
rmApplied associate-*l/8.2
Simplified0.3
rmApplied associate-*r/0.3
if -inf.0 < (/ (- x y) (- z y)) Initial program 1.6
Final simplification1.6
herbie shell --seed 2020021 +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))