- data Endianness
- data Poly a
- poly :: Num a => Endianness -> [a] -> Poly a
- polyCoeffs :: Num a => Endianness -> Poly a -> [a]
- polyIsZero :: Num a => Poly a -> Bool
- polyIsOne :: Num a => Poly a -> Bool
- zero :: Num a => Poly a
- one :: Num a => Poly a
- x :: Num a => Poly a
- scalePoly :: Num a => a -> Poly a -> Poly a
- negatePoly :: Num a => Poly a -> Poly a
- addPoly :: Num a => Poly a -> Poly a -> Poly a
- sumPolys :: Num a => [Poly a] -> Poly a
- multPoly :: Num a => Poly a -> Poly a -> Poly a
- powPoly :: (Num a, Integral b) => Poly a -> b -> Poly a
- quotRemPoly :: Fractional a => Poly a -> Poly a -> (Poly a, Poly a)
- quotPoly :: Fractional a => Poly a -> Poly a -> Poly a
- remPoly :: Fractional a => Poly a -> Poly a -> Poly a
- evalPoly :: Num a => Poly a -> a -> a
- evalPolyDeriv :: Num a => Poly a -> a -> (a, a)
- evalPolyDerivs :: Num a => Poly a -> a -> [a]
- contractPoly :: Num a => Poly a -> a -> (Poly a, a)
- gcdPoly :: Fractional a => Poly a -> Poly a -> Poly a
- separateRoots :: Fractional a => Poly a -> [Poly a]
- polyDeriv :: Num a => Poly a -> Poly a
- polyIntegral :: Fractional a => Poly a -> Poly a

# Documentation

data Endianness Source

poly :: Num a => Endianness -> [a] -> Poly aSource

Make a `Poly`

from a list of coefficients using the specified coefficient order.

polyCoeffs :: Num a => Endianness -> Poly a -> [a]Source

Get the coefficients of a a `Poly`

in the specified order.

polyIsZero :: Num a => Poly a -> BoolSource

negatePoly :: Num a => Poly a -> Poly aSource

quotRemPoly :: Fractional a => Poly a -> Poly a -> (Poly a, Poly a)Source

evalPolyDeriv :: Num a => Poly a -> a -> (a, a)Source

evalPolyDerivs :: Num a => Poly a -> a -> [a]Source

contractPoly :: Num a => Poly a -> a -> (Poly a, a)Source

"Contract" a polynomial by attempting to divide out a root.

`contractPoly p a`

returns `(q,r)`

such that `q*(x-a) + r == p`

separateRoots :: Fractional a => Poly a -> [Poly a]Source

Separate a polynomial into a set of factors none of which have multiple roots, and the product of which is the original polynomial. Note that if division is not exact, it may fail to separate roots. Rational coefficients is a good idea.

Useful when applicable as a way to simplify root-finding problems.

polyIntegral :: Fractional a => Poly a -> Poly aSource