\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}{z \cdot t - x}}{x + 1} \leq 1.0469096568810927 \cdot 10^{+286}:\\
\;\;\;\;\frac{x + \frac{y \cdot z - x}{z \cdot t - 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 (((double) (x + (((double) (((double) (y * z)) - x)) / ((double) (((double) (t * z)) - x))))) / ((double) (x + 1.0)));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (x + (((double) (((double) (y * z)) - x)) / ((double) (((double) (z * t)) - x))))) / ((double) (x + 1.0))) <= 1.0469096568810927e+286)) {
VAR = (((double) (x + (((double) (((double) (y * z)) - x)) / ((double) (((double) (z * t)) - x))))) / ((double) (x + 1.0)));
} else {
VAR = (((double) (x + (y / t))) / ((double) (x + 1.0)));
}
return VAR;
}




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.3 |
if (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) < 1.04690965688109273e286Initial program 2.8
if 1.04690965688109273e286 < (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)) Initial program 61.8
Taylor expanded around inf 9.1
Final simplification3.3
herbie shell --seed 2020196
(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)))