roots-0.1.1.2: Root-finding algorithms (1-dimensional)

Safe HaskellSafe-Inferred

Math.Root.Finder.Newton

Synopsis

Documentation

data Newton a b Source

Instances

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.