Probably faster alternative to <<.
(fast-<< x y) is logically the same as (<< x y). However, it is probably faster because:
Function:
(defun fast-<< (x y) (declare (xargs :guard t)) (cond ((atom x) (if (atom y) (cond ((integerp x) (cond ((integerp y) (< x y)) ((real/rationalp y) (< x y)) (t t))) ((symbolp x) (if (symbolp y) (and (not (eq x y)) (symbol< x y) t) (not (or (integerp y) (stringp y) (characterp y) (real/rationalp y) (complex/complex-rationalp y))))) ((stringp x) (cond ((stringp y) (and (string< x y) t)) ((integerp y) nil) ((symbolp y) t) (t (not (or (characterp y) (real/rationalp y) (complex/complex-rationalp y)))))) ((characterp x) (cond ((characterp y) (< (char-code x) (char-code y))) (t (not (or (integerp y) (real/rationalp y) (complex/complex-rationalp y)))))) ((real/rationalp x) (cond ((integerp y) (< x y)) ((real/rationalp y) (< x y)) (t t))) ((real/rationalp y) nil) ((complex/complex-rationalp x) (cond ((complex/complex-rationalp y) (or (< (realpart x) (realpart y)) (and (= (realpart x) (realpart y)) (< (imagpart x) (imagpart y))))) (t t))) ((or (symbolp y) (stringp y) (characterp y) (complex/complex-rationalp y)) nil) (t (and (bad-atom<= x y) (not (equal x y))))) t)) ((atom y) nil) ((equal (car x) (car y)) (fast-<< (cdr x) (cdr y))) (t (fast-<< (car x) (car y)))))
Theorem:
(defthm fast-<<-is-<< (equal (fast-<< x y) (<< x y)))