解:1.40
(define (cubic a b c) (lambda (x) (+ (* x x x) (* a x x) (* b x) c)))
1.41
(define (double f) (lambda (x) (f (f x))))
(double double) => (double (double f)),则
(double (double double)) => (double (double (double (double f))))
把inc代入f,得(((double (double double)) inc) 5)=21
1.42
(define (compose f g) (lambda (x) (f (g x))))
1.43
(define (repeated f n) (if (= n 1) f (compose f (repeated f (- n 1)))))
1.44
(define dx 0.00001) (define (smooth f) (lambda (x) (/ (+ (f (- x dx)) (f x) (f (+ x dx))) 3.0)))
n次平滑的生成函数为((repeated smooth n) f)
时间: 2024-10-11 22:51:20