1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -173788009.49411574 \lor \neg \left(y \le 98105251.590079397\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\frac{x}{y} + \left(1 \cdot \frac{x}{{y}^{2}} - \frac{1}{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 r531003 = 1.0;
double r531004 = x;
double r531005 = y;
double r531006 = r531004 - r531005;
double r531007 = r531003 - r531005;
double r531008 = r531006 / r531007;
double r531009 = r531003 - r531008;
double r531010 = log(r531009);
double r531011 = r531003 - r531010;
return r531011;
}
double f(double x, double y) {
double r531012 = y;
double r531013 = -173788009.49411574;
bool r531014 = r531012 <= r531013;
double r531015 = 98105251.5900794;
bool r531016 = r531012 <= r531015;
double r531017 = !r531016;
bool r531018 = r531014 || r531017;
double r531019 = 1.0;
double r531020 = exp(r531019);
double r531021 = x;
double r531022 = r531021 / r531012;
double r531023 = 2.0;
double r531024 = pow(r531012, r531023);
double r531025 = r531021 / r531024;
double r531026 = r531019 * r531025;
double r531027 = r531019 / r531012;
double r531028 = r531026 - r531027;
double r531029 = r531022 + r531028;
double r531030 = r531020 / r531029;
double r531031 = log(r531030);
double r531032 = r531021 - r531012;
double r531033 = r531019 - r531012;
double r531034 = r531032 / r531033;
double r531035 = r531019 - r531034;
double r531036 = r531020 / r531035;
double r531037 = log(r531036);
double r531038 = r531018 ? r531031 : r531037;
return r531038;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -173788009.49411574 or 98105251.5900794 < y Initial program 47.1
rmApplied add-log-exp47.1
Applied diff-log47.1
Taylor expanded around inf 0.1
Simplified0.1
if -173788009.49411574 < y < 98105251.5900794Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2020047
(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))))))