\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le -3.5529422832783068 \cdot 10^{-233}:\\
\;\;\;\;\frac{t}{\frac{z}{x - y} - \frac{y}{x - y}}\\
\mathbf{elif}\;y \le 1.37815582627985086 \cdot 10^{-70}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\end{array}double code(double x, double y, double z, double t) {
return (((x - y) / (z - y)) * t);
}
double code(double x, double y, double z, double t) {
double VAR;
if ((y <= -3.552942283278307e-233)) {
VAR = (t / ((z / (x - y)) - (y / (x - y))));
} else {
double VAR_1;
if ((y <= 1.3781558262798509e-70)) {
VAR_1 = (((x - y) * t) / (z - y));
} else {
VAR_1 = (((x - y) / (z - y)) * t);
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.0 |
| Herbie | 2.1 |
if y < -3.552942283278307e-233Initial program 1.3
rmApplied clear-num1.4
Applied associate-*l/1.3
Simplified1.3
rmApplied div-sub1.3
if -3.552942283278307e-233 < y < 1.3781558262798509e-70Initial program 5.6
rmApplied associate-*l/5.8
if 1.3781558262798509e-70 < y Initial program 0.3
Final simplification2.1
herbie shell --seed 2020071 +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))