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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 2.1 |
|---|---|
| Target | 2.1 |
| Herbie | 0.9 |
if (/.f64 x y) < -inf.0Initial program 64.0
Taylor expanded in x around 0 0.2
Applied clear-num_binary640.3
if -inf.0 < (/.f64 x y) < 2.6912293875757195e131Initial program 0.7
if 2.6912293875757195e131 < (/.f64 x y) Initial program 11.9
Taylor expanded in x around inf 4.3
Final simplification0.9
herbie shell --seed 2022076
(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))