(define (smooth s)
(define (avpt x y)
(/ (+ x y) 2))
(cons-stream (avpt (stream-car s)
(stream-car (stream-cdr s)))
(smooth (stream-cdr s))))
(define (make-zero-crossings input-stream last-value)
(let ((new-stream (smooth (cons-stream last-value input-stream))))
(define (make-zero-crossings-temp stream)
(cons-stream
(sign-change-detector (stream-car stream)
(stream-car (stream-cdr stream)))
(make-zero-crossings-temp (stream-cdr stream))))
(make-zero-crossings-temp new-stream)))
(define (smooth s)
(stream-map (lambda (x y) (/ (+ x y) 2))
s
(stream-cdr s)))
(define (make-zero-crossings input-stream last-value)
(let ((new-stream (smooth (cons-stream last-value input-stream))))
(stream-map sign-change-detector new-stream
(cons-stream 0 new-stream))))