\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le -1.8586745194188488 \cdot 10^{-190}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\mathbf{elif}\;y \le 6.790926987711054 \cdot 10^{-54}:\\
\;\;\;\;\frac{t \cdot \left(x - y\right)}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\end{array}double f(double x, double y, double z, double t) {
double r14612116 = x;
double r14612117 = y;
double r14612118 = r14612116 - r14612117;
double r14612119 = z;
double r14612120 = r14612119 - r14612117;
double r14612121 = r14612118 / r14612120;
double r14612122 = t;
double r14612123 = r14612121 * r14612122;
return r14612123;
}
double f(double x, double y, double z, double t) {
double r14612124 = y;
double r14612125 = -1.8586745194188488e-190;
bool r14612126 = r14612124 <= r14612125;
double r14612127 = t;
double r14612128 = z;
double r14612129 = r14612128 - r14612124;
double r14612130 = x;
double r14612131 = r14612130 - r14612124;
double r14612132 = r14612129 / r14612131;
double r14612133 = r14612127 / r14612132;
double r14612134 = 6.790926987711054e-54;
bool r14612135 = r14612124 <= r14612134;
double r14612136 = r14612127 * r14612131;
double r14612137 = r14612136 / r14612129;
double r14612138 = r14612135 ? r14612137 : r14612133;
double r14612139 = r14612126 ? r14612133 : r14612138;
return r14612139;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.2 |
| Herbie | 2.1 |
if y < -1.8586745194188488e-190 or 6.790926987711054e-54 < y Initial program 0.8
rmApplied clear-num0.9
rmApplied associate-*l/0.8
Simplified0.8
if -1.8586745194188488e-190 < y < 6.790926987711054e-54Initial program 5.6
rmApplied associate-*l/5.5
Final simplification2.1
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))