\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \cdot t \le -4.51241993351951109 \cdot 10^{-4}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \frac{t}{z - y}}{1}\\
\mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le -0.0:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\mathbf{elif}\;\frac{x - y}{z - y} \cdot t \le 2.56785160016953404 \cdot 10^{278}:\\
\;\;\;\;\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 (((((x - y) / (z - y)) * t) <= -0.0004512419933519511)) {
temp = (((x - y) * (t / (z - y))) / 1.0);
} else {
double temp_1;
if (((((x - y) / (z - y)) * t) <= -0.0)) {
temp_1 = (((x - y) * t) / (z - y));
} else {
double temp_2;
if (((((x - y) / (z - y)) * t) <= 2.567851600169534e+278)) {
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.2 |
|---|---|
| Target | 2.2 |
| Herbie | 1.3 |
if (* (/ (- x y) (- z y)) t) < -0.0004512419933519511 or 2.567851600169534e+278 < (* (/ (- x y) (- z y)) t) Initial program 3.9
rmApplied *-un-lft-identity3.9
Applied add-cube-cbrt5.0
Applied times-frac5.0
Applied associate-*l*2.9
rmApplied associate-*l/2.9
Simplified2.5
if -0.0004512419933519511 < (* (/ (- x y) (- z y)) t) < -0.0Initial program 3.3
rmApplied associate-*l/1.7
if -0.0 < (* (/ (- x y) (- z y)) t) < 2.567851600169534e+278Initial program 0.2
Final simplification1.3
herbie shell --seed 2020058 +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))