\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \leq -1.5155016460348557 \cdot 10^{-124} \lor \neg \left(y \leq 1.2472961326844655 \cdot 10^{+29}\right):\\
\;\;\;\;t + x \cdot \frac{z - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \left(x \cdot \left(z - t\right)\right) \cdot \frac{1}{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 <= -1.5155016460348557e-124) || !(y <= 1.2472961326844655e+29))) {
VAR = ((double) (t + ((double) (x * (((double) (z - t)) / y)))));
} else {
VAR = ((double) (t + ((double) (((double) (x * ((double) (z - t)))) * (1.0 / y)))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 2.3 |
| Herbie | 2.0 |
if y < -1.51550164603485571e-124 or 1.2472961326844655e29 < y Initial program 1.1
Simplified2.0
if -1.51550164603485571e-124 < y < 1.2472961326844655e29Initial program 3.7
rmApplied associate-*l/2.0
rmApplied div-inv2.1
Final simplification2.0
herbie shell --seed 2020196
(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))