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]
Link to this function polyder(a) View Source
polyder(list()) :: list()

Returns the derivative of the given Polynomial

Examples

iex> Polynomial.polyder([6, -1, 3, 2])
[18, -2, 3]
Link to this function polydiv(f, g) View Source
polydiv(list(), list()) :: {list(), list()}

Returns the quotient and remainder of two Polynomials

Examples

iex> Polynomial.polydiv([4, 5, 2], [2, 1])
{[2, 1], [1]}
Link to this function polymul(a, b) View Source
polymul(list(), list()) :: list()

Returns the product of two Polynomials

Examples

iex> Polynomial.polymul([5, 1, 3], [-1, 2])
[-5, 9, -1, 6]
Link to this function polymulx(poly, x) View Source
polymulx(list(), integer()) :: list()

Returns the Polynomial multiplied with a given coefficient

Examples

iex> Polynomial.polymulx([4, 5, -2], 2)
[8, 10, -4]
Link to this function polypow(polynomial, power) View Source

Returns the the coefficients of the polynomial raised to the given power

Examples

iex> Polynomial.polypow([6, -1, 3], 2)
[36, 1, 9]
Link to this function polysub(a, b) View Source
polysub(list(), list()) :: list()

Returns the difference of two Polynomials

Examples

iex> Polynomial.polysub([2, 3, 7], [1, 5, 9])
[1, -2, -2]