1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -126285643.80532795 \lor \neg \left(y \le 184531412.18592519\right):\\
\;\;\;\;\left(\frac{1}{y} + x\right) - 1 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \left(1 - x\right) \cdot \frac{y}{y + 1}\\
\end{array}double f(double x, double y) {
double r700719 = 1.0;
double r700720 = x;
double r700721 = r700719 - r700720;
double r700722 = y;
double r700723 = r700721 * r700722;
double r700724 = r700722 + r700719;
double r700725 = r700723 / r700724;
double r700726 = r700719 - r700725;
return r700726;
}
double f(double x, double y) {
double r700727 = y;
double r700728 = -126285643.80532795;
bool r700729 = r700727 <= r700728;
double r700730 = 184531412.1859252;
bool r700731 = r700727 <= r700730;
double r700732 = !r700731;
bool r700733 = r700729 || r700732;
double r700734 = 1.0;
double r700735 = r700734 / r700727;
double r700736 = x;
double r700737 = r700735 + r700736;
double r700738 = r700736 / r700727;
double r700739 = r700734 * r700738;
double r700740 = r700737 - r700739;
double r700741 = r700734 - r700736;
double r700742 = r700727 + r700734;
double r700743 = r700727 / r700742;
double r700744 = r700741 * r700743;
double r700745 = r700734 - r700744;
double r700746 = r700733 ? r700740 : r700745;
return r700746;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if y < -126285643.80532795 or 184531412.1859252 < y Initial program 45.2
Simplified29.6
rmApplied flip-+45.0
Applied associate-/r/45.1
Taylor expanded around inf 0.3
Simplified0.3
if -126285643.80532795 < y < 184531412.1859252Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020045 +o rules:numerics
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.8482788297247) (- (/ 1 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x))))
(- 1 (/ (* (- 1 x) y) (+ y 1))))