Exercise 1.15

(define (cube x) (* x x x))
(define (p x) (- (* 3 x) (* 4 (cube x))))
(define (sine theta)
  (if (<= (abs theta) 0.1)
      theta
      (p (sine (/ theta 3.0)))))

a. The procedure p is evaluated five times for (sine 12.15):

scheme (sine 12.15) ~> (p (sine 4.05)) ~> (p (p (sine 1.35))) ~> (p (p (p (sine 0.45)))) ~> (p (p (p (p (sine 0.15))))) ~> (p (p (p (p (p (sine 0.05)))))) ; five times until theta <= 0.1

b. During the process, p is evaluated \(k\) times such that \(\theta / 3^k < 0.1\). Solving for \(k\) gives \(k = \log10\theta / \log3\), thus the number of steps for sine grows as \(\Theta(\log n)\). The interpreter must maintain the stack for that number of calls to p, so the space complexity is also \(\Theta(\log n)\).