\frac{x}{y} \cdot \left(z - t\right) + t\begin{array}{l}
\mathbf{if}\;y \leq -2.4028729871282748 \cdot 10^{-228}:\\
\;\;\;\;\frac{x}{y} \cdot z + t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{elif}\;y \leq 44607863226960.26:\\
\;\;\;\;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 -2.4028729871282748e-228)
(+ (* (/ x y) z) (* t (- 1.0 (/ x y))))
(if (<= y 44607863226960.26)
(+ t (/ (* x (- z t)) y))
(+ t (* x (/ (- z t) y))))))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 tmp;
if ((y <= -2.4028729871282748e-228)) {
tmp = ((double) (((double) ((x / y) * z)) + ((double) (t * ((double) (1.0 - (x / y)))))));
} else {
double tmp_1;
if ((y <= 44607863226960.26)) {
tmp_1 = ((double) (t + (((double) (x * ((double) (z - t)))) / y)));
} else {
tmp_1 = ((double) (t + ((double) (x * (((double) (z - t)) / y)))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.0 |
|---|---|
| Target | 2.3 |
| Herbie | 1.8 |
if y < -2.4028729871282748e-228Initial program Error: 1.7 bits
rmApplied sub-negError: 1.7 bits
Applied distribute-lft-inError: 1.7 bits
Applied associate-+l+Error: 1.7 bits
SimplifiedError: 1.7 bits
rmApplied *-un-lft-identityError: 1.7 bits
Applied distribute-rgt-out--Error: 1.7 bits
if -2.4028729871282748e-228 < y < 44607863226960.2578Initial program Error: 3.5 bits
rmApplied associate-*l/Error: 2.5 bits
if 44607863226960.2578 < y Initial program Error: 1.3 bits
rmApplied div-invError: 1.3 bits
Applied associate-*l*Error: 1.4 bits
SimplifiedError: 1.3 bits
Final simplificationError: 1.8 bits
herbie shell --seed 2020205
(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))