(require 'stdlib) (define (smooth f dx) "return the average value of f over the interval 2*dx around some x" (lambda (x) (/ (+ (f (- x dx)) (f x) (f (+ x dx))) 3))) (define (f x) (sin x)) (define f-smooth-0.5 (smooth f 0.5)) (define (f-smooth x) (f-smooth-0.5 x)) (let ((x 0)) (while (< x 3.14) (printf "%s %s %s\n" x (f x) (f-smooth x)) (setq x (+ x 0.1))))