1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -201288582.2730185985565185546875 \lor \neg \left(y \le 116648832255.3203277587890625\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r535596 = 1.0;
double r535597 = x;
double r535598 = y;
double r535599 = r535597 - r535598;
double r535600 = r535596 - r535598;
double r535601 = r535599 / r535600;
double r535602 = r535596 - r535601;
double r535603 = log(r535602);
double r535604 = r535596 - r535603;
return r535604;
}
double f(double x, double y) {
double r535605 = y;
double r535606 = -201288582.2730186;
bool r535607 = r535605 <= r535606;
double r535608 = 116648832255.32033;
bool r535609 = r535605 <= r535608;
double r535610 = !r535609;
bool r535611 = r535607 || r535610;
double r535612 = 1.0;
double r535613 = exp(r535612);
double r535614 = x;
double r535615 = 2.0;
double r535616 = pow(r535605, r535615);
double r535617 = r535614 / r535616;
double r535618 = 1.0;
double r535619 = r535618 / r535605;
double r535620 = r535617 - r535619;
double r535621 = r535612 * r535620;
double r535622 = r535614 / r535605;
double r535623 = r535621 + r535622;
double r535624 = r535613 / r535623;
double r535625 = log(r535624);
double r535626 = r535614 - r535605;
double r535627 = r535612 - r535605;
double r535628 = r535626 / r535627;
double r535629 = r535612 - r535628;
double r535630 = r535613 / r535629;
double r535631 = log(r535630);
double r535632 = r535611 ? r535625 : r535631;
return r535632;
}




Bits error versus x




Bits error versus y
Results
| Original | 17.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -201288582.2730186 or 116648832255.32033 < y Initial program 46.3
rmApplied add-log-exp46.3
Applied diff-log46.3
Taylor expanded around inf 0.2
Simplified0.2
if -201288582.2730186 < y < 116648832255.32033Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2019362
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.61947241) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))