\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \le -4.52641419959651135 \cdot 10^{207}:\\
\;\;\;\;t + \left(x \cdot \left(z - t\right)\right) \cdot \frac{1}{y}\\
\mathbf{elif}\;\frac{x}{y} \le -2.748550332250791 \cdot 10^{-156} \lor \neg \left(\frac{x}{y} \le 2.75702788663815959 \cdot 10^{-196}\right):\\
\;\;\;\;t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{\frac{y}{z - t}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (((double) (x / y)) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (x / y)) <= -4.5264141995965114e+207)) {
VAR = ((double) (t + ((double) (((double) (x * ((double) (z - t)))) * ((double) (1.0 / y))))));
} else {
double VAR_1;
if (((((double) (x / y)) <= -2.7485503322507914e-156) || !(((double) (x / y)) <= 2.7570278866381596e-196))) {
VAR_1 = ((double) (t + ((double) (((double) (x / y)) * ((double) (z - t))))));
} else {
VAR_1 = ((double) (t + ((double) (x / ((double) (y / ((double) (z - t))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 2.1 |
| Herbie | 1.0 |
if (/ x y) < -4.52641419959651135e207Initial program 18.7
rmApplied associate-*l/1.7
rmApplied div-inv1.8
if -4.52641419959651135e207 < (/ x y) < -2.748550332250791e-156 or 2.75702788663815959e-196 < (/ x y) Initial program 1.2
if -2.748550332250791e-156 < (/ x y) < 2.75702788663815959e-196Initial program 1.7
rmApplied associate-*l/0.9
rmApplied associate-/l*0.6
Final simplification1.0
herbie shell --seed 2020181
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(if (< z 2.759456554562692e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))