Java Gamma gammaFunction(double in)

Here you can find the source of gammaFunction(double in)

Description

Returns gamma value for a double in.

License

Open Source License

Declaration

public static double gammaFunction(double in) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* w w  w.  j  av a 2  s .co  m*/
     * Returns gamma value for a double in.
     */
    public static double gammaFunction(double in) {
        if (in == 1.0) {
            return 1.0;
        }
        if (in == 0.5) {
            return Math.sqrt(Math.PI);
        }
        return (in - 1) * gammaFunction(in - 1);
    }
}

Related

  1. gamma(int alpha)
  2. gamma(int rgb)
  3. gammaCdf(double a, double x)
  4. gammaCdf(double a, double x)
  5. gammaCorrection(final float gamma, final float x)
  6. gammaFwd(double lc)
  7. gammaln(double x)
  8. gammaOfArgOn2Plus1(int d)
  9. gammaOfArgOn2Plus1IncludeDivisor(int d, double divisor)