1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\begin{array}{l}
\mathbf{if}\;y \leq -507940.76313948643 \lor \neg \left(y \leq 245860.08583667743\right):\\
\;\;\;\;\left(x + \frac{x + -1}{y \cdot y}\right) - \frac{x + -1}{y}\\
\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 -507940.76313948643) (not (<= y 245860.08583667743))) (- (+ x (/ (+ x -1.0) (* y y))) (/ (+ 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 <= -507940.76313948643) || !(y <= 245860.08583667743)) {
tmp = (x + ((x + -1.0) / (y * y))) - ((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.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.0 |
if y < -507940.76313948643 or 245860.085836677434 < y Initial program 45.5
Simplified29.3
Taylor expanded in y around inf 0.0
Simplified0.0
Applied associate--r+_binary640.0
Simplified0.0
if -507940.76313948643 < y < 245860.085836677434Initial program 0.0
Simplified0.1
Final simplification0.0
herbie shell --seed 2022081
(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))))