Where is my flaw in the following code?
(define (newtons-method2 f guess n)
(define (newton-transform f)
(lambda (x)
(- x (/ (f x) ((der f 0.5) x)))))
(let ((next (newton-transform guess)))
(if (= 0 n)
next
(newtons-method2 (f next (- n 1))))))
The method is named "newtons-method2" because this was my second attempt at writing newton's method in scheme
My derivative function is as follows:
(define (der f h)
(lambda (x)
(/ (- (f(+ x h)) (f x))
h)))