1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \leq -406199.1355664596 \lor \neg \left(y \leq 312914.201477194\right):\\
\;\;\;\;\left(\frac{1}{y} + x\right) + \left(\frac{x + -1}{y \cdot y} - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\
\end{array}(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(FPCore (x y) :precision binary64 (if (or (<= y -406199.1355664596) (not (<= y 312914.201477194))) (+ (+ (/ 1.0 y) x) (- (/ (+ x -1.0) (* y y)) (/ x y))) (+ 1.0 (* y (/ (+ x -1.0) (+ y 1.0))))))
double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
double code(double x, double y) {
double tmp;
if ((y <= -406199.1355664596) || !(y <= 312914.201477194)) {
tmp = ((1.0 / y) + x) + (((x + -1.0) / (y * y)) - (x / y));
} else {
tmp = 1.0 + (y * ((x + -1.0) / (y + 1.0)));
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 21.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
if y < -406199.13556645962 or 312914.20147719397 < y Initial program 44.9
Taylor expanded around inf 0.0
Simplified0.0
Taylor expanded around 0 0.0
Simplified0.0
if -406199.13556645962 < y < 312914.20147719397Initial program 0.1
Taylor expanded around 0 0.1
Simplified0.1
rmApplied sub-neg_binary64_164390.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021059
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.8482788297247) (- (/ 1.0 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) (- (/ 1.0 y) (- (/ x y) x))))
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))