lib/statistics2.js
function pf(q, n1, n2) {
        var eps, fw, s, qe, w1, w2, w3, w4, u, u2, a, b, c, d;

        if (q < 0.0 || q > 1.0 || n1 < 1 || n2 < 1) {
            console.error('Error : Illegal parameter in pf()!');
            return 0.0;
        }

        if (n1 <= 240 || n2 <= 240) { eps = 1.0e-5; }
        if (n2 === 1) { eps = 1.0e-4; }

        fw = 0.0;
        s = 1000.0;
        while (true) {
            fw = fw + s;
            if (s <= eps) { return fw; }
            if ((qe = q_f(n1, n2, fw) - q) === 0.0) { return fw; }
            if (qe < 0.0) {
                fw = fw - s;
                s = s / 10.0;
            }
        }

        eps = 1.0e-6;
        qn = q;

        if (q < 0.5) { qn = 1.0 - q; }

        u = pnorm(qn);
        w1 = 2.0 / n1 / 9.0;
        w2 = 2.0 / n2 / 9.0;
        w3 = 1.0 - w1;
        w4 = 1.0 - w2;
        u2 = u * u;
        a = w4 * w4 - u2 * w2;
        b = -2.0 * w3 * w4;
        c = w3 * w3 - u2 * w1;
        d = b * b - 4 * a * c;

        if (d < 0.0) {
            fw = pfsub(a, b, 0.0);
        } else {
            if (a.abs > eps) {
                fw = pfsub(a, b, d);
            } else {
                if (abs(b) > eps) { return -c / b; }
                fw = pfsub(a, b, 0.0);
            }
        }

        return fw * fw * fw;
    }
function pf(q, n1, n2) {
        var eps, fw, s, qe, w1, w2, w3, w4, u, u2, a, b, c, d;

        if (q < 0.0 || q > 1.0 || n1 < 1 || n2 < 1) {
            console.error('Error : Illegal parameter in pf()!');
            return 0.0;
        }

        if (n1 <= 240 || n2 <= 240) { eps = 1.0e-5; }
        if (n2 === 1) { eps = 1.0e-4; }

        fw = 0.0;
        s = 1000.0;
        while (true) {
            fw = fw + s;
            if (s <= eps) { return fw; }
            if ((qe = q_f(n1, n2, fw) - q) === 0.0) { return fw; }
            if (qe < 0.0) {
                fw = fw - s;
                s = s / 10.0;
            }
        }

        eps = 1.0e-6;
        qn = q;

        if (q < 0.5) { qn = 1.0 - q; }

        u = pnorm(qn);
        w1 = 2.0 / n1 / 9.0;
        w2 = 2.0 / n2 / 9.0;
        w3 = 1.0 - w1;
        w4 = 1.0 - w2;
        u2 = u * u;
        a = w4 * w4 - u2 * w2;
        b = -2.0 * w3 * w4;
        c = w3 * w3 - u2 * w1;
        d = b * b - 4 * a * c;

        if (d < 0.0) {
            fw = pfsub(a, b, 0.0);
        } else {
            if (a.abs > eps) {
                fw = pfsub(a, b, d);
            } else {
                if (abs(b) > eps) { return -c / b; }
                fw = pfsub(a, b, 0.0);
            }
        }

        return fw * fw * fw;
    }
function pf ( q , n1 , n2 ) { var eps , fw , s , qe , w1 , w2 , w3 , w4 , u , u2 , a , b , c , d ; if ( q < 0.0 || q > 1.0 || n1 < 1 || n2 < 1 ) { console . error ( 'Error : Illegal parameter in pf()!' ) ; return 0.0 ; } if ( n1 <= 240 || n2 <= 240 ) { eps = 1.0e-5 ; } if ( n2 === 1 ) { eps = 1.0e-4 ; } fw = 0.0 ; s = 1000.0 ; while ( true ) { fw = fw + s ; if ( s <= eps ) { return fw ; } if ( ( qe = q_f ( n1 , n2 , fw ) - q ) === 0.0 ) { return fw ; } if ( qe < 0.0 ) { fw = fw - s ; s = s / 10.0 ; } } eps = 1.0e-6 ; qn = q ; if ( q < 0.5 ) { qn = 1.0 - q ; } u = pnorm ( qn ) ; w1 = 2.0 / n1 / 9.0 ; w2 = 2.0 / n2 / 9.0 ; w3 = 1.0 - w1 ; w4 = 1.0 - w2 ; u2 = u * u ; a = w4 * w4 - u2 * w2 ; b = - 2.0 * w3 * w4 ; c = w3 * w3 - u2 * w1 ; d = b * b - 4 * a * c ; if ( d < 0.0 ) { fw = pfsub ( a , b , 0.0 ) ; } else { if ( a . abs > eps ) { fw = pfsub ( a , b , d ) ; } else { if ( abs ( b ) > eps ) { return - c / b ; } fw = pfsub ( a , b , 0.0 ) ; } } return fw * fw * fw ; }
[x, \infty)
[ x \ infty )