void rffti() {

        if (n == 1)
            return;
        final int twon = 2 * n;
        float argh;
        int ntry = 0, i, j;
        float argld;
        int k1, l1, l2, ib;
        float fi;
        int ld, ii, nf, ip, nl, is, nq, nr;
        float arg;
        int ido, ipm;
        int nfm1;

        nl = n;
        nf = 0;
        j = 0;

        factorize_loop: while (true) {
            ++j;
            if (j <= 4)
                ntry = factors[j - 1];
            else
                ntry += 2;
            do {
                nq = nl / ntry;
                nr = nl - ntry * nq;
                if (nr != 0)
                    continue factorize_loop;
                ++nf;
                wtable_r[nf + 1 + twon] = ntry;

                nl = nq;
                if (ntry == 2 && nf != 1) {
                    for (i = 2; i <= nf; i++) {
                        ib = nf - i + 2;
                        int idx = ib + twon;
                        wtable_r[idx + 1] = wtable_r[idx];
                    }
                    wtable_r[2 + twon] = 2;
                }
            } while (nl != 1);
            break factorize_loop;
        }
        wtable_r[twon] = n;
        wtable_r[1 + twon] = nf;
        argh = TWO_PI / (float) (n);
        is = 0;
        nfm1 = nf - 1;
        l1 = 1;
        if (nfm1 == 0)
            return;
        for (k1 = 1; k1 <= nfm1; k1++) {
            ip = (int) wtable_r[k1 + 1 + twon];
            ld = 0;
            l2 = l1 * ip;
            ido = n / l2;
            ipm = ip - 1;
            for (j = 1; j <= ipm; ++j) {
                ld += l1;
                i = is;
                argld = (float) ld * argh;

                fi = 0;
                for (ii = 3; ii <= ido; ii += 2) {
                    i += 2;
                    fi += 1;
                    arg = fi * argld;
                    int idx = i + n;
                    wtable_r[idx - 2] = (float)Math.cos(arg);
                    wtable_r[idx - 1] = (float)Math.sin(arg);
                }
                is += ido;
            }
            l1 = l2;
        }
    }