úÎ!ƒ+y=ƒ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` a b c d e f g h i jklmnopqrstuvwxy z { | } ~  €  ‚  (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None %=?HMVXg#poly&Polynomials backed by unboxed vectors.poly$Polynomials backed by boxed vectors.poly3Polynomials of one variable with coefficients from a, backed by a ƒ v" (boxed, unboxed, storable, etc.). Use pattern  for construction:"(X + 1) + (X - 1) :: VPoly Integer 2 * X + 0(X + 1) * (X - 1) :: UPoly Int1 * X^2 + 0 * X + (-1)NPolynomials are stored normalized, without leading zero coefficients, so 0 *  + 1 equals to 1.„W instance does not make much sense mathematically, it is defined only for the sake of   , , etc.polyConvert M to a vector of coefficients (first element corresponds to a constant term).…polyCreate an identity polynomial.polyCreate an identity polynomial.polyMake M from a list of coefficients (first element corresponds to a constant term).:set -XOverloadedListstoPoly [1,2,3] :: VPoly Integer3 * X^2 + 2 * X + 1toPoly [0,0,0] :: UPoly Int0poly@Return a leading power and coefficient of a non-zero polynomial.2leading ((2 * X + 1) * (2 * X^2 - 1) :: UPoly Int) Just (3,4)leading (0 :: UPoly Int)Nothingpoly1Create a monomial from a power and a coefficient.polyLMultiply a polynomial by a monomial, expressed as a power and a coefficient. scale 2 3 (X^2 + 1) :: UPoly Int'3 * X^4 + 0 * X^3 + 3 * X^2 + 0 * X + 0 polyEvaluate at a given point.eval (X^2 + 1 :: UPoly Int) 310 poly)Substitute another polynomial instead of .1subst (X^2 + 1 :: UPoly Int) (X + 1 :: UPoly Int)1 * X^2 + 2 * X + 2 polyTake a derivative. deriv (X^3 + 3 * X) :: UPoly Int3 * X^2 + 0 * X + 3 polyOCompute an indefinite integral of a polynomial, setting constant term to zero.&integral (3 * X^2 + 3) :: UPoly Double%1.0 * X^3 + 0.0 * X^2 + 3.0 * X + 0.0†poly Note that ‡ = ˆ and ‰ = Š 1.‹…ŒŽ ‘ ’“ ” •–1(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>NoneX/ poly 4https://en.wikipedia.org/wiki/Fast_Fourier_transformDiscrete Fourier transform - y_k = \sum_{j=0}^{N-1} x_j \sqrt[N]{1}^{jk} .polyInverse  4https://en.wikipedia.org/wiki/Fast_Fourier_transformdiscrete Fourier transform 9 x_k = {1\over N} \sum_{j=0}^{N-1} y_j \sqrt[N]{1}^{-jk} . polyprimitive root  \sqrt[N]{1} ", otherwise behaviour is undefinedpoly \{ x_k \}_{k=0}^{N-1}  (currently only  N = 2^n  is supported)poly \{ y_k \}_{k=0}^{N-1} polyprimitive root  \sqrt[N]{1} ", otherwise behaviour is undefinedpoly \{ y_k \}_{k=0}^{N-1}  (currently only  N = 2^n  is supported)poly \{ x_k \}_{k=0}^{N-1}  (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None =?HVX`1[(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None ,=?HVX7poly#Polynomial division with remainder.5quotRemFractional (X^3 + 2) (X^2 - 1 :: UPoly Double)(1.0 * X + 0.0,1.0 * X + 2.0)—poly Note that ˜ 0 = 0.™polyzeropolyis one?polysubtractpolymultiplypolyinvertpolydividendpolydivisor(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None%=?HXg[ipoly.Laurent polynomials backed by unboxed vectors.poly,Laurent polynomials backed by boxed vectors.poly 0https://en.wikipedia.org/wiki/Laurent_polynomialLaurent polynomials) of one variable with coefficients from a, backed by a ƒ v" (boxed, unboxed, storable, etc.). Use pattern  and operator  for construction:((X + 1) + (X^-1 - 1) :: VLaurent Integer1 * X + 0 + 1 * X^-1$(X + 1) * (1 - X^-1) :: ULaurent Int1 * X + 0 + (-1) * X^-1yPolynomials are stored normalized, without leading and trailing zero coefficients, so 0 * X + 1 + 0 * X^-1 equals to 1.„W instance does not make much sense mathematically, it is defined only for the sake of   , , etc.polyCreate an identity polynomial.polyDeconstruct a H polynomial into an offset (largest possible) and a regular polynomial.%unLaurent (2 * X + 1 :: ULaurent Int) (0,2 * X + 1)(unLaurent (1 + 2 * X^-1 :: ULaurent Int)(-1,1 * X + 2)'unLaurent (2 * X^2 + X :: ULaurent Int) (1,2 * X + 1)unLaurent (0 :: ULaurent Int)(0,0)poly Construct L polynomial from an offset and a regular polynomial. One can imagine it as  , but allowing negative offsets.1toLaurent 2 (2 * Data.Poly.X + 1) :: ULaurent Int2 * X^3 + 1 * X^24toLaurent (-2) (2 * Data.Poly.X + 1) :: ULaurent Int2 * X^-1 + 1 * X^-2poly@Return a leading power and coefficient of a non-zero polynomial.5leading ((2 * X + 1) * (2 * X^2 - 1) :: ULaurent Int) Just (3,4)leading (0 :: ULaurent Int)Nothingpoly1Create a monomial from a power and a coefficient.polyLMultiply a polynomial by a monomial, expressed as a power and a coefficient.$scale 2 3 (X^-2 + 1) :: ULaurent Int3 * X^2 + 0 * X + 3polyEvaluate at a given point.$eval (X^-2 + 1 :: ULaurent Double) 21.25poly)Substitute another polynomial instead of .import Data.Poly (UPoly)Asubst (Data.Poly.X^2 + 1 :: UPoly Int) (X^-1 + 1 :: ULaurent Int)2 + 2 * X^-1 + 1 * X^-2polyTake a derivative.$deriv (X^-1 + 3 * X) :: ULaurent Int3 + 0 * X^-1 + (-1) * X^-2poly”This operator can be applied only to monomials with unit coefficients, but is instrumental to express Laurent polynomials in mathematical fashion:$X + 2 + 3 * (X^2)^-1 :: ULaurent Int1 * X + 2 + 0 * X^-1 + 3 * X^-2špoly Note that ‡ = ˆ and ‰ = Š 1. (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None .>HVX^Λpolyis coefficient non-zero?polyhow to modify powers?polyhow to modify coefficient?œžŸ ›(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None%&'-.1=>?HMUVX_g˜*poly&Polynomials backed by unboxed vectors.poly$Polynomials backed by boxed vectors.poly5Sparse univariate polynomials with coefficients from a, backed by a ƒ v" (boxed, unboxed, storable, etc.). Use pattern  for construction:"(X + 1) + (X - 1) :: VPoly Integer2 * X(X + 1) * (X - 1) :: UPoly Int1 * X^2 + (-1)FPolynomials are stored normalized, without zero coefficients, so 0 *  + 1 equals to 1.„W instance does not make much sense mathematically, it is defined only for the sake of   , , etc. poly3Multivariate polynomials backed by unboxed vectors.!poly1Multivariate polynomials backed by boxed vectors."polySparse polynomials of n" variables with coefficients from a, backed by a ƒ v" (boxed, unboxed, storable, etc.). Use patterns ,  and  for construction::set -XDataKinds-(X + 1) + (Y - 1) + Z :: VMultiPoly 3 Integer1 * X + 1 * Y + 1 * Z%(X + 1) * (Y - 1) :: UMultiPoly 2 Int#1 * X * Y + (-1) * X + 1 * Y + (-1)FPolynomials are stored normalized, without zero coefficients, so 0 *  + 1 equals to 1.„W instance does not make much sense mathematically, it is defined only for the sake of   , , etc.#polyConvert ", to a vector of (powers, coefficient) pairs.$poly0Create a polynomial equal to the third variable.%poly1Create a polynomial equal to the second variable.&poly0Create a polynomial equal to the first variable.'polyConvert  to a vector of coefficients.(polyMake ", from a list of (powers, coefficient) pairs.":set -XOverloadedLists -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)atoMultiPoly [(fromTuple (0,0),1),(fromTuple (0,1),2),(fromTuple (1,0),3)] :: VMultiPoly 2 Integer3 * X + 2 * Y + 1]toMultiPoly [(fromTuple (0,0),0),(fromTuple (0,1),0),(fromTuple (1,0),0)] :: UMultiPoly 2 Int0)poly@Return a leading power and coefficient of a non-zero polynomial.import Data.Poly.Sparse (UPoly)2leading ((2 * X + 1) * (2 * X^2 - 1) :: UPoly Int) Just (3,4)leading (0 :: UPoly Int)Nothing*polyKMultiply a polynomial by a monomial, expressed as powers and a coefficient.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)8scale (fromTuple (1, 1)) 3 (X^2 + Y) :: UMultiPoly 2 Int3 * X^3 * Y + 3 * X * Y^2+poly0Create a monomial from powers and a coefficient.,polyEvaluate at a given point.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)Yeval (X^2 + Y^2 :: UMultiPoly 2 Int) (fromTuple (3, 4) :: Data.Vector.Sized.Vector 2 Int)25-poly4Substitute another polynomials instead of variables.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)asubst (X^2 + Y^2 + Z^2 :: UMultiPoly 3 Int) (fromTuple (X + 1, Y + 1, X + Y :: UMultiPoly 2 Int))12 * X^2 + 2 * X * Y + 2 * X + 2 * Y^2 + 2 * Y + 2.poly&Take a derivative with respect to the i -th variable.:set -XDataKinds)deriv 0 (X^3 + 3 * Y) :: UMultiPoly 2 Int3 * X^2)deriv 1 (X^3 + 3 * Y) :: UMultiPoly 2 Int3/poly7Compute an indefinite integral of a polynomial by the i--th variable, setting constant term to zero.:set -XDataKinds3integral 0 (3 * X^2 + 2 * Y) :: UMultiPoly 2 Double1.0 * X^3 + 2.0 * X * Y3integral 1 (3 * X^2 + 2 * Y) :: UMultiPoly 2 Double3.0 * X^2 * Y + 1.0 * Y^20poly+Interpret a multivariate polynomial over 1+mg variables as a univariate polynomial, whose coefficients are multivariate polynomials over the last m variables.1polydInterpret a univariate polynomials, whose coefficients are multivariate polynomials over the first m1 variables, as a multivariate polynomial over 1+m variables.Ąpoly Note that ‡ = ˆ and ‰ = Š 1." !"˘#Ł$¤%Ľ&'(Ś)*§+¨,Š-ŞŤŹ.­/Ž01(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.>žä2poly)Convert from dense to sparse polynomials.:set -XFlexibleContexts?denseToSparse (1 + Data.Poly.X^2) :: Data.Poly.Sparse.UPoly Int 1 * X^2 + 13poly)Convert from sparse to dense polynomials.:set -XFlexibleContexts?sparseToDense (1 + Data.Poly.Sparse.X^2) :: Data.Poly.UPoly Int1 * X^2 + 0 * X + 12Ż3°(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>Noneg j 23 23(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None&'.=>?HUVXqŁYąpolyThis is unsafe when n ~ 0.(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None ,.=>?HVX¨ń4poly#Polynomial division with remainder.5quotRemFractional (X^3 + 2) (X^2 - 1 :: UPoly Double)(1.0 * X,1.0 * X + 2.0)˛poly Note that ˜ 0 = 0.łpolyzeropolyaddpolysubtractpolymultiplypolydividepolydividendpolydivisor4(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None%.1=>?HUVX_gqóŇ5poly.Laurent polynomials backed by unboxed vectors.6poly,Laurent polynomials backed by boxed vectors.7poly 0https://en.wikipedia.org/wiki/Laurent_polynomialLaurent polynomials) of one variable with coefficients from a, backed by a ƒ v" (boxed, unboxed, storable, etc.). Use pattern = and operator H for construction:((X + 1) + (X^-1 - 1) :: VLaurent Integer1 * X + 1 * X^-1$(X + 1) * (1 - X^-1) :: ULaurent Int1 * X + (-1) * X^-1cPolynomials are stored normalized, without zero coefficients, so 0 * X + 1 + 0 * X^-1 equals to 1.„W instance does not make much sense mathematically, it is defined only for the sake of   , , etc.8poly;Multivariate Laurent polynomials backed by unboxed vectors.9poly9Multivariate Laurent polynomials backed by boxed vectors.:polySparse  0https://en.wikipedia.org/wiki/Laurent_polynomialLaurent polynomials of n" variables with coefficients from a, backed by a ƒ v" (boxed, unboxed, storable, etc.). Use patterns =, <, ; and operator H for construction:/(X + 1) + (Y^-1 - 1) :: VMultiLaurent 2 Integer1 * X + 1 * Y^-1+(X + 1) * (Z - X^-1) :: UMultiLaurent 3 Int&1 * X * Z + 1 * Z + (-1) + (-1) * X^-1cPolynomials are stored normalized, without zero coefficients, so 0 * X + 1 + 0 * X^-1 equals to 1.„W instance does not make much sense mathematically, it is defined only for the sake of   , , etc.;poly0Create a polynomial equal to the third variable.<poly1Create a polynomial equal to the second variable.=poly0Create a polynomial equal to the first variable.>polyDeconstruct a :H polynomial into an offset (largest possible) and a regular polynomial.1unMultiLaurent (2 * X + 1 :: UMultiLaurent 2 Int)(Vector [0,0],2 * X + 1)4unMultiLaurent (1 + 2 * X^-1 :: UMultiLaurent 2 Int)(Vector [-1,0],1 * X + 2)3unMultiLaurent (2 * X^2 + X :: UMultiLaurent 2 Int)(Vector [1,0],2 * X + 1))unMultiLaurent (0 :: UMultiLaurent 2 Int)(Vector [0,0],0)?polyDeconstruct a 7H polynomial into an offset (largest possible) and a regular polynomial.%unLaurent (2 * X + 1 :: ULaurent Int) (0,2 * X + 1)(unLaurent (1 + 2 * X^-1 :: ULaurent Int)(-1,1 * X + 2)'unLaurent (2 * X^2 + X :: ULaurent Int) (1,2 * X + 1)unLaurent (0 :: ULaurent Int)(0,0)@poly Construct :L polynomial from an offset and a regular polynomial. One can imagine it as  , but allowing negative offsets.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)TtoMultiLaurent (fromTuple (2, 0)) (2 * Data.Poly.Multi.X + 1) :: UMultiLaurent 2 Int2 * X^3 + 1 * X^2UtoMultiLaurent (fromTuple (0, -2)) (2 * Data.Poly.Multi.X + 1) :: UMultiLaurent 2 Int2 * X * Y^-2 + 1 * Y^-2Apoly Construct 7L polynomial from an offset and a regular polynomial. One can imagine it as   , but allowing negative offsets.8toLaurent 2 (2 * Data.Poly.Sparse.X + 1) :: ULaurent Int2 * X^3 + 1 * X^2;toLaurent (-2) (2 * Data.Poly.Sparse.X + 1) :: ULaurent Int2 * X^-1 + 1 * X^-2Bpoly@Return a leading power and coefficient of a non-zero polynomial.5leading ((2 * X + 1) * (2 * X^2 - 1) :: ULaurent Int) Just (3,4)leading (0 :: ULaurent Int)NothingCpoly1Create a monomial from a power and a coefficient.DpolyLMultiply a polynomial by a monomial, expressed as a power and a coefficient.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)<scale (fromTuple (1, 1)) 3 (X^-2 + Y) :: UMultiLaurent 2 Int3 * X * Y^2 + 3 * X^-1 * YEpolyEvaluate at a given point.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)ceval (X^2 + Y^-1 :: UMultiLaurent 2 Double) (fromTuple (3, 4) :: Data.Vector.Sized.Vector 2 Double)9.25Fpoly)Substitute another polynomial instead of .:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)#import Data.Poly.Multi (UMultiPoly)ysubst (Data.Poly.Multi.X * Data.Poly.Multi.Y :: UMultiPoly 2 Int) (fromTuple (X + Y^-1, Y + X^-1 :: UMultiLaurent 2 Int))1 * X * Y + 2 + 1 * X^-1 * Y^-1Gpoly&Take a derivative with respect to the i -th variable.:set -XDataKinds,deriv 0 (X^3 + 3 * Y) :: UMultiLaurent 2 Int3 * X^2,deriv 1 (X^3 + 3 * Y) :: UMultiLaurent 2 Int3HpolyšThis operator can be applied only to monomials with unit coefficients, but is still instrumental to express Laurent polynomials in mathematical fashion:.3 * X^-1 + 2 * (Y^2)^-2 :: UMultiLaurent 2 Int2 * Y^-4 + 3 * X^-1Ipoly3Interpret a multivariate Laurent polynomial over 1+mw variables as a univariate Laurent polynomial, whose coefficients are multivariate Laurent polynomials over the last m variables.JpolytInterpret a univariate Laurent polynomials, whose coefficients are multivariate Laurent polynomials over the first m1 variables, as a multivariate polynomial over 1+m variables.´poly Note that ‡ = ˆ and ‰ = Š 1.56789:;<=>?@ABCDEFGHIJ(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>Nonegő   (c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.>g÷ !"#$%&(*+,-./01"! #(+*&%$,-./01(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>Nonegů‚89:;<=>@CDEFGHIJ:98>@CD=<;HEFGIJ(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.>HUVg Kpoly0Create a polynomial equal to the third variable.Lpoly1Create a polynomial equal to the second variable.Mpoly0Create a polynomial equal to the first variable.NpolyMake ", from a list of (powers, coefficient) pairs.":set -XOverloadedLists -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)atoMultiPoly [(fromTuple (0,0),1),(fromTuple (0,1),2),(fromTuple (1,0),3)] :: VMultiPoly 2 Integer3 * X + 2 * Y + 1]toMultiPoly [(fromTuple (0,0),0),(fromTuple (0,1),0),(fromTuple (1,0),0)] :: UMultiPoly 2 Int0Opoly0Create a monomial from powers and a coefficient.PpolyKMultiply a polynomial by a monomial, expressed as powers and a coefficient.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)8scale (fromTuple (1, 1)) 3 (X^2 + Y) :: UMultiPoly 2 Int3 * X^3 * Y + 3 * X * Y^2QpolyEvaluate at a given point.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)Yeval (X^2 + Y^2 :: UMultiPoly 2 Int) (fromTuple (3, 4) :: Data.Vector.Sized.Vector 2 Int)25Rpoly4Substitute another polynomials instead of variables.:set -XDataKinds,import Data.Vector.Generic.Sized (fromTuple)asubst (X^2 + Y^2 + Z^2 :: UMultiPoly 3 Int) (fromTuple (X + 1, Y + 1, X + Y :: UMultiPoly 2 Int))12 * X^2 + 2 * X * Y + 2 * X + 2 * Y^2 + 2 * Y + 2Spoly&Take a derivative with respect to the i -th variable.:set -XDataKinds)deriv 0 (X^3 + 3 * Y) :: UMultiPoly 2 Int3 * X^2)deriv 1 (X^3 + 3 * Y) :: UMultiPoly 2 Int3Tpoly7Compute an indefinite integral of a polynomial by the i--th variable, setting constant term to zero.:set -XDataKinds3integral 0 (3 * X^2 + 2 * Y) :: UMultiPoly 2 Double1.0 * X^3 + 2.0 * X * Y3integral 1 (3 * X^2 + 2 * Y) :: UMultiPoly 2 Double3.0 * X^2 * Y + 1.0 * Y^2 !"#01KLMNOPQRST"! #NOPMLKQRST01(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.>g/Q UpolyCreate an identity polynomial.VpolyMake O from a vector of coefficients (first element corresponds to a constant term).:set -XOverloadedListstoPoly [1,2,3] :: VPoly Integer3 * X^2 + 2 * X + 1toPoly [0,0,0] :: UPoly Int0Wpoly1Create a monomial from a power and a coefficient.XpolyLMultiply a polynomial by a monomial, expressed as a power and a coefficient. scale 2 3 (X^2 + 1) :: UPoly Int'3 * X^4 + 0 * X^3 + 3 * X^2 + 0 * X + 0YpolyEvaluate at a given point.eval (X^2 + 1 :: UPoly Int) 310Zpoly)Substitute another polynomial instead of U.1subst (X^2 + 1 :: UPoly Int) (X + 1 :: UPoly Int)1 * X^2 + 2 * X + 2[polyTake a derivative. deriv (X^3 + 3 * X) :: UPoly Int3 * X^2 + 0 * X + 3\polyOCompute an indefinite integral of a polynomial, setting constant term to zero.&integral (3 * X^2 + 3) :: UPoly Double%1.0 * X^3 + 0.0 * X^2 + 3.0 * X + 0.0]poly%Multiplication of polynomials using  4https://en.wikipedia.org/wiki/Fast_Fourier_transformdiscrete Fourier transformt. It could be faster than '(*)' for large polynomials if multiplication of coefficients is particularly expensive.^poly)Convert from dense to sparse polynomials.:set -XFlexibleContextsDdenseToSparse (1 `plus` Data.Poly.X^2) :: Data.Poly.Sparse.UPoly Int 1 * X^2 + 1_poly)Convert from sparse to dense polynomials.:set -XFlexibleContextsDsparseToDense (1 `plus` Data.Poly.Sparse.X^2) :: Data.Poly.UPoly Int1 * X^2 + 0 * X + 1]poly mapping from  N = 2^n  to a primitive root  \sqrt[N]{1}  UVWXYZ[\]^_VWXUYZ[\^_ ] (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None +Hů `poly 2https://en.wikipedia.org/wiki/Legendre_polynomialsLegendre polynomials.+take 3 legendre :: [Data.Poly.VPoly Double]0[1.0,1.0 * X + 0.0,1.5 * X^2 + 0.0 * X + (-0.5)]apoly Ohttps://en.wikipedia.org/wiki/Legendre_polynomials#Shifted_Legendre_polynomialsShifted Legendre polynomials.3take 3 legendreShifted :: [Data.Poly.VPoly Integer]'[1,2 * X + (-1),6 * X^2 + (-6) * X + 1]bpoly 4https://en.wikipedia.org/wiki/Gegenbauer_polynomialsGegenbauer polynomials.cpoly 0https://en.wikipedia.org/wiki/Jacobi_polynomialsJacobi polynomials.dpoly 3https://en.wikipedia.org/wiki/Chebyshev_polynomialsChebyshev polynomials of the first kind.$take 3 chebyshev1 :: [VPoly Integer]$[1,1 * X + 0,2 * X^2 + 0 * X + (-1)]epoly 3https://en.wikipedia.org/wiki/Chebyshev_polynomialsChebyshev polynomials of the second kind.$take 3 chebyshev2 :: [VPoly Integer]$[1,2 * X + 0,4 * X^2 + 0 * X + (-1)]fpolyProbabilists'  1https://en.wikipedia.org/wiki/Hermite_polynomialsHermite polynomials.%take 3 hermiteProb :: [VPoly Integer]$[1,1 * X + 0,1 * X^2 + 0 * X + (-1)]gpoly Physicists'  1https://en.wikipedia.org/wiki/Hermite_polynomialsHermite polynomials.$take 3 hermitePhys :: [VPoly Double]0[1.0,2.0 * X + 0.0,4.0 * X^2 + 0.0 * X + (-2.0)]hpoly 2https://en.wikipedia.org/wiki/Laguerre_polynomialsLaguerre polynomials.!take 3 laguerre :: [VPoly Double]3[1.0,(-1.0) * X + 1.0,0.5 * X^2 + (-2.0) * X + 1.0]ipoly Shttps://en.wikipedia.org/wiki/Laguerre_polynomials#Generalized_Laguerre_polynomials Generalized Laguerre polynomials `abcdefghi `abcdefghi(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.>gWijpolyCreate an identity polynomial.kpolyMake + from a list of (power, coefficient) pairs.:set -XOverloadedLists+toPoly [(0,1),(1,2),(2,3)] :: VPoly Integer3 * X^2 + 2 * X + 1'toPoly [(0,0),(1,0),(2,0)] :: UPoly Int0lpoly1Create a monomial from a power and a coefficient.mpolyLMultiply a polynomial by a monomial, expressed as a power and a coefficient. scale 2 3 (X^2 + 1) :: UPoly Int3 * X^4 + 3 * X^2npolyEvaluate at a given point.eval (X^2 + 1 :: UPoly Int) 310opoly)Substitute another polynomial instead of j.1subst (X^2 + 1 :: UPoly Int) (X + 1 :: UPoly Int)1 * X^2 + 2 * X + 2ppolyTake a derivative. deriv (X^3 + 3 * X) :: UPoly Int 3 * X^2 + 3qpolyOCompute an indefinite integral of a polynomial, setting constant term to zero.&integral (3 * X^2 + 3) :: UPoly Double1.0 * X^3 + 3.0 * X')234jklmnopq'k)lmjnopq423(c) 2020 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.>ge]rpolyCreate an identity polynomial.spoly1Create a monomial from a power and a coefficient.tpolyLMultiply a polynomial by a monomial, expressed as a power and a coefficient.$scale 2 3 (X^-2 + 1) :: ULaurent Int 3 * X^2 + 3upoly“This operator can be applied only to monomials with unit coefficients, but is instrumental to express Laurent polynomials in mathematical fashion:$X + 2 + 3 * (X^2)^-1 :: ULaurent Int1 * X + 2 + 3 * X^-2vpolyEvaluate at a given point.$eval (X^-2 + 1 :: ULaurent Double) 21.25wpoly)Substitute another polynomial instead of r.import Data.Poly.Sparse (UPoly)Hsubst (Data.Poly.Sparse.X^2 + 1 :: UPoly Int) (X^-1 + 1 :: ULaurent Int)2 + 2 * X^-1 + 1 * X^-2xpolyTake a derivative.$deriv (X^-3 + 3 * X) :: ULaurent Int3 + (-3) * X^-4 567?ABrstuvwx 765?ABstruvwx (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None.>gxÁ ypolyCreate an identity polynomial.zpolyMake + from a list of (power, coefficient) pairs.:set -XOverloadedLists+toPoly [(0,1),(1,2),(2,3)] :: VPoly Integer3 * X^2 + 2 * X + 1'toPoly [(0,0),(1,0),(2,0)] :: UPoly Int0{poly1Create a monomial from a power and a coefficient.|polyLMultiply a polynomial by a monomial, expressed as a power and a coefficient. scale 2 3 (X^2 + 1) :: UPoly Int3 * X^4 + 3 * X^2}polyEvaluate at a given point.eval (X^2 + 1 :: UPoly Int) 310~poly)Substitute another polynomial instead of y.1subst (X^2 + 1 :: UPoly Int) (X + 1 :: UPoly Int)1 * X^2 + 2 * X + 2polyTake a derivative. deriv (X^3 + 3 * X) :: UPoly Int 3 * X^2 + 3€polyOCompute an indefinite integral of a polynomial, setting constant term to zero.&integral (3 * X^2 + 3) :: UPoly Double1.0 * X^3 + 3.0 * Xpoly)Convert from dense to sparse polynomials.:set -XFlexibleContextsDdenseToSparse (1 `plus` Data.Poly.X^2) :: Data.Poly.Sparse.UPoly Int 1 * X^2 + 1‚poly)Convert from sparse to dense polynomials.:set -XFlexibleContextsDsparseToDense (1 `plus` Data.Poly.Sparse.X^2) :: Data.Poly.UPoly Int1 * X^2 + 0 * X + 1')yz{|}~€‚'z){|y}~€‚ľ    !  " # $  % & ' ()*+,-./0#$%&'1 2345!6#$%&'(789:+,-.;<=>/?0#$%&'1786$%&'("$%&'(@9: A B C D E F G H I J"$%&'($1%&'  " $  % & ' ( 9 :KLMNOP Q RSTUSVWSTXSVY  Z [ \ ] ^ _ ` a b c defghijklmnopq4rsQt]\_`uabcvwxyz{|#poly-0.5.0.0-7m5KNOIXm3O4vlasj7xQjE Data.PolyData.Poly.SemiringData.Poly.LaurentData.Poly.SparseData.Poly.MultiData.Poly.Sparse.LaurentData.Poly.Multi.LaurentData.Poly.Multi.SemiringData.Poly.OrthogonalData.Poly.Sparse.SemiringData.Poly.Internal.DenseData.SetSetData.MapMapData.Poly.Internal.Dense.DFT"Data.Poly.Internal.Dense.GcdDomainData.Poly.Internal.Dense.Field Data.Poly.Internal.Dense.LaurentscaleXData.Poly.Internal.Multi.CoreData.Poly.Internal.MultiYZData.Poly.Internal.Convert"Data.Poly.Internal.Multi.GcdDomainData.Poly.Internal.Multi.Field Data.Poly.Internal.Multi.LaurentUPolyVPolyPolyunPolytoPolyleadingmonomialevalsubstderivintegraldft inverseDftquotRemFractionalULaurentVLaurentLaurent unLaurent toLaurent^- UMultiPoly VMultiPoly MultiPoly unMultiPoly toMultiPoly segregate unsegregate denseToSparse sparseToDense UMultiLaurent VMultiLaurent MultiLaurentunMultiLaurenttoMultiLaurentdftMultlegendrelegendreShifted gegenbauerjacobi chebyshev1 chebyshev2 hermiteProb hermitePhyslaguerre laguerreGen&vector-0.12.1.2-KSb3nsihfSnCDYOh5IjlsCData.Vector.Generic.BaseVectorghc-prim GHC.ClassesOrdX' $fNumPolybaseGHC.NumabsGHC.BaseidsignumconsttoPoly' dropWhileEndM monomial'scale'unscale'eval'subst' substitute'deriv' integral':*:$fEuclideanPoly&semirings-0.5.4-LRbsM7wDG8JKMJ3GZYrN5uData.EuclideandegreequotientAndRemainder $fNumLaurent derivPoly normalizeplusPoly minusPoly scaleInternal convolution$fNumMultiPolyZ'Y' toMultiPoly' substitutedenseToSparse'sparseToDense'isSucc$fEuclideanMultiPolyquotientRemainder$fNumMultiLaurent