Is there a closed form approximation for the composition of the Gamma CDF with the inverse Normal CDF? Given $k$, $\theta$ fixed shape and scale parameters for some Gamma distribution which has a CDF $F$. Let $G^{-1}$ be the inverse CDF of the standard Normal distribution. Consider the composition $H(x) = G^{-1}(F(x))$; this should transform a random variable following a Gamma distribution with the respective parameters to a standard Normal random variable.
When $x$ is large $F(x)$ may numerically evaluate to $1$, and thus $H(x)$ will return $\infty$. I was wondering if there was any known closed-form approximation for $H(x)$ that would avoid the issues with this numerical evaluation of $F$.
 A: A solid implementation of $F$ will directly return the complementary value $1-F$ (the survival function) when requested.  Exploit the symmetry of $G$ to compute
$$H(x) = G^{-1}(F(x)) = -G^{-1}(1-F(x)).$$
The point is that $1-F(x)$ is computed directly to high precision, rather than subtracting $F(x)$ from $1,$ which destroys all precision past the 16th decimal digit or so.
R has such an implementation.  Here is one way to use it.  It automatically selects which method is likely to give the best precision.
h <- function(x, k, theta=1) {
  q <- pgamma(x, k, scale=theta)
  ifelse(q > 1/2, -qnorm(pgamma(x, k, scale=theta, lower.tail=FALSE)), qnorm(q))
}


The first panel in this figure is a histogram of $10^5$ values created by drawing Gamma variates and applying $h:$ as intended, the result looks like a Standard Normal distribution (whose density is overplotted in red).
The middle panel plots two implementations of $h:$ the recommended one above in red and the "naive" one, computed simply as $G^{-1}(F(x)),$ in dotted black.  The red one goes to an extremely high quantile. (In fact, it can be plotted to a height of about $37,$ at which point the standard Normal tail probability falls below the smallest number that can be represented in double precision, roughly $10^{-309}.$)
The right panel plots the difference between the implementations.  The "naive" one starts to fail out in the right tail, ultimately giving up altogether beyond the $1 - 2^{-52}$ quantile (where essentially all numerical precision is lost.)
