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




Bits error versus x




Bits error versus y
| Original | 22.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.1 |
if y < -373964.67688393424 or 382375.84537244635 < y Initial program 45.5
Simplified29.5
Taylor expanded in y around inf 0.0
Simplified0.0
if -373964.67688393424 < y < 382375.84537244635Initial program 0.1
Simplified0.1
Taylor expanded in x around 0 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2022067
(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))))