code: function bratio(a, b, x, lowerTail, logp) {
       var resLog;
  
       resLog = bratioLog(a, b, x);
       lowerTail = lowerTail !== false;
       logp = logp === true;
       resLog = lowerTail ? resLog.lower : resLog.upper;
       return logp ? resLog : Math.exp(resLog);
     }
docs: /* eslint-enable complexity, max-statements 
  Returns the lower tail of the incomplete beta function
  $$I_x(a, b)=G(a,b)\int_0^xt^{a-1}(1-t)^{b-1}dt$$
  where $B(a,b)=1/G(a,b) = \Gamma(a)\Gamma(b)/\Gamma(a+b)$ is the
  usual beta function.
  
  If `lowerTail` is `false`, returns the upper tail instead.
  If `logp` is `true`, returns the logarithm of the tail.
  Expects $a>0$, $b>0$, and $0 \leq x \leq 1$.
  
  Based on: *Algorithm 708: Significant Digit Computation of the Incomplete Beta Function
  Ratios*, by DiDonato and Morris, 1992
  @memberof basicFunc