\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;z \le -6.3088357711862659 \cdot 10^{63}:\\
\;\;\;\;\frac{1}{x + 1} \cdot \mathsf{fma}\left(\frac{y}{t \cdot z - x}, z, x\right) - \frac{\frac{x}{t \cdot z - x}}{x + 1}\\
\mathbf{elif}\;z \le 4.56682903308585354 \cdot 10^{76}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{t \cdot z - x}{y \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 ((z <= -6.308835771186266e+63)) {
temp = (((1.0 / (x + 1.0)) * fma((y / ((t * z) - x)), z, x)) - ((x / ((t * z) - x)) / (x + 1.0)));
} else {
double temp_1;
if ((z <= 4.5668290330858535e+76)) {
temp_1 = ((x + (1.0 / (((t * z) - x) / ((y * z) - x)))) / (x + 1.0));
} else {
temp_1 = ((x + (y / t)) / (x + 1.0));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.7 |
|---|---|
| Target | 0.3 |
| Herbie | 3.2 |
if z < -6.308835771186266e+63Initial program 18.7
rmApplied div-sub18.7
Applied associate-+r-18.7
Applied div-sub18.7
Simplified7.9
rmApplied *-un-lft-identity7.9
Applied times-frac8.0
Simplified8.0
if -6.308835771186266e+63 < z < 4.5668290330858535e+76Initial program 0.7
rmApplied clear-num0.7
if 4.5668290330858535e+76 < z Initial program 20.2
Taylor expanded around inf 7.0
Final simplification3.2
herbie shell --seed 2020057 +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)))