{"width":"100%","image_url":null,"title":"SICP\u306e\u52c9\u5f37 \u554f\u984c1.16","categories":["Clojure","SICP"],"blog_title":"Arantium Maestum","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2016%2F06%2F03%2F104928\" title=\"SICP\u306e\u52c9\u5f37 \u554f\u984c1.16 - Arantium Maestum\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","author_name":"zehnpaard","url":"https://zehnpaard.hatenablog.com/entry/2016/06/03/104928","type":"rich","height":"190","author_url":"https://blog.hatena.ne.jp/zehnpaard/","version":"1.0","published":"2016-06-03 10:49:28","provider_url":"https://hatena.blog","description":"SICP1.2.4\u306e\u554f\u984c1.16\u3092\u89e3\u3044\u3066\u307f\u308b\u3002 (defn fast-exp-iter [b n] (loop [n n x 1 y b z 1] (cond (zero? n) z (< n (* 2 x)) (recur (- n x) 1 b (* y z)) :else (recur n (* 2 x) (* y y) z)))) \u5f15\u6570\u540d\u304c\u8003\u3048\u3064\u304b\u306a\u304b\u3063\u305f\u3001\u3068\u3044\u3046\u306e\u306f\u3044\u3064\u3082\u306e\u5f01\u3002 n = 2a1 + 2a2 ... 2an (a1 > a2 > ... > an) \u3068\u8003\u3048\u3066\u3001b\u306ba1\u56de\u4e8c\u4e57\u3057\u7d9a\u3051\u305f\u3082\u306e\u3068\u3001a2\u56de\u4e8c\u4e57\u3057\u7d9a\u3051\u305f\u3082\u306e\u3068...\u3092\u5168\u3066\u639b\u3051\u5408\u308f\u305b\u3066\u3044\u308b\u3002 \u3088\u308aclojure\u7684\u306b\u66f8\u304f\u2026","blog_url":"https://zehnpaard.hatenablog.com/"}