\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;t \le -2.49327115381347073 \cdot 10^{-30}:\\
\;\;\;\;1 \cdot \frac{z - t}{\frac{y}{x}} + t\\
\mathbf{elif}\;t \le 1.97952534099318673 \cdot 10^{-91}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\
\end{array}double code(double x, double y, double z, double t) {
return (((x / y) * (z - t)) + t);
}
double code(double x, double y, double z, double t) {
double temp;
if ((t <= -2.4932711538134707e-30)) {
temp = ((1.0 * ((z - t) / (y / x))) + t);
} else {
double temp_1;
if ((t <= 1.9795253409931867e-91)) {
temp_1 = ((x * ((z - t) / y)) + t);
} else {
temp_1 = (((x / y) * (z - t)) + t);
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.2 |
|---|---|
| Target | 2.4 |
| Herbie | 2.3 |
if t < -2.4932711538134707e-30Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied associate-*l*0.1
Simplified8.4
rmApplied associate-/l*0.1
if -2.4932711538134707e-30 < t < 1.9795253409931867e-91Initial program 4.7
rmApplied div-inv4.7
Applied associate-*l*5.0
Simplified4.9
if 1.9795253409931867e-91 < t Initial program 0.4
Final simplification2.3
herbie shell --seed 2020058 +o rules:numerics
(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))