1.17 Exercise 1.17
(define (fast-times a b) (cond ((= b 0) 0) ((even? b) (double (fast-times a (halve b)))) (else (+ a (fast-times a (- b 1))))))
fast-times works by using 2*a and b/2 as recursive values whenever b is even, in addition to adding a to (fast-times a (- b 1)) when it is odd (and positive). This significantly reduces the number of recursive calls made.