math-functions-0.3.4.2: Collection of tools for numeric computations
Copyright(c) 2012 Aleksey Khudyakov
LicenseBSD3
Maintainerbos@serpentine.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Numeric.Polynomial

Description

Function for evaluating polynomials using Horher's method.

Synopsis

Polynomials

evaluatePolynomial Source #

Arguments

:: (Vector v a, Num a) 
=> a

x

-> v a

Coefficients

-> a 

Evaluate polynomial using Horner's method. Coefficients starts from lowest. In pseudocode:

evaluateOddPolynomial x [1,2,3] = 1 + 2*x + 3*x^2

evaluateEvenPolynomial Source #

Arguments

:: (Vector v a, Num a) 
=> a

x

-> v a

Coefficients

-> a 

Evaluate polynomial with only even powers using Horner's method. Coefficients starts from lowest. In pseudocode:

evaluateOddPolynomial x [1,2,3] = 1 + 2*x^2 + 3*x^4

evaluateOddPolynomial Source #

Arguments

:: (Vector v a, Num a) 
=> a

x

-> v a

Coefficients

-> a 

Evaluate polynomial with only odd powers using Horner's method. Coefficients starts from lowest. In pseudocode:

evaluateOddPolynomial x [1,2,3] = 1*x + 2*x^3 + 3*x^5

Lists

evaluatePolynomialL :: Num a => a -> [a] -> a Source #

evaluateEvenPolynomialL :: Num a => a -> [a] -> a Source #

evaluateOddPolynomialL :: Num a => a -> [a] -> a Source #