\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;z \leq -4.5094556256515596 \cdot 10^{+97} \lor \neg \left(z \leq 1.327720719166663 \cdot 10^{+93}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{z \cdot t - x}{z \cdot y - x}}}{x + 1}\\
\end{array}(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.5094556256515596e+97) (not (<= z 1.327720719166663e+93))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ 1.0 (/ (- (* z t) x) (- (* z y) x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5094556256515596e+97) || !(z <= 1.327720719166663e+93)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.4 |
|---|---|
| Target | 0.4 |
| Herbie | 3.5 |
if z < -4.5094556256515596e97 or 1.3277207191666629e93 < z Initial program 19.4
Taylor expanded around inf 7.8
if -4.5094556256515596e97 < z < 1.3277207191666629e93Initial program 1.3
rmApplied clear-num_binary641.3
Simplified1.3
Final simplification3.5
herbie shell --seed 2020220
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))