class TDistribution extends AbstractRealDistribution {

    public double cumulativeProbability(double x) {
        double ret;
        if (x == 0) {
            ret = 0.5;
        } else {
            double t =
                Beta.regularizedBeta(
                    degreesOfFreedom / (degreesOfFreedom + (x * x)),
                    0.5 * degreesOfFreedom,
                    0.5);
            if (x < 0.0) {
                ret = 0.5 * t;
            } else {
                ret = 1.0 - 0.5 * t;
            }
        }

        return ret;
    }

    public  TDistribution(double degreesOfFreedom);
    public  TDistribution(double degreesOfFreedom, double inverseCumAccuracy);
    public  TDistribution(RandomGenerator rng, double degreesOfFreedom);
    public  TDistribution(RandomGenerator rng,
                         double degreesOfFreedom,
                         double inverseCumAccuracy);

}