There is a very concise algorithm for computing lower incomplete gamma function:
https://people.sc.fsu.edu/~jburkardt/f_src/asa147/asa147.html
We coded this in C++. There is one thing I don't understand in this algorithm. In one place to compute the following expression:
it is substituted by:
Obviously this is the same, but why it is done like this? Is computing exp of lgamma more efficient than computing tgamma function (both lgamma and tgamma are available in C++)?


You will find proper implementations of the Gamma for c++ here: http://www.boost.org/doc/libs/1_64_0/libs/math/doc/html/math_toolkit/sf_gamma