docs: function pbeta(a, b, lowerTail, logp) {
        logp = logp === true;
        lowerTail = lowerTail !== false;
  
        /* eslint-disable complexity */
        return function(x) {
           if (utils.hasNaN(x, a, b) || a < 0 || b < 0) { return NaN; }
  
           if (x <= 0) { return utils.adjustLower(0, lowerTail, logp); }
           if (x >= 1) { return utils.adjustLower(1, lowerTail, logp); }
  
           // Point mass limit cases
           if (a === 0 && b === 0) { // point mass 1/2 at each of {0,1}
              return logp ? Math.log(0.5) : 0.5;
           }
           if (a === Infinity && b === Infinity) { // point mass 1 at 1/2
              return utils.adjustLower(x < 0.5 ? 0 : 1, lowerTail, logp);
           }
           if (a / b === 0) { // point mass 1 at 0 ==> P(X <= x) = 1, all x > 0
              return utils.adjustLower(1, lowerTail, logp);
           }
           if (b / a === 0) { // point mass 1 at 1 ==> P(X <= x) = 0, all x < 1
              return utils.adjustLower(0, lowerTail, logp);
           }
           return bratio(a, b, x, lowerTail, logp);
        };
        /* eslint-enable complexity */
     }