2015/10/09

SICP 問題1.44

平滑化関数とn重平滑化関数

(define (smooth f)
  (let ((dx 0.0001))
    (lambda (x)
      (/ (+ (f (- x dx))
            (f x)
            (f (+ x dx)))
         3))))

(define (n-fold-smooth f n)
  (lambda (x)
    ((repeated smooth n) x)))

© 2022 wat-aro