\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \le -5.46900420303610325 \cdot 10^{66}:\\
\;\;\;\;t + x \cdot \frac{z - t}{y}\\
\mathbf{elif}\;y \le 3.62519017211164247 \cdot 10^{34}:\\
\;\;\;\;t + \left(x \cdot \left(z - t\right)\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{\sqrt{y}} \cdot \frac{z - t}{\sqrt{y}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) ((x / y) * ((double) (z - t)))) + t));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((y <= -5.469004203036103e+66)) {
VAR = ((double) (t + ((double) (x * (((double) (z - t)) / y)))));
} else {
double VAR_1;
if ((y <= 3.6251901721116425e+34)) {
VAR_1 = ((double) (t + ((double) (((double) (x * ((double) (z - t)))) * (1.0 / y)))));
} else {
VAR_1 = ((double) (t + ((double) ((x / ((double) sqrt(y))) * (((double) (z - t)) / ((double) sqrt(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.4 |
| Herbie | 1.4 |
if y < -5.46900420303610325e66Initial program 1.0
Simplified1.4
if -5.46900420303610325e66 < y < 3.62519017211164247e34Initial program 3.4
Simplified12.3
rmApplied div-inv12.4
Applied associate-*r*1.9
if 3.62519017211164247e34 < y Initial program 1.2
Simplified1.1
rmApplied add-sqr-sqrt1.2
Applied *-un-lft-identity1.2
Applied times-frac1.3
Applied associate-*r*0.6
Simplified0.6
Final simplification1.4
herbie shell --seed 2020182
(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))