\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le -1.015019325632516171025803372085454949037 \cdot 10^{-235} \lor \neg \left(y \le 5.462124745748530437567551822935668868763 \cdot 10^{-119}\right):\\
\;\;\;\;\left(\left(x - y\right) \cdot \frac{1}{z - y}\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\end{array}double f(double x, double y, double z, double t) {
double r460003 = x;
double r460004 = y;
double r460005 = r460003 - r460004;
double r460006 = z;
double r460007 = r460006 - r460004;
double r460008 = r460005 / r460007;
double r460009 = t;
double r460010 = r460008 * r460009;
return r460010;
}
double f(double x, double y, double z, double t) {
double r460011 = y;
double r460012 = -1.0150193256325162e-235;
bool r460013 = r460011 <= r460012;
double r460014 = 5.46212474574853e-119;
bool r460015 = r460011 <= r460014;
double r460016 = !r460015;
bool r460017 = r460013 || r460016;
double r460018 = x;
double r460019 = r460018 - r460011;
double r460020 = 1.0;
double r460021 = z;
double r460022 = r460021 - r460011;
double r460023 = r460020 / r460022;
double r460024 = r460019 * r460023;
double r460025 = t;
double r460026 = r460024 * r460025;
double r460027 = r460019 * r460025;
double r460028 = r460027 / r460022;
double r460029 = r460017 ? r460026 : r460028;
return r460029;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.2 |
| Herbie | 2.3 |
if y < -1.0150193256325162e-235 or 5.46212474574853e-119 < y Initial program 1.2
rmApplied div-inv1.3
if -1.0150193256325162e-235 < y < 5.46212474574853e-119Initial program 5.8
rmApplied div-inv5.9
Applied associate-*l*5.6
Simplified5.5
rmApplied pow15.5
Applied pow15.5
Applied pow-prod-down5.5
Simplified6.4
Final simplification2.3
herbie shell --seed 2019174 +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))