; three powering algorithms
(define (pow-linear b e)
(if (zero? e) 1
(* b (pow-linear b (- e 1)))))
(display (pow-linear 2 16)) (newline)
(define (pow-logarithmic b e)
(cond ((zero? e) 1)
((even? e) (pow-logarithmic (* b b) (/ e 2)))
(else (* b (pow-logarithmic (* b b) (/ (- e 1) 2))))))
(display (pow-logarithmic 2 16)) (newline)
(define (pow-constant b e)
(display (pow-constant 2 16)) (newline)
OyB0aHJlZSBwb3dlcmluZyBhbGdvcml0aG1zCgooZGVmaW5lIChwb3ctbGluZWFyIGIgZSkKICAoaWYgKHplcm8/IGUpIDEKICAgICgqIGIgKHBvdy1saW5lYXIgYiAoLSBlIDEpKSkpKQoKKGRpc3BsYXkgKHBvdy1saW5lYXIgMiAxNikpIChuZXdsaW5lKQoKKGRlZmluZSAocG93LWxvZ2FyaXRobWljIGIgZSkKICAoY29uZCAoKHplcm8/IGUpIDEpCiAgICAgICAgKChldmVuPyBlKSAocG93LWxvZ2FyaXRobWljICgqIGIgYikgKC8gZSAyKSkpCiAgICAgICAgKGVsc2UgKCogYiAocG93LWxvZ2FyaXRobWljICgqIGIgYikgKC8gKC0gZSAxKSAyKSkpKSkpCgooZGlzcGxheSAocG93LWxvZ2FyaXRobWljIDIgMTYpKSAobmV3bGluZSkKCihkZWZpbmUgKHBvdy1jb25zdGFudCBiIGUpCiAgKGV4cCAoKiAobG9nIGIpIGUpKSkKCihkaXNwbGF5IChwb3ctY29uc3RhbnQgMiAxNikpIChuZXdsaW5lKQ==