\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;z \le -9.3573603142636736 \cdot 10^{-114} \lor \neg \left(z \le 2.10465223580603398 \cdot 10^{-265}\right):\\
\;\;\;\;\frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + 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 (((z <= -9.357360314263674e-114) || !(z <= 2.104652235806034e-265))) {
temp = (((x / y) * (z - t)) + t);
} else {
temp = ((x * ((z - t) / y)) + t);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.3 |
|---|---|
| Target | 2.4 |
| Herbie | 2.6 |
if z < -9.357360314263674e-114 or 2.104652235806034e-265 < z Initial program 2.0
if -9.357360314263674e-114 < z < 2.104652235806034e-265Initial program 3.2
rmApplied div-inv3.2
Applied associate-*l*4.8
Simplified4.8
Final simplification2.6
herbie shell --seed 2020057
(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))