Problem 3.3: Exp (100 pts)
For this problem, you may use the naturals
, combine-with
, factorials
defined above and built-in function expt
. We highly recommend you do not define any other helper functions. Such problems are likely to appear on final exam.
Write function exp
, which returns a stream where the n
th term represents the degree-n polynomial expantion for \( e^x \), which is \( \sum\limits_{i=0}^n{{x^i} \over {i!}} \).
(define (exp x)
'YOUR-CODE-HERE
)
;;; Tests
; scm> (slice (exp 2) 0 5)
; (1 3 5 6.333333333 7)