Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- type Coefficients = []
- eval :: Num a => Coefficients a -> a -> a
- hasIntRootBetween :: Integral a => Coefficients a -> a -> a -> Bool
- findIntRootBetween :: Integral a => Coefficients a -> a -> a -> Maybe a
Documentation
type Coefficients = [] Source #
Polynomials are represented by coefficient lists. For example, /7 + 5x - 4x^2 +
12x^4/ has coefficients [7, 5, -4, 0, 12]
.
eval :: Num a => Coefficients a -> a -> a Source #
is the value of the polynomial with coefficients eval
cfs xcfs
at point
x
hasIntRootBetween :: Integral a => Coefficients a -> a -> a -> Bool Source #
tells whether there exists an integral root of the
polynomial having coefficients hasIntRootBetween
cfs a bcfs
on the inclusive interval [a, b].
findIntRootBetween :: Integral a => Coefficients a -> a -> a -> Maybe a Source #
is an integral root of the polynomial having
coefficients findIntRootBetween
cfs a bcfs
on the inclusive interval [a, b], if one exists.