docs: 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));
        };
     }