code: function qgeom(prob, lowerTail, logp) {
        logp = logp === true;
        lowerTail = lowerTail !== false;
  
        if (prob <= 0 || prob > 1) { return function(x) { return NaN; }; }
  
        return function(p) {
           var res;
  
           if (logp) {
              if (p > 0) { return NaN; }
              res = lowerTail ? Math.log(-expm1(p)) : p;
           } else {
              // else, not log
              if (!(p >= 0 && p <= 1)) { return NaN; }
              res = lowerTail ? log1p(-p) : Math.log(p);
           }
           res = res / log1p(-prob) - 1;
  
           return Math.max(0, Math.ceil(res - 1e-12));
        };
     }
docs: Evaluates the geometric distribution's quantile function
  (inverse cdf) at `p`:
  $$\textrm{qexp}(\textrm{prob})(p) = x \textrm{ such that } \textrm{prob}(X \leq x) = p$$
  where $X$ is a random variable with the geometric distribution.
  
  Expects the probability parameter $0 < \textrm{prob} \leq 1$.
  
  `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.
  @fullName qgeom(prob, lowerTail, logp)(p)
  @memberof geometric