implementation of inverse incomplete gamma function