code: public static double beta(double x, double y) {
          return Math.exp(Gamma.lgamma(x) + Gamma.lgamma(y) - Gamma.lgamma(x + y));
      }
docs: Beta function, also called the Euler integral of the first kind.
  The beta function is symmetric, i.e. B(x,y)==B(y,x).