\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1} \le 2.8986236197514617 \cdot 10^{300}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\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 temp;
if ((((x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)) <= 2.8986236197514617e+300)) {
temp = ((x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0));
} else {
temp = ((x + (y / t)) / (x + 1.0));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 0.3 |
| Herbie | 3.4 |
if (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) < 2.8986236197514617e+300Initial program 2.8
if 2.8986236197514617e+300 < (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) Initial program 63.7
Taylor expanded around inf 10.9
Final simplification3.4
herbie shell --seed 2020053
(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)))