\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;y \le -6.331642673845817 \cdot 10^{-16}:\\
\;\;\;\;\frac{1}{\frac{z - y}{x - y}} \cdot t\\
\mathbf{elif}\;y \le 1.20705658518626352 \cdot 10^{-250}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((y <= -6.331642673845817e-16)) {
VAR = ((double) (((double) (1.0 / ((double) (((double) (z - y)) / ((double) (x - y)))))) * t));
} else {
double VAR_1;
if ((y <= 1.2070565851862635e-250)) {
VAR_1 = ((double) (((double) (x - y)) * ((double) (t / ((double) (z - y))))));
} else {
VAR_1 = ((double) (t / ((double) (((double) (z - y)) / ((double) (x - y))))));
}
VAR = VAR_1;
}
return VAR;
}




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.3 |
if y < -6.331642673845817e-16Initial program 0.1
rmApplied clear-num0.2
if -6.331642673845817e-16 < y < 1.20705658518626352e-250Initial program 5.5
rmApplied div-inv5.6
Applied associate-*l*5.8
Simplified5.7
if 1.20705658518626352e-250 < y Initial program 1.7
rmApplied clear-num1.9
rmApplied associate-*l/1.7
Simplified1.7
Final simplification2.3
herbie shell --seed 2020171
(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))