\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \cdot t \leq -4.246092202844289 \cdot 10^{+25}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{elif}\;\frac{x - y}{z - y} \cdot t \leq -0:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{x}{z - y} - \frac{y}{z - y}\right)\\
\end{array}double code(double x, double y, double z, double t) {
return ((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))) * t)) <= -4.246092202844289e+25)) {
VAR = ((double) (((double) (x - y)) * (t / ((double) (z - y)))));
} else {
double VAR_1;
if ((((double) ((((double) (x - y)) / ((double) (z - y))) * t)) <= -0.0)) {
VAR_1 = (((double) (((double) (x - y)) * t)) / ((double) (z - y)));
} else {
VAR_1 = ((double) (t * ((double) ((x / ((double) (z - y))) - (y / ((double) (z - 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.3 |
| Herbie | 1.6 |
if (* (/ (- x y) (- z y)) t) < -4.24609220284428913e25Initial program 2.7
Simplified2.4
if -4.24609220284428913e25 < (* (/ (- x y) (- z y)) t) < -0.0Initial program 2.9
rmApplied associate-*l/1.2
if -0.0 < (* (/ (- x y) (- z y)) t) Initial program 1.5
rmApplied div-sub1.5
Final simplification1.6
herbie shell --seed 2020196
(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))