-> (a -> a) -- ^ The derivative of @f@
-> a -- ^ Initial guess, x-naught
-> [a]
-newton_iterations f f' x0 =
- iterate next x0
+newton_iterations f f' =
+ iterate next
where
next xn =
xn - ( (f xn) / (f' xn) )
-> a -- ^ Initial guess, x-naught
-> a -- ^ Second initial guess, x-one
-> [a]
-secant_iterations f x0 x1 =
- iterate2 g x0 x1
+secant_iterations f =
+ iterate2 g
where
g prev2 prev1 =
let x_change = prev1 - prev2