úÎ!‰y….      !"#$%&'()*+,- (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).0polyCreate 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.01poly Note that 2 = 3 and 4 = 5 1.60789: ; < =>1 (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None =?HVXg"C?polyConsider using  ; wrapper, which provides a much faster implementation of @ for polynomials over A. (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None ,=?HVXg1¾ poly;Execute the extended Euclidean algorithm. For polynomials a and b/, compute their unique greatest common divisor g( and the unique coefficient polynomial s satisfying  as + bt = g, such that either g is monic, or g = 0 and s is monic, or  g = s = 0.>gcdExt (X^2 + 1 :: UPoly Double) (X^3 + 3 * X :: UPoly Double)#(1.0, 0.5 * X^2 + (-0.0) * X + 1.0)HgcdExt (X^3 + 3 * X :: UPoly Double) (3 * X^4 + 3 * X^2 :: UPoly Double)N(1.0 * X + 0.0,(-0.16666666666666666) * X^2 + (-0.0) * X + 0.3333333333333333)BpolyŠScale a non-zero polynomial such that its leading coefficient is one, returning the reciprocal of the leading coefficient in the scaling.(scaleMonic (X^3 + 3 * X :: UPoly Double)1Just (1.0, 1.0 * X^3 + 0.0 * X^2 + 3.0 * X + 0.0).scaleMonic (3 * X^4 + 3 * X^2 :: UPoly Double)LJust (0.3333333333333333, 1.0 * X^4 + 0.0 * X^3 + 1.0 * X^2 + 0.0 * X + 0.0)C  (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None,=?Mg4Ì polypolyWrapper for polynomials over A, providing a faster D instance.polypoly (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>Noneg6b   (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None %1>HMVXgR”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 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).EpolyCreate 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 * XFpoly Note that 2 = 3 and 4 = 5 1.GEHIJKLM(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None =>?HVXgVpNpolyConsider using  ; wrapper, which provides a much faster implementation of @ for polynomials over A.(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None ,=>?HVXgeûpoly;Execute the extended Euclidean algorithm. For polynomials a and b/, compute their unique greatest common divisor g( and the unique coefficient polynomial s satisfying  as + bt = g, such that either g is monic, or g = 0 and s is monic, or  g = s = 0.>gcdExt (X^2 + 1 :: UPoly Double) (X^3 + 3 * X :: UPoly Double)#(1.0, 0.5 * X^2 + (-0.0) * X + 1.0)HgcdExt (X^3 + 3 * X :: UPoly Double) (3 * X^4 + 3 * X^2 :: UPoly Double)N(1.0 * X + 0.0,(-0.16666666666666666) * X^2 + (-0.0) * X + 0.3333333333333333)OpolyŠScale a non-zero polynomial such that its leading coefficient is one, returning the reciprocal of the leading coefficient in the scaling.(scaleMonic (X^3 + 3 * X :: UPoly Double)1Just (1.0, 1.0 * X^3 + 0.0 * X^2 + 3.0 * X + 0.0).scaleMonic (3 * X^4 + 3 * X^2 :: UPoly Double)LJust (0.3333333333333333, 1.0 * X^4 + 0.0 * X^3 + 1.0 * X^2 + 0.0 * X + 0.0)(c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>Nonegt" 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 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 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  !"#$%&!"# $%& (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>Nonegv7  (c) 2019 Andrew LelechenkoBSD3/Andrew Lelechenko <andrew.lelechenko@gmail.com>None>g„¥'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-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 '()*+,- ()*'+,-P       !"#$%&'()*+),-)*.),/01234567 89:;9:< = >9:?'(0324568=@#poly-0.3.2.0-CoRdrvSw6ReHDSBF8pdoHH Data.PolyData.Poly.SparseData.Poly.SemiringData.Poly.Sparse.SemiringData.Poly.Internal.DenseData.SetSetData.MapMap"Data.Poly.Internal.Dense.GcdDomain PolyOverFieldData.Poly.Internal.Dense.Field Data.Poly.Internal.PolyOverFieldData.Poly.Internal.Sparse#Data.Poly.Internal.Sparse.GcdDomainData.Poly.Internal.Sparse.FieldUPolyVPolyPolyunPolyXtoPolyleadingmonomialscaleevalderivintegralgcdExtPolyOverFractionalunPolyOverFieldunPolyOverFractional&vector-0.12.0.3-ChzWbiXyvuNAQj0dcU08SgData.Vector.Generic.BaseVectorghc-prim GHC.ClassesOrdX' $fNumPolybaseGHC.NumabsGHC.BaseidsignumconsttoPoly' dropWhileEndM monomial'scale'eval'deriv' integral':*:$fGcdDomainPoly&semirings-0.5.1-70vLMI5c3D2BCVQ0mWB8qzData.EuclideangcdField scaleMonicfieldGcd GcdDomain