1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -199754789.0343833863735198974609375 \lor \neg \left(y \le 32910417.669902421534061431884765625\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 r380919 = 1.0;
double r380920 = x;
double r380921 = y;
double r380922 = r380920 - r380921;
double r380923 = r380919 - r380921;
double r380924 = r380922 / r380923;
double r380925 = r380919 - r380924;
double r380926 = log(r380925);
double r380927 = r380919 - r380926;
return r380927;
}
double f(double x, double y) {
double r380928 = y;
double r380929 = -199754789.0343834;
bool r380930 = r380928 <= r380929;
double r380931 = 32910417.66990242;
bool r380932 = r380928 <= r380931;
double r380933 = !r380932;
bool r380934 = r380930 || r380933;
double r380935 = 1.0;
double r380936 = exp(r380935);
double r380937 = x;
double r380938 = 2.0;
double r380939 = pow(r380928, r380938);
double r380940 = r380937 / r380939;
double r380941 = 1.0;
double r380942 = r380941 / r380928;
double r380943 = r380940 - r380942;
double r380944 = r380935 * r380943;
double r380945 = r380937 / r380928;
double r380946 = r380944 + r380945;
double r380947 = r380936 / r380946;
double r380948 = log(r380947);
double r380949 = r380937 - r380928;
double r380950 = r380935 - r380928;
double r380951 = r380949 / r380950;
double r380952 = r380935 - r380951;
double r380953 = r380936 / r380952;
double r380954 = log(r380953);
double r380955 = r380934 ? r380948 : r380954;
return r380955;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -199754789.0343834 or 32910417.66990242 < y Initial program 46.8
rmApplied add-log-exp46.8
Applied diff-log46.8
Taylor expanded around inf 0.1
Simplified0.1
if -199754789.0343834 < y < 32910417.66990242Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
Final simplification0.1
herbie shell --seed 2019353
(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))))))