1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -212491914.1913111507892608642578125 \lor \neg \left(y \le 54137734.38243345916271209716796875\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\left(1 + \frac{1}{y}\right) \cdot \frac{x}{y} - \frac{1}{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 r305925 = 1.0;
double r305926 = x;
double r305927 = y;
double r305928 = r305926 - r305927;
double r305929 = r305925 - r305927;
double r305930 = r305928 / r305929;
double r305931 = r305925 - r305930;
double r305932 = log(r305931);
double r305933 = r305925 - r305932;
return r305933;
}
double f(double x, double y) {
double r305934 = y;
double r305935 = -212491914.19131115;
bool r305936 = r305934 <= r305935;
double r305937 = 54137734.38243346;
bool r305938 = r305934 <= r305937;
double r305939 = !r305938;
bool r305940 = r305936 || r305939;
double r305941 = 1.0;
double r305942 = exp(r305941);
double r305943 = 1.0;
double r305944 = r305941 / r305934;
double r305945 = r305943 + r305944;
double r305946 = x;
double r305947 = r305946 / r305934;
double r305948 = r305945 * r305947;
double r305949 = r305948 - r305944;
double r305950 = r305942 / r305949;
double r305951 = log(r305950);
double r305952 = r305946 - r305934;
double r305953 = r305941 - r305934;
double r305954 = r305952 / r305953;
double r305955 = r305941 - r305954;
double r305956 = r305942 / r305955;
double r305957 = log(r305956);
double r305958 = r305940 ? r305951 : r305957;
return r305958;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -212491914.19131115 or 54137734.38243346 < y Initial program 46.7
rmApplied add-log-exp46.7
Applied diff-log46.7
Taylor expanded around inf 0.2
Simplified0.2
if -212491914.19131115 < y < 54137734.38243346Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2019323
(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))))))