\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \leq -7.715468660463849 \cdot 10^{+149}:\\
\;\;\;\;t + \left(\frac{x}{y} \cdot z - \frac{x}{y} \cdot t\right)\\
\mathbf{elif}\;y \leq 3.528241785312015 \cdot 10^{+35}:\\
\;\;\;\;t + \frac{x \cdot \left(z - t\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t + x \cdot \frac{z - t}{y}\\
\end{array}(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
(FPCore (x y z t)
:precision binary64
(if (<= y -7.715468660463849e+149)
(+ t (- (* (/ x y) z) (* (/ x y) t)))
(if (<= y 3.528241785312015e+35)
(+ t (/ (* x (- z t)) y))
(+ t (* x (/ (- z t) y))))))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 tmp;
if (y <= -7.715468660463849e+149) {
tmp = t + (((x / y) * z) - ((x / y) * t));
} else if (y <= 3.528241785312015e+35) {
tmp = t + ((x * (z - t)) / y);
} else {
tmp = t + (x * ((z - t) / y));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.8 |
|---|---|
| Target | 2.1 |
| Herbie | 2.1 |
if y < -7.7154686604638493e149Initial program 1.4
rmApplied sub-neg_binary641.4
Applied distribute-rgt-in_binary641.4
Simplified1.4
Simplified1.4
if -7.7154686604638493e149 < y < 3.52824178531201519e35Initial program 2.3
rmApplied associate-*l/_binary642.9
if 3.52824178531201519e35 < y Initial program 1.2
rmApplied div-inv_binary641.2
Applied associate-*l*_binary641.0
Simplified1.0
Final simplification2.1
herbie shell --seed 2020253
(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))