Nicolas Neuss <[EMAIL PROTECTED]> writes:
> (setf (aref entries pos2)
> (* 0.1111111111
> (+ (aref entries (the uint (+ pos2 -101))) ; !! -1001
> (aref entries (the uint (+ pos2 -1)))
> (aref entries (the uint (+ pos2 99))) ; !! 999
> (aref entries (the uint (+ pos2 -100))) ; !! -1000
> (aref entries (the uint (+ pos2 0)))
> (aref entries (the uint (+ pos2 100))) ; !! 1000
> (aref entries (the uint (+ pos2 -99))) ; !! -999
> (aref entries (the uint (+ pos2 1)))
> (aref entries (the uint (+ pos2 101)))))))))) ; !! 1001
This produces slighly better code:
(let ((a0 (aref entries (the uint (- pos2 1001))))
(a1 (aref entries (the uint (- pos2 1000))))
(a2 (aref entries (the uint (- pos2 999))))
(a3 (aref entries (the uint (+ pos2 999))))
(a4 (aref entries (the uint (+ pos2 1000))))
(a5 (aref entries (the uint (+ pos2 1001))))
(a6 (aref entries (the uint (- pos2 1))))
(a7 (aref entries (the uint (- pos2 0))))
(a8 (aref entries (the uint (+ pos2 1)))))
(setf (aref entries pos2)
(* 0.1111111111 (+ a0 a1 a2 a3 a4 a5 a6 a7 a8))))))))