docs: void cffti() {
  		if (n == 1)
  			return;
  
  		final int twon = 2 * n;
  		final int fourn = 4 * n;
  		double argh;
  		int idot, ntry = 0, i, j;
  		double argld;
  		int i1, k1, l1, l2, ib;
  		double fi;
  		int ld, ii, nf, ip, nl, nq, nr;
  		double arg;
  		int ido, ipm;
  
  		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[nf + 1 + fourn] = ntry;
  				nl = nq;
  				if (ntry == 2 && nf != 1) {
  					for (i = 2; i <= nf; i++) {
  						ib = nf - i + 2;
  						int idx = ib + fourn;
  						wtable[idx + 1] = wtable[idx];
  					}
  					wtable[2 + fourn] = 2;
  				}
  			} while (nl != 1);
  			break factorize_loop;
  		}
  		wtable[fourn] = n;
  		wtable[1 + fourn] = nf;
  		argh = TWO_PI / (double) n;
  		i = 1;
  		l1 = 1;
  		for (k1 = 1; k1 <= nf; k1++) {
  			ip = (int) wtable[k1 + 1 + fourn];
  			ld = 0;
  			l2 = l1 * ip;
  			ido = n / l2;
  			idot = ido + ido + 2;
  			ipm = ip - 1;
  			for (j = 1; j <= ipm; j++) {
  				i1 = i;
  				wtable[i - 1 + twon] = 1;
  				wtable[i + twon] = 0;
  				ld += l1;
  				fi = 0;
  				argld = ld * argh;
  				for (ii = 4; ii <= idot; ii += 2) {
  					i += 2;
  					fi += 1;
  					arg = fi * argld;
  					int idx = i + twon;
  					wtable[idx - 1] = Math.cos(arg);
  					wtable[idx] = Math.sin(arg);
  				}
  				if (ip > 5) {
  					int idx1 = i1 + twon;
  					int idx2 = i + twon;
  					wtable[idx1 - 1] = wtable[idx2 - 1];
  					wtable[idx1] = wtable[idx2];
  				}
  			}
  			l1 = l2;
  		}
  
  	}