úÎ!hd$'      !"#$%& (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None %=?HMVXgpoly&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+eval (X^2 + 1 :: VPoly (UPoly Int)) (X + 1)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./)0123 4 5 61 (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None %=?HMVXg!è7polyConsider using  ; wrapper, which provides a much faster implementation of 8 for 9 coefficients. (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None %=?HMVXg#¶: (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None=?M&À poly.Wrapper over polynomials, providing a faster ;" instance, when coefficients are 9. (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None=?Mg(b  (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None %1>HVXgDlpoly&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 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.polyConvert M to a vector of coefficients (first element corresponds to a constant term).<polyCreate an identity polynomial.polyCreate an identity polynomial.polyMake \ from a list of (power, coefficient) pairs. (first element corresponds to a constant term).:set -XOverloadedLists+toPoly [(0,1),(1,2),(2,3)] :: VPoly Integer3 * X^2 + 2 * X + 1)S.toPoly [(0,0),(1,0),(2,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)NothingpolyLMultiply a polynomial by a monomial, expressed as a power and a coefficient. scale 2 3 (X^2 + 1) :: UPoly Int3 * X^4 + 3 * X^2poly1Create a monomial from a power and a coefficient.polyEvaluate at a given point.eval (X^2 + 1 :: UPoly Int) 310+eval (X^2 + 1 :: VPoly (UPoly Int)) (X + 1)1 * X^2 + 2 * X + 2polyTake a derivative. deriv (X^3 + 3 * X) :: UPoly Int 3 * X^2 + 3polyOCompute 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 Note that + = , and - = . 1.><?@ABC(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None%=>?HMVXgHHDpolyConsider using  ; wrapper, which provides a much faster implementation of 8 for 9 coefficients.(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None%=>?HMVXgJ&E(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>NonegUÅpolyCreate an identity polynomial.polyMake 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 Int0poly1Create 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 + 0polyEvaluate at a given point.eval (X^2 + 1 :: UPoly Int) 310+eval (X^2 + 1 :: VPoly (UPoly Int)) (X + 1)1 * X^2 + 2 * X + 2 polyTake a derivative. deriv (X^3 + 3 * X) :: UPoly Int3 * X^2 + 0 * X + 3   (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>NonegWª  (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None>gcÈ!polyCreate an identity polynomial."polyMake \ from a list of (power, coefficient) pairs. (first element corresponds to a constant term).:set -XOverloadedLists+toPoly [(0,1),(1,2),(2,3)] :: VPoly Integer3 * X^2 + 2 * X + 1)S.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+eval (X^2 + 1 :: VPoly (UPoly Int)) (X + 1)1 * X^2 + 2 * X + 2&polyTake a derivative. deriv (X^3 + 3 * X) :: UPoly Int 3 * X^2 + 3 !"#$%& "#$!%&F    !"#$%&'(&)*&'+&),-./0123 4567&89 :56;$%-0/124:<"poly-0.3.1.0-5L1ZnStIXpcIRQanb6FKP Data.PolyData.Poly.SparseData.Poly.SemiringData.Poly.Sparse.SemiringData.Poly.Internal.DenseData.SetSetData.MapMap"Data.Poly.Internal.Dense.GcdDomainPolyOverFractional#Data.Poly.Internal.Dense.Fractional%Data.Poly.Internal.PolyOverFractionalData.Poly.Internal.Sparse#Data.Poly.Internal.Sparse.GcdDomain$Data.Poly.Internal.Sparse.FractionalUPolyVPolyPolyunPolyXtoPolyleadingmonomialscaleevalderivintegralunPolyOverFractional&vector-0.12.0.3-ChzWbiXyvuNAQj0dcU08SgData.Vector.Generic.BaseVectorghc-prim GHC.ClassesOrdX' $fNumPolybaseGHC.NumabsGHC.BaseidsignumconsttoPoly' dropWhileEndM monomial'scale'eval'deriv':*:$fGcdDomainPoly&semirings-0.4.2-Angjg0pwVMD6wPxvdLYmgCData.EuclideangcdGHC.Real Fractional fractionalGcd GcdDomain