Arantium Maestum

プログラミング、囲碁、読書の話題

2016-06-04から1日間の記事一覧

SICPの勉強 問題1.40

SICP1.3.4の問題1.40を解いてみる。 x3 + ax2 + bx + c = 0の解をNewton's Methodで解く関数を作成する。 とりあえずNewton's Methodの実装: (defn deriv [g] (let [dx 0.00001] (fn [x] (/ (- (g (+ x dx)) (g x)) dx)))) (defn newton-transform [g] (fn …