1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -177179944.066863715648651123046875 \lor \neg \left(y \le 283365302.9953787326812744140625\right):\\
\;\;\;\;\left(x + \frac{1}{y}\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 r470590 = 1.0;
double r470591 = x;
double r470592 = r470590 - r470591;
double r470593 = y;
double r470594 = r470592 * r470593;
double r470595 = r470593 + r470590;
double r470596 = r470594 / r470595;
double r470597 = r470590 - r470596;
return r470597;
}
double f(double x, double y) {
double r470598 = y;
double r470599 = -177179944.06686372;
bool r470600 = r470598 <= r470599;
double r470601 = 283365302.99537873;
bool r470602 = r470598 <= r470601;
double r470603 = !r470602;
bool r470604 = r470600 || r470603;
double r470605 = x;
double r470606 = 1.0;
double r470607 = r470606 / r470598;
double r470608 = r470605 + r470607;
double r470609 = r470605 / r470598;
double r470610 = r470606 * r470609;
double r470611 = r470608 - r470610;
double r470612 = r470606 - r470605;
double r470613 = r470598 + r470606;
double r470614 = r470598 / r470613;
double r470615 = r470612 * r470614;
double r470616 = r470606 - r470615;
double r470617 = r470604 ? r470611 : r470616;
return r470617;
}




Bits error versus x




Bits error versus y
Results
| Original | 21.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if y < -177179944.06686372 or 283365302.99537873 < y Initial program 44.7
rmApplied *-un-lft-identity44.7
Applied times-frac28.5
Simplified28.5
Taylor expanded around inf 0.2
Simplified0.2
if -177179944.06686372 < y < 283365302.99537873Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019326
(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))))