\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 r21091134 = x;
double r21091135 = y;
double r21091136 = r21091134 - r21091135;
double r21091137 = z;
double r21091138 = r21091137 - r21091135;
double r21091139 = r21091136 / r21091138;
double r21091140 = t;
double r21091141 = r21091139 * r21091140;
return r21091141;
}
double f(double x, double y, double z, double t) {
double r21091142 = y;
double r21091143 = -1.8586745194188488e-190;
bool r21091144 = r21091142 <= r21091143;
double r21091145 = t;
double r21091146 = z;
double r21091147 = r21091146 - r21091142;
double r21091148 = x;
double r21091149 = r21091148 - r21091142;
double r21091150 = r21091147 / r21091149;
double r21091151 = r21091145 / r21091150;
double r21091152 = 6.790926987711054e-54;
bool r21091153 = r21091142 <= r21091152;
double r21091154 = r21091145 * r21091149;
double r21091155 = r21091154 / r21091147;
double r21091156 = r21091153 ? r21091155 : r21091151;
double r21091157 = r21091144 ? r21091151 : r21091156;
return r21091157;
}




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