2 (:use [sicp utils ch2_1_extended ex2_7]
6 (defn sub-interval [x y]
7 (make-interval (- (lower-bound x) (upper-bound y))
8 (- (upper-bound x) (lower-bound y))))
10 ;; subtraction of an interval can be seen as addition of a
11 ;; negative range. Intuitively, if you plot a range in a 2-D graph,
12 ;; negative of a range, say [a1, a2] for say a1 and a2 positive
13 ;; is [-a2, -a1]. i.e. the reflection of the range w.r.t the x=0
14 ;; axis. In this new light, we are adding two ranges [-a2,-a2] and [b1,b2]
15 ;; and hence the above answer.