code: function qgamma(a, s, lowerTail, logp) {
        var gaminv;
  
        logp = logp === true;
        lowerTail = lowerTail !== false;
        gaminv = gratio.gaminv(a); // function of p, lowerTail
  
        if (utils.hasNaN(a, s)) { return function() { return NaN; }; }
  
        return utils.qhelper(lowerTail, logp, 0, Infinity, function(p) {
           if (a < 0 || s <= 0) { return NaN; }
           if (utils.isInfinite(a)) { return Infinity; }
           if (a === 0) { return 0; }
  
           return s * gaminv(logp ? Math.exp(p) : p, lowerTail);
        });
     }
docs: inverse cdf a = shape, s = scale (rate = 1 / s) 
  Evaluates the Gamma distribution's quantile function (inverse cdf) at `p`:
  $$\textrm{qgamma}(a, s)(p) = x \textrm{ such that } \textrm{prob}(X \leq x) = p$$
  where $X$ is a random variable with the $\textrm{Gamma}(a, s)$ distribution.
  
  `lowerTail` defaults to `true`; if `lowerTail` is `false`, `p` is
  interpreted as an upper tail probability (returns
  $x$ such that $\textrm{prob}(X > x) = p)$.
  
  `logp` defaults to `false`; if `logp` is `true`, interprets `p` as
  the logarithm of the desired probability.
  
  Expects $a>0$, $s>0$, and $0 \leq p \leq 1$.
  @fullName qgamma(a, s, lowerTail, logp)(p)
  @memberof gamma