\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;z \le -6.0925830708951564 \cdot 10^{44} \lor \neg \left(z \le 8.00147659353467507 \cdot 10^{41}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x + 1}{x + \frac{y \cdot z - x}{t \cdot z - x}}}\\
\end{array}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 VAR;
if (((z <= -6.092583070895156e+44) || !(z <= 8.001476593534675e+41))) {
VAR = ((x + (y / t)) / (x + 1.0));
} else {
VAR = (1.0 / ((x + 1.0) / (x + (((y * z) - x) / ((t * z) - x)))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.9 |
|---|---|
| Target | 0.3 |
| Herbie | 3.5 |
if z < -6.092583070895156e+44 or 8.001476593534675e+41 < z Initial program 16.1
Taylor expanded around inf 8.0
if -6.092583070895156e+44 < z < 8.001476593534675e+41Initial program 0.3
rmApplied clear-num0.3
Final simplification3.5
herbie shell --seed 2020078 +o rules:numerics
(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))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1)))