SICP exercise 1.15
From Drewiki
Problem
The sine of an angle (specified in radians) can be computed by making use of the approximation
if x is sufficiently small, and the trigonometric identity
to reduce the size of the argument of sin. (For purposes of this exercise an angle is considered "sufficiently small" if its magnitude is not greater than 0.1 radians.) These ideas are incorporated in the following procedures:
Problem A. How many times is the procedure p applied when (sine 12.15) is evaluated?
Problem B. What is the order of growth in space and number of steps (as a function of a) used by the process generated by the sine procedure when (sine a) is evaluated?
Solution A
Let's evaluate (sine 12.15) by the substitution model to find the answer to this problem:
Procedure p is applied 5 times.
Solution B
Both procedure p and procedure cube perform a constant number of steps and require a constant amount of storage (assuming that procedures - and * are θ(1)). The order of growth in space and number of steps for procedure sine, then, is proportional to log3 of the argument, since each non-terminating step in the evaluation of (sine a) divides a by 3. Hence, procedure sine is order logn both in space and in the number of steps.

