faster factorial



>>>>> "Robert" == Robert Dodier <robert.dodier at gmail.com> writes:

    Richard> (defun k (n m) ;; (k n 1) is n!
    Richard> (declare (fixnum n m))
    Richard> (if (<= n m) n
    Richard> (* (k n (* 2 m))
    Richard> (k (- n m)(* 2 m)))))

    Robert> it's also faster to compute 20000! for clisp (4 x speedup).

    Robert> i'm in favor of replacing the existing factorial with this one
    Robert> (assuming it doesn't break something else of course),
    Robert> if we can find someone to take on the task.

I think I can do that.  But I can't guarantee it won't break anything
else; I can only guarantee it won't break the test suite.

Interestingly, clisp has a ! function built in:

[7]> (time (prog1 t (k 20000 1)))
Real time: 1.340305 sec.
Run time: 1.24 sec.
Space: 694672 Bytes
GC: 1, GC time: 0.07 sec.

[8]> (time (prog1 t (! 20000)))
Real time: 1.524501 sec.
Run time: 1.45 sec.
Space: 695976 Bytes
GC: 1, GC time: 0.02 sec.

So this byte-compiled function is even faster than clisp's builtin
function, which, I think is in C, not Lisp for this one test.

Ray

P.S.  I really like what you done with the bug tracker.  It's really
nice to have more categories for the different types of bugs.