1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -189652252.65805757 \lor \neg \left(y \le 6752698.7732027788\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{1}{y}, \frac{x}{y}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{e^{1}}{1 - \frac{x - y}{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r464600 = 1.0;
double r464601 = x;
double r464602 = y;
double r464603 = r464601 - r464602;
double r464604 = r464600 - r464602;
double r464605 = r464603 / r464604;
double r464606 = r464600 - r464605;
double r464607 = log(r464606);
double r464608 = r464600 - r464607;
return r464608;
}
double f(double x, double y) {
double r464609 = y;
double r464610 = -189652252.65805757;
bool r464611 = r464609 <= r464610;
double r464612 = 6752698.773202779;
bool r464613 = r464609 <= r464612;
double r464614 = !r464613;
bool r464615 = r464611 || r464614;
double r464616 = 1.0;
double r464617 = exp(r464616);
double r464618 = x;
double r464619 = 2.0;
double r464620 = pow(r464609, r464619);
double r464621 = r464618 / r464620;
double r464622 = 1.0;
double r464623 = r464622 / r464609;
double r464624 = r464621 - r464623;
double r464625 = r464618 / r464609;
double r464626 = fma(r464616, r464624, r464625);
double r464627 = r464617 / r464626;
double r464628 = log(r464627);
double r464629 = r464618 - r464609;
double r464630 = r464616 - r464609;
double r464631 = r464629 / r464630;
double r464632 = r464616 - r464631;
double r464633 = r464617 / r464632;
double r464634 = log(r464633);
double r464635 = r464615 ? r464628 : r464634;
return r464635;
}




Bits error versus x




Bits error versus y
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if y < -189652252.65805757 or 6752698.773202779 < y Initial program 47.3
rmApplied add-log-exp47.3
Applied diff-log47.3
Taylor expanded around inf 0.2
Simplified0.2
if -189652252.65805757 < y < 6752698.773202779Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.2
herbie shell --seed 2020083 +o rules:numerics
(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))))))