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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 1.9 |
|---|---|
| Target | 2.2 |
| Herbie | 1.9 |
if y < -7.425383854185525e49Initial program 1.2
if -7.425383854185525e49 < y < 1.10948849523104069e150Initial program 2.5
Taylor expanded around 0 2.6
Simplified2.5
if 1.10948849523104069e150 < y Initial program 0.9
rmApplied add-cube-cbrt_binary64_82971.2
Applied associate-*l*_binary64_82031.2
Simplified1.2
Taylor expanded around 0 11.7
Simplified1.0
Final simplification1.9
herbie shell --seed 2021176
(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))