\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;z \le -1.398221560293491 \cdot 10^{-111} \lor \neg \left(z \le 9.8776861560231574 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{x}{y} \cdot z + \left(t - t \cdot \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(z - t\right)}{y} + 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 (((z <= -1.3982215602934908e-111) || !(z <= 9.877686156023157e-45))) {
VAR = ((double) (((double) (((double) (x / y)) * z)) + ((double) (t - ((double) (t * ((double) (x / y))))))));
} else {
VAR = ((double) (((double) (((double) (x * ((double) (z - t)))) / y)) + t));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.3 |
| Herbie | 2.6 |
if z < -1.398221560293491e-111 or 9.8776861560231574e-45 < z Initial program 1.4
rmApplied sub-neg1.4
Applied distribute-lft-in1.4
Applied associate-+l+1.4
Simplified1.4
if -1.398221560293491e-111 < z < 9.8776861560231574e-45Initial program 2.9
rmApplied associate-*l/4.3
Final simplification2.6
herbie shell --seed 2020171
(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))