I have a function of the form:


$f(n) = \prod\_{i=1}^{n-1} (1-ai)$


Here, $a \geq 0$ and $(a\*i) < 1$. For $n > 10^5$ or $10^6$, what is the best possible analytic approximation for $f(n)$ that will allow me compute values for the function with reasonable computational resources? What bounds on the error of the approximation can I expect? 



Approximating $\prod_{i=1}^{n-1} (1-ai)$ for large $n$
$$f(n) = \dfrac{(-a)^{n-1} \Gamma(n - 1/a)}{\Gamma(1 - 1/a)}$$
If $a n < 1$, you'll want to use the reflection principle 
$$\Gamma(1-z) \; \Gamma(z) = {\pi \over \sin{(\pi z)}}$$
so 
$$ f(n) = \dfrac{a^{n-1} \Gamma(1/a)}{\Gamma(1-n+1/a)}$$


Use Stirling's series for the asymptotic approximation of $\ln(\Gamma(1-n+ 1/a))$, or one of its variants that you can find at <http://en.wikipedia.org/wiki/Stirling%27s_approximation>


