NumEx v0.1.0 Polynomial View Source
A module to perform various operations on Polynomials.
Link to this section Summary
Functions
Returns the sum of two Polynomials
Returns the derivative of the given Polynomial
Returns the quotient and remainder of two Polynomials
Returns the product of two Polynomials
Returns the Polynomial multiplied with a given coefficient
Returns the the coefficients of the polynomial raised to the given power
Returns the difference of two Polynomials
Link to this section Functions
Link to this function
polyadd(a, b)
View Source
polyadd(list(), list()) :: list()
polyadd(list(), integer()) :: list()
Returns the sum of two Polynomials
Examples
iex> Polynomial.polyadd([2, 3, 7], [1, 5])
[2, 4, 12]
Returns the derivative of the given Polynomial
Examples
iex> Polynomial.polyder([6, -1, 3, 2])
[18, -2, 3]
Returns the quotient and remainder of two Polynomials
Examples
iex> Polynomial.polydiv([4, 5, 2], [2, 1])
{[2, 1], [1]}
Returns the product of two Polynomials
Examples
iex> Polynomial.polymul([5, 1, 3], [-1, 2])
[-5, 9, -1, 6]
Returns the Polynomial multiplied with a given coefficient
Examples
iex> Polynomial.polymulx([4, 5, -2], 2)
[8, 10, -4]
Returns the the coefficients of the polynomial raised to the given power
Examples
iex> Polynomial.polypow([6, -1, 3], 2)
[36, 1, 9]