sicp/1_44.sch

11 lines
191 B
Scheme

(load "1_43.sch") ; for repeated
(define dx 0.001)
(define (smooth f)
(lambda (x)
(/ (+ (f (- x dx)) (f x) (f (+ x dx))) 3)))
(define (n-fold-smooth f n)
((repeated smooth n) f))