private void butterflyStage(double[] from, double[] to, int numFftPoints, int currentDistance) {
        int ndx1From;
        int ndx2From;
        int ndx1To;
        int ndx2To;
        int ndxWeightFft;

        if (currentDistance > 0) {
            int twiceCurrentDistance = 2 * currentDistance;

            for (int s = 0; s < currentDistance; s++) {
                ndx1From = s;
                ndx2From = s + currentDistance;
                ndx1To = s;
                ndx2To = s + (numFftPoints >> 1);
                ndxWeightFft = 0;
                while (ndxWeightFft < (numFftPoints >> 1)) {
                    /**
                     * <b>weightFftTimesFrom2 = weightFft[k] </b> <b>*from[ndx2From] </b>
                     */
                    this.weightFftTimesFrom2 = multiplyCmplx(this.weightFft[2 * ndxWeightFft],
                            this.weightFft[2 * ndxWeightFft + 1], from[2 * ndx2From],
                            from[2 * ndx2From + 1]);
                    /**
                     * <b>to[ndx1To] = from[ndx1From] </b> <b>+ weightFftTimesFrom2 </b>
                     */
                    to[2 * ndx1To] = from[2 * ndx1From] + this.weightFftTimesFrom2[0];
                    to[2 * ndx1To + 1] = from[2 * ndx1From + 1] + this.weightFftTimesFrom2[1];

                    /**
                     * <b>to[ndx2To] = from[ndx1From] </b> <b>- weightFftTimesFrom2 </b>
                     */
                    to[2 * ndx2To] = from[2 * ndx1From] - this.weightFftTimesFrom2[0];
                    to[2 * ndx2To + 1] = from[2 * ndx1From + 1] - this.weightFftTimesFrom2[1];

                    ndx1From += twiceCurrentDistance;
                    ndx2From += twiceCurrentDistance;
                    ndx1To += currentDistance;
                    ndx2To += currentDistance;
                    ndxWeightFft += currentDistance;
                }
            }

            /**
             * This call'd better be the last call in this block, so when it returns we go straight
             * into the return line below. We switch the <i>to </i> and <i>from </i> variables, the
             * total number of points remains the same, and the <i>currentDistance </i> is divided
             * by 2.
             */
            butterflyStage(to, from, numFftPoints, (currentDistance >> 1));
        }
        return;
    }