\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1.8531219142654067 \cdot 10^{+153}:\\
\;\;\;\;t + \frac{x \cdot \left(z - t\right)}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 4.1493558833484096 \cdot 10^{+130}:\\
\;\;\;\;t + \frac{x}{y} \cdot \left(z - t\right)\\
\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 (<= (/ x y) -1.8531219142654067e+153)
(+ t (/ (* x (- z t)) y))
(if (<= (/ x y) 4.1493558833484096e+130)
(+ t (* (/ x y) (- z t)))
(+ 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 ((x / y) <= -1.8531219142654067e+153) {
tmp = t + ((x * (z - t)) / y);
} else if ((x / y) <= 4.1493558833484096e+130) {
tmp = t + ((x / y) * (z - t));
} 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.9 |
|---|---|
| Target | 2.3 |
| Herbie | 1.2 |
if (/.f64 x y) < -1.85312191426540667e153Initial program 13.2
rmApplied associate-*l/_binary64_146844.0
if -1.85312191426540667e153 < (/.f64 x y) < 4.14935588334840957e130Initial program 0.8
if 4.14935588334840957e130 < (/.f64 x y) Initial program 8.8
rmApplied div-inv_binary64_147388.9
Applied associate-*l*_binary64_146824.7
Simplified4.6
Final simplification1.2
herbie shell --seed 2020356
(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))