Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (9 sloc) 305 Bytes
(load "../lib/accumulate")
(define (horner-eval x coefficient-sequence)
(accumulate (lambda (this-coeff higher-terms)
(+ this-coeff
(* x higher-terms)))
0
coefficient-sequence))
;;; 使用例
(horner-eval 2 (list 1 3 0 5 0 1)) ; 79