anchor.diff:                (if inv "T" "F"))
         (loop for i upto max do
           (format t "~A: ~A~%" i (/ (test-window (ash 1 i)
  +                                               :fwd fwd-maker
  +                                               :inv inv-maker
                                                  :window window
                                                  :window-fwd fwd
                                                  :window-inv inv)
  
positive.code:         (setf max-diff 1d9))
      max-diff))
  
  (defun test-pairs (n &optional (fwd-scale 1d0))
    (assert (= 1 (logcount n)))
    (let* ((fwd (compile nil
                         `(lambda (vec start twiddle)
                            (declare (type complex-sample-array 
                                           vec twiddle)
                                     (type index start))
                            twiddle
                            ,(gen-dif n :scale fwd-scale))))
           (inv (compile nil
                         `(lambda (vec start twiddle)
                            (declare (type complex-sample-array 
                                           vec twiddle)
                                     (type index start))
                            twiddle
                            ,(gen-dit n :scale (/ 1d0 n fwd-scale)))))
           (iota (random-vector n))
           (copy (copy-seq iota)))
      (funcall fwd copy 0
               (make-twiddle n))
      (funcall inv copy 0
               (make-twiddle n -1d0))
      (delta iota copy)))
  
  (defun run-pairs (max)
    (format t "scale: 1~%")
    (loop for i upto max
          do (format t "~A: ~A~%" i (/ (test-pairs (ash 1 i))
                                       (max i 1))))
    (format t "scale: sqrt~%")
    (loop for i upto max
          do (format t "~A: ~A~%" i (/ (test-pairs (ash 1 i)
                                                   (/ (sqrt (float (ash 1 i) 1d0))))
                                       (max i 1))))
    (format t "scale: 1/n~%")
    (loop for i upto max
          do (format t "~A: ~A~%" i (/ (test-pairs (ash 1 i)
                                                   (/ (float (ash 1 i) 1d0)))
                                       (max i 1)))))
  
  (defun make-dummy-window (n)
    (map-into (make-array n :element-type 'double-float)
  
negative.code:            (type (simple-array double-float 1) window))
    (map-into vec #'/ vec window))
  
  (defun make-windowed-fwd (n window)
    (let ((fun (compile nil
                        `(lambda (vec start window window-start twiddle)
                           (declare (type complex-sample-array 
                                          vec twiddle)
                                    (type (simple-array double-float 1)
                                          window)
                                    (type index start window-start))
                           twiddle window window-start
                           ,(gen-dif n :scale  (/ (sqrt (float n 1d0)))
                                       :window (and window 'window)))))
          (twiddle (make-twiddle n)))
      (lambda (vec window)
        (funcall fun vec 0 window 0 twiddle))))
  
  (defun make-windowed-inv (n window)
    (let ((fun (compile nil
                        `(lambda (vec start window window-start twiddle)
                           (declare (type complex-sample-array 
                                          vec twiddle)
                                    (type (simple-array double-float 1)
                                          window)
                                    (type index start window-start))
                           twiddle window window-start
                           ,(gen-dit n :scale  (/ (sqrt (float n 1d0)))
                                       :window (and window 'window)))))
          (twiddle (make-twiddle n -1d0)))
      (lambda (vec window)
        (funcall fun vec 0 window 0 twiddle))))
  
  (defun get-fancy-windowed-fwd (n window)
    (if window
        (get-windowed-fft n 'float
                          :scale :sqrt
                          :in-order *fancy-in-order*)
        (let ((fun (get-fancy-fwd n (/ (sqrt (float n 1d0))))))
          (lambda (vec window)
            window
            (funcall fun vec)))))
  
  (defun get-fancy-windowed-inv (n window)
    (if window
        (get-windowed-fft n 'float
                          :forward nil
                          :scale :sqrt
                          :in-order *fancy-in-order*)
        (let ((fun (get-fancy-inv n (/ (sqrt (float n 1d0))))))
          (lambda (vec window)
            window
            (funcall fun vec)))))
  
  (defun test-window (n &key (window (make-dummy-window n))
                          (window-fwd t)
                          (window-inv t)
                          (fwd 'make-windowed-fwd)
                          (inv 'make-windowed-inv))
    (assert (= 1 (logcount n)))
    (let* ((fwd   (funcall fwd n window-fwd))
           (inv   (funcall inv n window-inv))
           (iota (random-vector n))
           (copy (copy-seq iota)))
      (when window-fwd
        (apply-window-inv copy window))
      (funcall fwd copy window)
      (when window-inv
        (apply-window-inv copy window))
      (funcall inv copy window)
      (delta iota copy)))
  
  (defun run-windows (max
                      &key (fwd-maker 'make-windowed-fwd)
                           (inv-maker 'make-windowed-inv)
                      &aux (window (make-dummy-window (ash 1 max))))
    (dolist (fwd '(t nil))
      (dolist (inv (if fwd '(t nil) '(t)))
        (format t "window: ~A ~A~%"
  