\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;z \leq -6.265345281220906 \cdot 10^{-32}:\\
\;\;\;\;\frac{x + \left(z \cdot \left(y \cdot \frac{1}{z \cdot t - x}\right) - \frac{x}{z \cdot t - x}\right)}{x + 1}\\
\mathbf{elif}\;z \leq 1.1093987823313588 \cdot 10^{+84}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{z \cdot t - x}{z \cdot y - x}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{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 (<= z -6.265345281220906e-32)
(/
(+ x (- (* z (* y (/ 1.0 (- (* z t) x)))) (/ x (- (* z t) x))))
(+ x 1.0))
(if (<= z 1.1093987823313588e+84)
(/ (+ x (/ 1.0 (/ (- (* z t) x) (- (* z y) x)))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0)))))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 tmp;
if ((z <= -6.265345281220906e-32)) {
tmp = (((double) (x + ((double) (((double) (z * ((double) (y * (1.0 / ((double) (((double) (z * t)) - x))))))) - (x / ((double) (((double) (z * t)) - x))))))) / ((double) (x + 1.0)));
} else {
double tmp_1;
if ((z <= 1.1093987823313588e+84)) {
tmp_1 = (((double) (x + (1.0 / (((double) (((double) (z * t)) - x)) / ((double) (((double) (z * y)) - x)))))) / ((double) (x + 1.0)));
} else {
tmp_1 = (((double) (x + (y / t))) / ((double) (x + 1.0)));
}
tmp = tmp_1;
}
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.2 |
if z < -6.26534528122090565e-32Initial program Error: 13.7 bits
rmApplied div-subError: 13.7 bits
SimplifiedError: 5.4 bits
SimplifiedError: 5.4 bits
rmApplied div-invError: 5.4 bits
if -6.26534528122090565e-32 < z < 1.10939878233135884e84Initial program Error: 0.6 bits
rmApplied clear-numError: 0.6 bits
SimplifiedError: 0.6 bits
if 1.10939878233135884e84 < z Initial program Error: 19.4 bits
Taylor expanded around inf Error: 8.3 bits
Final simplificationError: 3.2 bits
herbie shell --seed 2020203
(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)))