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

Safe HaskellSafe-Inferred

Math.Root.Finder.Bisection

Synopsis

Documentation

data Bisect a b Source

Bisect an interval in search of a root. At all times, f (estimateRoot _) is less than or equal to 0 and f (estimateRoot _ + estimateError _) is greater than or equal to 0.

Instances

(Fractional a, Eq a, Ord b, Num b) => RootFinder Bisect a b 
(Eq a, Eq b) => Eq (Bisect a b) 
(Eq (Bisect a b), Ord a, Ord b) => Ord (Bisect a b) 
(Show a, Show b) => Show (Bisect a b) 

bisection :: (Ord a, Fractional a, Ord b, Num b) => (a -> b) -> a -> a -> a -> Either (Bisect a b) aSource

Using bisection, return a root of a function known to lie between x1 and x2. The root will be refined till its accuracy is +-xacc. If convergence fails, returns the final state of the search.