I want to calculate the following equation: $$\frac{\theta \Gamma \left(\kappa+1,\frac{o}{\theta }\right)-o \Gamma \left(\kappa,\frac{o}{\theta }\right)}{\Gamma (\kappa)}+o+s$$ with $s>0, o>0, \kappa>0, \theta>0$ and in which $\Gamma(\kappa,x)$ represents the upper incomplete gamma function and $\Gamma(\kappa)$ the (true) gamma function.
My current implementation of this equation in c++ using boost tgamma returns an overflow for large $\kappa$ values. Is there a way to transform this equation?