\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;t \le -5901250107637.39355:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\
\mathbf{elif}\;t \le -5.60125657667623268 \cdot 10^{-260}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\mathbf{elif}\;t \le 2.92260991475109173 \cdot 10^{-116}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\
\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 temp;
if ((t <= -5901250107637.394)) {
temp = (((x - y) * (t / (z - y))) / 1.0);
} else {
double temp_1;
if ((t <= -5.601256576676233e-260)) {
temp_1 = (((x - y) * t) / (z - y));
} else {
double temp_2;
if ((t <= 2.922609914751092e-116)) {
temp_2 = (((x - y) / (z - y)) * t);
} else {
temp_2 = (((x - y) * (t / (z - y))) / 1.0);
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.4 |
|---|---|
| Target | 2.3 |
| Herbie | 3.0 |
if t < -5901250107637.394 or 2.922609914751092e-116 < t Initial program 2.2
rmApplied *-un-lft-identity2.2
Applied add-cube-cbrt3.3
Applied times-frac3.3
Applied associate-*l*3.1
rmApplied associate-*l/3.1
Simplified3.7
if -5901250107637.394 < t < -5.601256576676233e-260Initial program 2.3
rmApplied associate-*l/1.5
if -5.601256576676233e-260 < t < 2.922609914751092e-116Initial program 2.9
Final simplification3.0
herbie shell --seed 2020057 +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))