void rfftf(final float a[], final int offa) {
        if (n == 1)
            return;
        int l1, l2, na, kh, nf, ip, iw, ido, idl1;

        final float[] ch = new float[n];
        final int twon = 2 * n;
        nf = (int) wtable_r[1 + twon];
        na = 1;
        l2 = n;
        iw = twon - 1;
        for (int k1 = 1; k1 <= nf; ++k1) {
            kh = nf - k1;
            ip = (int) wtable_r[kh + 2 + twon];
            l1 = l2 / ip;
            ido = n / l2;
            idl1 = ido * l1;
            iw -= (ip - 1) * ido;
            na = 1 - na;
            switch (ip) {
            case 2:
                if (na == 0) {
                    radf2(ido, l1, a, offa, ch, 0, iw);
                } else {
                    radf2(ido, l1, ch, 0, a, offa, iw);
                }
                break;
            case 3:
                if (na == 0) {
                    radf3(ido, l1, a, offa, ch, 0, iw);
                } else {
                    radf3(ido, l1, ch, 0, a, offa, iw);
                }
                break;
            case 4:
                if (na == 0) {
                    radf4(ido, l1, a, offa, ch, 0, iw);
                } else {
                    radf4(ido, l1, ch, 0, a, offa, iw);
                }
                break;
            case 5:
                if (na == 0) {
                    radf5(ido, l1, a, offa, ch, 0, iw);
                } else {
                    radf5(ido, l1, ch, 0, a, offa, iw);
                }
                break;
            default:
                if (ido == 1)
                    na = 1 - na;
                if (na == 0) {
                    radfg(ido, ip, l1, idl1, a, offa, ch, 0, iw);
                    na = 1;
                } else {
                    radfg(ido, ip, l1, idl1, ch, 0, a, offa, iw);
                    na = 0;
                }
                break;
            }
            l2 = l1;
        }
        if (na == 1)
            return;
        System.arraycopy(ch, 0, a, offa, n);
    }