-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsol-1.15.tex
24 lines (24 loc) · 933 Bytes
/
sol-1.15.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
\begitems\style a
* The process carried out when evaluating `(sine 12.15)` is the following:
\begtt\scm
(sine 12.15)
(p (sine 4.05))
(p (p (sine 1.3499999999999999)))
(p (p (p (sine 0.44999999999999996))))
(p (p (p (p (sine 0.15)))))
(p (p (p (p (p (sine 0.049999999999999996))))))
(p (p (p (p (p 0.049999999999999996)))))
(p (p (p (p 0.1495))))
(p (p (p 0.4351345505)))
(p (p 0.9758465331678772))
(p -0.7895631144708228)
-0.39980345741334
\endtt
We see that `p` is applied $5$ times.
\smallskip
* The space and the number of steps needed to evaluate `(sine a)` are both proportional to the number of times $n$ that the angle $a$ gets divided by~$3$ before the resulting angle is less than or equal to~$0.1$, that is
$$
n = \min\bigl\{\,x\in \BbbN : {a\over 3^x} \leq 0.1\,\bigr\} = \bigl\lceil\log_3{a \over 0.1}\bigr\rceil \hbox{.}
$$
This means that the number of steps and the space required grow as~$\Theta(\log a)$.
\enditems