roots- Root-finding algorithms (1-dimensional)




data Newton a b Source


Fractional a => RootFinder Newton a (a, a) 
Eq a => Eq (Newton a b) 
Show a => Show (Newton a b) 

newton :: (Ord a, Fractional a) => (a -> (a, a)) -> a -> a -> a -> Either (Newton a (a, a)) aSource

newton f x1 x2 xacc: using Newton's method, return a root of a function known to lie between x1 and x2. The root is refined until its accuracy is += xacc.

The function passed should return a pair containing the value of the function and its derivative, respectively.