\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}\begin{array}{l}
\mathbf{if}\;z \leq -2.399470696119765 \cdot 10^{+69} \lor \neg \left(z \leq 6.859199814445201 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(z \cdot y - x\right) \cdot \frac{1}{z \cdot t - x}}{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 (or (<= z -2.399470696119765e+69) (not (<= z 6.859199814445201e+71))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (* (- (* z y) x) (/ 1.0 (- (* z t) x)))) (+ 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 VAR;
if (((z <= -2.399470696119765e+69) || !(z <= 6.859199814445201e+71))) {
VAR = (((double) (x + (y / t))) / ((double) (x + 1.0)));
} else {
VAR = (((double) (x + ((double) (((double) (((double) (z * y)) - x)) * (1.0 / ((double) (((double) (z * t)) - x))))))) / ((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.4 |
|---|---|
| Target | 0.4 |
| Herbie | 3.6 |
if z < -2.39947069611976501e69 or 6.85919981444520093e71 < z Initial program 18.6
Taylor expanded around inf 8.3
if -2.39947069611976501e69 < z < 6.85919981444520093e71Initial program 0.8
rmApplied div-inv0.8
Simplified0.8
Final simplification3.6
herbie shell --seed 2020198
(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)))