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}}{\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 r329944 = 1.0;
double r329945 = x;
double r329946 = y;
double r329947 = r329945 - r329946;
double r329948 = r329944 - r329946;
double r329949 = r329947 / r329948;
double r329950 = r329944 - r329949;
double r329951 = log(r329950);
double r329952 = r329944 - r329951;
return r329952;
}
double f(double x, double y) {
double r329953 = y;
double r329954 = -199754789.0343834;
bool r329955 = r329953 <= r329954;
double r329956 = 32910417.66990242;
bool r329957 = r329953 <= r329956;
double r329958 = !r329957;
bool r329959 = r329955 || r329958;
double r329960 = 1.0;
double r329961 = exp(r329960);
double r329962 = x;
double r329963 = 2.0;
double r329964 = pow(r329953, r329963);
double r329965 = r329962 / r329964;
double r329966 = 1.0;
double r329967 = r329966 / r329953;
double r329968 = r329965 - r329967;
double r329969 = r329962 / r329953;
double r329970 = fma(r329960, r329968, r329969);
double r329971 = r329961 / r329970;
double r329972 = log(r329971);
double r329973 = r329962 - r329953;
double r329974 = r329960 - r329953;
double r329975 = r329973 / r329974;
double r329976 = r329960 - r329975;
double r329977 = r329961 / r329976;
double r329978 = log(r329977);
double r329979 = r329959 ? r329972 : r329978;
return r329979;
}




Bits error versus x




Bits error versus y
| 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 +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))))))