3 [sicp [ch2-2 :only (accumulate)]]))
5 ;; horner's rule. Extensively used in signal processing world
6 ;; Assume that the coefficients of the polynomial are arranged
7 ;; in a sequence, from a0 through an.
8 (defn horner-eval [x coeff-seq]
9 (accumulate (fn [this-coeff higher-terms]
15 ;; 1 + 3x + 5x^3 + x^5 at x = 2
16 (deftest test-horners-poly
17 (is [= (horner-eval 2 '(1 3 0 5 0 1))