  const EPSILON = 1e-8;
            let sum = 0;
            let term = x ** a * (1 - x) ** b / betaFunction(a, b);
            let n = 0;

            while (Math.abs(term) > EPSILON) {
                sum += term;
                n++;
                term *= (a + n - 1) * x / n;
                term *= (1 - x);
            }

            return sum;
        }

        function studentTCDF(t, df) {
            const x = df / (t * t + df);
            const probability = 1 - 0.5 * incBetaFunction(x, df / 2,