3

Quite often, I need to solve for $x$ $$y=\Gamma(ax+b)\prod_{i=1}^n (c_ix+d_i)\tag 1$$which, numerically does not make much problems looking for the zero of function $$f(x)=\log\Big[\Gamma(ax+b)\Big]+\sum_{i=1}^n \log(c_ix+d_i)-\log(y)$$ $$f'(x)=a \psi (a x+b)+\sum _{i=1}^n \frac{c_i}{ c_ix+d_i}$$ The only problem is to generate an as good as possible starting guess for Newton-like methods.

Up to now, what I did is to rewrite $(1)$ as $$y=k\,\Gamma(ax+b) \prod_{i=1}^n (ax+e_i) \qquad \text{with} \qquad e_i=a\frac {d_i}{c_i}\qquad \text{and} \qquad k=\prod_{i=1}^n\frac {c_i}{a} \tag 2$$ Using Stirling approximation, I have not been able to find better that $$\Gamma(ax+b) \prod_{i=1}^n (ax+e_i)\sim \Gamma(ax+b+n) \tag 3$$ and using @Gary's approximation for the inverse of the factorial function, the approximation $$x_0=\frac{2 e^{1+W(t)}-[2(b+n)-1]}{2 a}\qquad \text{with} \qquad t=\frac 1e \log \left(\frac{y}{k\sqrt{2 \pi } }\right) \tag 4$$ where $W(t)$ is Lambert function.

Just to give an idea $$(2 x+3)! (x+2) (2 x+3) (3 x+4)=10^{30} \implies x_0=11.7195$$ while the solution is $11.2494$. The first iterate of Newton method is then $x_1=11.2516$.

The convergence is quite fast but the problem is the cost of the derivative.

For me, the problem is that I am not able to introduce any contribution of the $e_i$ coefficients (it can be non negligible).

My question

Is there a way to improve $(3)$ ?
Gary
  • 31,845
  • If I did the calculations right, one has $$ \Gamma (ax + b)\prod\limits_{i = 1}^n {(ax + e_i )} = \Gamma (ax + b + n)\left( {1 + \frac{{ - n^2 + (1 - 2b)n + 2\sum\nolimits_{i = 1}^n {e_i } }}{{2ax}} + \mathcal{O}!\left( {\frac{1}{{x^2 }}} \right)} \right). $$ So for large $ax$, $B=b+n$ is the best choice. – Gary Jun 02 '22 at 11:34
  • @Gary. This is exactly how I made it. I was hoping to make it better for an almost immediate solution using your approximation. – Claude Leibovici Jun 02 '22 at 11:41

0 Answers0