Polynomial.Basic

Contents

Description

Simple module for handling polynomials.

Synopsis

# Functions

polyeval :: Num a => [a] -> a -> aSource

Evaluate a polynomial using Horner's method.

polyadd :: Num a => [a] -> [a] -> [a]Source

polyAddScalar :: Num a => a -> [a] -> [a]Source

polysub :: Num a => [a] -> [a] -> [a]Source

Subtract two polynomials

polyscale :: Num a => a -> [a] -> [a]Source

Scale a polynomial

polymult :: Num a => [a] -> [a] -> [a]Source

Multiply two polynomials

polymultAlt :: Num a => [a] -> [a] -> [a]Source

polydiv :: Fractional a => [a] -> [a] -> [a]Source

Divide two polynomials

polymod :: Fractional a => [a] -> [a] -> [a]Source

Modulus of two polynomials (remainder of division)

polypow :: (Num a, Integral b) => [a] -> b -> [a]Source

Raise a polynomial to a non-negative integer power

polysubst :: Num a => [a] -> [a] -> [a]Source

Polynomial substitution y(n) = x(w(n))

polysubstAlt :: Num a => [a] -> [a] -> [a]Source

polyPolySubst :: Num a => [a] -> [[a]] -> [a]Source

Polynomial substitution y(n) = x(w(n)) where the coefficients of x are also polynomials.

polyderiv :: Num a => [a] -> [a]Source

Polynomial derivative

polyinteg :: Fractional a => [a] -> a -> [a]Source

Polynomial integration

roots2poly :: Num a => [a] -> [a]Source

Convert roots to a polynomial