\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \le -1.7380019105215449 \cdot 10^{-295}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\mathbf{elif}\;\frac{x - y}{z - y} \le 2.3991963319781 \cdot 10^{-312}:\\
\;\;\;\;\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 ((((double) (((double) (x - y)) / ((double) (z - y)))) <= -1.738001910521545e-295)) {
VAR = ((double) (((double) (((double) (x - y)) / ((double) (z - y)))) * t));
} else {
double VAR_1;
if ((((double) (((double) (x - y)) / ((double) (z - y)))) <= 2.3991963319781e-312)) {
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 | 1.3 |
if (/ (- x y) (- z y)) < -1.7380019105215449e-295Initial program 2.2
if -1.7380019105215449e-295 < (/ (- x y) (- z y)) < 2.3991963319781e-312Initial program 19.6
rmApplied div-inv19.6
Applied associate-*l*0.2
Simplified0.1
if 2.3991963319781e-312 < (/ (- x y) (- z y)) Initial program 1.0
rmApplied clear-num1.1
rmApplied associate-*l/1.0
Simplified1.0
Final simplification1.3
herbie shell --seed 2020162
(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))