"Use your partial sum function and the sequence in 3a to produce a stream containing successive approximations to sin(x)"
I'm assuming the question is for me to have the value return, however, the output is "#< stream >" instead. What is wrong with my code or what am I missing?
my code for the said 3a is:
(define (sin-stream x)
(define(fact n)
(if (= n 1)
1
(* n (fact (- n 1)))))
(define (sign k)
(if (even? k)
1 -1))
(define (sin-str-term x k)
(/ (* (sign k)
(expt x (+ (* 2 k) 1)))
(fact (+ (* 2 k) 1))))
(define (sin-helper x k)
(stream-cons (sin-str-term x k)
(sin-helper x (+ k 1))))
(sin-helper x 0))
and the code I used for the partial sum function is:
(define (partial-sums s)
(stream-cons (stream-car s)
(add-streams (stream-cdr s) (partial-sums s))))
and the code I use to call the sin approximation is:
(define (sin-approx x)
(partial-sums (sin-stream x)))