1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -212491914.1913111507892608642578125 \lor \neg \left(y \le 758763659.74992859363555908203125\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\mathsf{fma}\left(1, \frac{x}{{y}^{2}}, \frac{x}{y}\right) - \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 r238853 = 1.0;
double r238854 = x;
double r238855 = y;
double r238856 = r238854 - r238855;
double r238857 = r238853 - r238855;
double r238858 = r238856 / r238857;
double r238859 = r238853 - r238858;
double r238860 = log(r238859);
double r238861 = r238853 - r238860;
return r238861;
}
double f(double x, double y) {
double r238862 = y;
double r238863 = -212491914.19131115;
bool r238864 = r238862 <= r238863;
double r238865 = 758763659.7499286;
bool r238866 = r238862 <= r238865;
double r238867 = !r238866;
bool r238868 = r238864 || r238867;
double r238869 = 1.0;
double r238870 = exp(r238869);
double r238871 = x;
double r238872 = 2.0;
double r238873 = pow(r238862, r238872);
double r238874 = r238871 / r238873;
double r238875 = r238871 / r238862;
double r238876 = fma(r238869, r238874, r238875);
double r238877 = r238869 / r238862;
double r238878 = r238876 - r238877;
double r238879 = r238870 / r238878;
double r238880 = log(r238879);
double r238881 = r238871 - r238862;
double r238882 = r238869 - r238862;
double r238883 = r238881 / r238882;
double r238884 = r238869 - r238883;
double r238885 = r238870 / r238884;
double r238886 = log(r238885);
double r238887 = r238868 ? r238880 : r238886;
return r238887;
}




Bits error versus x




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