\frac{x - y}{z - y} \cdot t\begin{array}{l}
\mathbf{if}\;\frac{x - y}{z - y} \leq -2.2475450344196267 \cdot 10^{+174}:\\
\;\;\;\;\frac{x - y}{\frac{z - y}{t}}\\
\mathbf{elif}\;\frac{x - y}{z - y} \leq 5.268035432138612 \cdot 10^{+122}:\\
\;\;\;\;\frac{x - y}{z - y} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x - y\right) \cdot t\right) \cdot \frac{1}{z - 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)) -2.2475450344196267e+174)
(/ (- x y) (/ (- z y) t))
(if (<= (/ (- x y) (- z y)) 5.268035432138612e+122)
(* (/ (- x y) (- z y)) t)
(* (* (- x y) t) (/ 1.0 (- z 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 VAR;
if (((((double) (x - y)) / ((double) (z - y))) <= -2.2475450344196267e+174)) {
VAR = (((double) (x - y)) / (((double) (z - y)) / t));
} else {
double VAR_1;
if (((((double) (x - y)) / ((double) (z - y))) <= 5.268035432138612e+122)) {
VAR_1 = ((double) ((((double) (x - y)) / ((double) (z - y))) * t));
} else {
VAR_1 = ((double) (((double) (((double) (x - y)) * t)) * (1.0 / ((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.1 |
|---|---|
| Target | 2.1 |
| Herbie | 1.4 |
if (/ (- x y) (- z y)) < -2.2475450344196267e174Initial program 14.5
Simplified1.7
rmApplied clear-num1.8
rmApplied un-div-inv1.7
if -2.2475450344196267e174 < (/ (- x y) (- z y)) < 5.2680354321386121e122Initial program 1.1
if 5.2680354321386121e122 < (/ (- x y) (- z y)) Initial program 9.7
Simplified3.0
rmApplied div-inv3.1
Applied associate-*r*6.1
Final simplification1.4
herbie shell --seed 2020198
(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))