1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\begin{array}{l}
\mathbf{if}\;y \leq -387431.34117193345 \lor \neg \left(y \leq 338143.07044951775\right):\\
\;\;\;\;\left(x + \frac{x}{y \cdot y}\right) - \left({y}^{-2} + \frac{x + -1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x + -1}{y + 1}, 1\right)\\
\end{array}
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(FPCore (x y) :precision binary64 (if (or (<= y -387431.34117193345) (not (<= y 338143.07044951775))) (- (+ x (/ x (* y y))) (+ (pow y -2.0) (/ (+ x -1.0) y))) (fma y (/ (+ x -1.0) (+ y 1.0)) 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 <= -387431.34117193345) || !(y <= 338143.07044951775)) {
tmp = (x + (x / (y * y))) - (pow(y, -2.0) + ((x + -1.0) / y));
} else {
tmp = fma(y, ((x + -1.0) / (y + 1.0)), 1.0);
}
return tmp;
}




Bits error versus x




Bits error versus y
| Original | 22.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
if y < -387431.34117193345 or 338143.070449517749 < y Initial program 45.4
Simplified28.7
Taylor expanded in y around inf 0.0
Simplified0.0
Applied pow2_binary640.0
Applied pow-flip_binary640.0
Simplified0.0
if -387431.34117193345 < y < 338143.070449517749Initial program 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2022068
(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))))