docs: function pgeom(prob, lowerTail, logp) {
        logp = logp === true;
        lowerTail = lowerTail !== false;
  
        if (prob <= 0 || prob > 1 || utils.hasNaN(prob)) {
           return function(x) { return NaN; };
        }
        if (prob === 1) {
           return function(x) {
              var ret;
  
              if (utils.hasNaN(x)) { return NaN; }
              ret = x < 0 ? 0 : 1;
              ret = lowerTail ? ret : 1 - ret;
              return logp ? Math.log(ret) : ret;
           };
        }
  
        return function(x) {
           var ret;
  
           if (utils.hasNaN(x)) { return NaN; }
  
           x = Math.floor(x + 1e-14);
  
           if (x < 0) {
              ret = lowerTail ? 0 : 1;
              return logp ? Math.log(ret) : ret;
           }
  
           // basic behavior
           ret = log1p(-prob) * (x + 1); // log ((1-p)^(x+1));
           if (lowerTail) {
              return logp ? log1p(-Math.exp(ret)) : -expm1(ret);
           }
           // else right tail
           return logp ? ret : Math.exp(ret);
        };
     }