(define (div-series num denom)
(let ((denom-const (stream-car denom)))
(if (zero? denom-const)
(error ("DIV-SERIES -- denominator constant term must be non-zero" ))
(mul-series num
(scale-stream ; restore the scaling factor
(invert-unit-series ; requires a stream that has a unit constant term
(scale-stream denom (/ 1 denom-const)))
denom-const)))))
(define tan-series (div-series sine-series
cosine-series))
(show-stream tan-series 10)
0
-1
0
-1/3
0
-2/15
0
-17/315
0
-62/2835
done

I’ve no idea how I can really test these values or whether they’re correct or not.

### Like this:

Like Loading...

*Related*