\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \leq -5.0242384471013485 \cdot 10^{-142}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\mathbf{elif}\;\frac{x - y}{z - y} \leq 8.09038377874979 \cdot 10^{-247}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x - y}}\\
\end{array}(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
(FPCore (x y z t)
:precision binary64
(if (<= (/ (- x y) (- z y)) -5.0242384471013485e-142)
(* (/ (- x y) (- z y)) t)
(if (<= (/ (- x y) (- z y)) 8.09038377874979e-247)
(/ (* (- x y) t) (- z y))
(/ t (/ (- z y) (- x y))))))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 tmp;
if (((((double) (x - y)) / ((double) (z - y))) <= -5.0242384471013485e-142)) {
tmp = ((double) ((((double) (x - y)) / ((double) (z - y))) * t));
} else {
double tmp_1;
if (((((double) (x - y)) / ((double) (z - y))) <= 8.09038377874979e-247)) {
tmp_1 = (((double) (((double) (x - y)) * t)) / ((double) (z - y)));
} else {
tmp_1 = (t / (((double) (z - y)) / ((double) (x - y))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.1 |
| Herbie | 1.4 |
if (/ (- x y) (- z y)) < -5.02423844710134845e-142Initial program Error: 2.7 bits
if -5.02423844710134845e-142 < (/ (- x y) (- z y)) < 8.0903837787497904e-247Initial program Error: 6.9 bits
rmApplied associate-*l/Error: 2.0 bits
if 8.0903837787497904e-247 < (/ (- x y) (- z y)) Initial program Error: 0.9 bits
rmApplied clear-numError: 0.9 bits
rmApplied associate-*l/Error: 0.8 bits
SimplifiedError: 0.8 bits
Final simplificationError: 1.4 bits
herbie shell --seed 2020204
(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))