ó
    Š*£hB…  ã                   óÔ  • S r SSKJrJrJrJrJrJrJrJ	r	J
r
JrJrJrJr  SSKJrJr  S rS rS rS rS rS	 rS
 rS rS rS rS rS rS rS rS r S r!S r"S r#S r$S r%S r&S r'S r(S r)S r*S r+S r,S r-S  r.S! r/S" r0S# r1S$ r2S% r3S& r4S' r5S( r6S) r7S* r8S+ r9S, r:S- r;S. r<S/ r=S0 r>S1 r?S2 r@S3 rAS4 rBS5 rCS6 rDS7 rES8 rFS9 rGS: rHS; rIS< rJS= rKS> rLS? rMS@ rNSA rOSB rPSC rQgD)EzEArithmetics for dense recursive polynomials in ``K[x]`` or ``K[X]``. é    )Ú	dup_sliceÚdup_LCÚdmp_LCÚ
dup_degreeÚ
dmp_degreeÚ	dup_stripÚ	dmp_stripÚ
dmp_zero_pÚdmp_zeroÚ	dmp_one_pÚdmp_oneÚ
dmp_groundÚ	dmp_zeros)ÚExactQuotientFailedÚPolynomialDivisionFailedc                 óà   • U(       d  U $ [        U 5      nXB-
  S-
  nX$S-
  :X  a  [        U S   U-   /U SS -   5      $ X$:¼  a  U/UR                  /X$-
  -  -   U -   $ U SU X   U-   /-   XS-   S -   $ )z³
Add ``c*x**i`` to ``f`` in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_add_term(x**2 - 1, ZZ(2), 4)
2*x**4 + x**2 - 1

é   r   N©Úlenr   Úzero©ÚfÚcÚiÚKÚnÚms         ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sympy/polys/densearith.pyÚdup_add_termr      s“   € ö ØˆäˆA‹€AØ	‰�‰	€Aà�‰EƒzÜ˜!˜A™$ ™(˜ a¨¨ eÑ+Ó,Ð,à‹6Ø�3˜!Ÿ&™&˜ 1¡5Ñ)Ñ)¨AÑ-Ð-à�R�a�5˜A™D 1™H˜:Ñ%¨¨a©%¨&¨	Ñ1Ð1ó    c                 ó<  • U(       d  [        XX$5      $ US-
  n[        X5      (       a  U $ [        U 5      nXb-
  S-
  nX&S-
  :X  a!  [        [	        U S   XU5      /U SS -   U5      $ X&:¼  a  U/[        X&-
  XT5      -   U -   $ U SU [	        X   XU5      /-   XS-   S -   $ )z½
Add ``c(x_2..x_u)*x_0**i`` to ``f`` in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_add_term(x*y + 1, 2, 2)
2*x**2 + x*y + 1

r   r   N)r   r
   r   r	   Údmp_addr   ©r   r   r   Úur   Úvr   r   s           r   Údmp_add_termr&   +   s¾   € ö Ü˜A !Ó'Ð'à	ˆA‰€Aä�!×ÑØˆäˆA‹€AØ	‰�‰	€Aà�‰EƒzÜœ' ! A¡$¨¨aÓ0Ð1°A°a°b°EÑ9¸1Ó=Ð=à‹6Ø�3œ 1¡5¨!Ó/Ñ/°!Ñ3Ð3à�R�a�5œG A¡D¨!°Ó2Ð3Ñ3°a¸A¹¸°iÑ?Ð?r    c                 óâ   • U(       d  U $ [        U 5      nXB-
  S-
  nX$S-
  :X  a  [        U S   U-
  /U SS -   5      $ X$:¼  a  U* /UR                  /X$-
  -  -   U -   $ U SU X   U-
  /-   XS-   S -   $ )zº
Subtract ``c*x**i`` from ``f`` in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_sub_term(2*x**4 + x**2 - 1, ZZ(2), 4)
x**2 - 1

r   r   Nr   r   s         r   Údup_sub_termr(   M   s•   € ö ØˆäˆA‹€AØ	‰�‰	€Aà�‰EƒzÜ˜!˜A™$ ™(˜ a¨¨ eÑ+Ó,Ð,à‹6Ø�B�4˜1Ÿ6™6˜( A¡EÑ*Ñ*¨QÑ.Ð.à�R�a�5˜A™D 1™H˜:Ñ%¨¨a©%¨&¨	Ñ1Ð1r    c                 óR  • U(       d  [        X* X$5      $ US-
  n[        X5      (       a  U $ [        U 5      nXb-
  S-
  nX&S-
  :X  a!  [        [	        U S   XU5      /U SS -   U5      $ X&:¼  a  [        XU5      /[        X&-
  XT5      -   U -   $ U SU [	        X   XU5      /-   XS-   S -   $ )zÄ
Subtract ``c(x_2..x_u)*x_0**i`` from ``f`` in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_sub_term(2*x**2 + x*y + 1, 2, 2)
x*y + 1

r   r   N)r   r
   r   r	   Údmp_subÚdmp_negr   r#   s           r   Údmp_sub_termr,   j   sÈ   € ö Ü˜A˜r 1Ó(Ð(à	ˆA‰€Aä�!×ÑØˆäˆA‹€AØ	‰�‰	€Aà�‰EƒzÜœ' ! A¡$¨¨aÓ0Ð1°A°a°b°EÑ9¸1Ó=Ð=à‹6Ü˜A !Ó$Ð%¬	°!±%¸Ó(>Ñ>ÀÑBÐBà�R�a�5œG A¡D¨!°Ó2Ð3Ñ3°a¸A¹¸°iÑ?Ð?r    c                 óx   • U(       a  U (       d  / $ U  Vs/ s H  oDU-  PM	     snUR                   /U-  -   $ s  snf )z¶
Multiply ``f`` by ``c*x**i`` in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_mul_term(x**2 - 1, ZZ(3), 2)
3*x**4 - 3*x**2

©r   )r   r   r   r   Úcfs        r   Údup_mul_termr0   Œ   s7   € ö –AØˆ	á"#Ó%¢!˜B�a”¡!Ñ%¨¯©¨°©
Ñ2Ð2ùÒ%s   •7c           	      óê   • U(       d  [        XX$5      $ US-
  n[        X5      (       a  U $ [        X5      (       a  [        U5      $ U  Vs/ s H  n[        XaXT5      PM     sn[	        X%U5      -   $ s  snf )zÍ
Multiply ``f`` by ``c(x_2..x_u)*x_0**i`` in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_mul_term(x**2*y + x, 3*y, 2)
3*x**4*y**2 + 3*x**3*y

r   )r0   r
   r   Údmp_mulr   )r   r   r   r$   r   r%   r/   s          r   Údmp_mul_termr3       sm   € ö Ü˜A !Ó'Ð'à	ˆA‰€Aä�!×ÑØˆÜ�!×ÑÜ˜‹{Ðá01Ó3²¨"”˜ Ö%±Ñ3´iÀÀaÓ6HÑHÐHùÒ3s   Á
A0c                 ó   • [        XSU5      $ )zÐ
Add an element of the ground domain to ``f``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_add_ground(x**3 + 2*x**2 + 3*x + 4, ZZ(4))
x**3 + 2*x**2 + 3*x + 8

r   )r   ©r   r   r   s      r   Údup_add_groundr6   »   ó   € ô ˜˜a Ó#Ð#r    c                 ó6   • [        U [        XS-
  5      SX#5      $ )zÔ
Add an element of the ground domain to ``f``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_add_ground(x**3 + 2*x**2 + 3*x + 4, ZZ(4))
x**3 + 2*x**2 + 3*x + 8

r   r   )r&   r   ©r   r   r$   r   s       r   Údmp_add_groundr:   Ì   ó   € ô ˜œ: a¨Q©Ó/°°AÓ9Ð9r    c                 ó   • [        XSU5      $ )zÓ
Subtract an element of the ground domain from ``f``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_sub_ground(x**3 + 2*x**2 + 3*x + 4, ZZ(4))
x**3 + 2*x**2 + 3*x

r   )r(   r5   s      r   Údup_sub_groundr=   Ý   r7   r    c                 ó6   • [        U [        XS-
  5      SX#5      $ )z×
Subtract an element of the ground domain from ``f``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_sub_ground(x**3 + 2*x**2 + 3*x + 4, ZZ(4))
x**3 + 2*x**2 + 3*x

r   r   )r,   r   r9   s       r   Údmp_sub_groundr?   î   r;   r    c                 óV   • U(       a  U (       d  / $ U  Vs/ s H  o3U-  PM	     sn$ s  snf )zÂ
Multiply ``f`` by a constant value in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_mul_ground(x**2 + 2*x - 1, ZZ(3))
3*x**2 + 6*x - 3

© ©r   r   r   r/   s       r   Údup_mul_groundrC   ÿ   s(   € ö –AØˆ	á"#Ó%¢!˜B�a”¡!Ñ%Ð%ùÒ%s   •&c           	      óv   • U(       d  [        XU5      $ US-
  nU  Vs/ s H  n[        XQXC5      PM     sn$ s  snf )zº
Multiply ``f`` by a constant value in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_mul_ground(2*x + 2*y, ZZ(3))
6*x + 6*y

r   )rC   Údmp_mul_ground©r   r   r$   r   r%   r/   s         r   rE   rE     s<   € ö Ü˜a AÓ&Ð&à	ˆA‰€Aá34Ó6²1¨RŒ^˜B 1Ö(±1Ñ6Ð6ùÒ6ó   �6c                 óÚ   • U(       d  [        S5      eU (       d  U $ UR                  (       a!  U  Vs/ s H  o2R                  X15      PM     sn$ U  Vs/ s H  o3U-  PM	     sn$ s  snf s  snf )zý
Quotient by a constant in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x = ring("x", ZZ)
>>> R.dup_quo_ground(3*x**2 + 2, ZZ(2))
x**2 + 1

>>> R, x = ring("x", QQ)
>>> R.dup_quo_ground(3*x**2 + 2, QQ(2))
3/2*x**2 + 1

úpolynomial division)ÚZeroDivisionErrorÚis_FieldÚquorB   s       r   Údup_quo_groundrM   )  s\   € ö$ ÜÐ 5Ó6Ð6ÞØˆà‡z‡zÙ()Ó+ª "—‘�r–©Ñ+Ð+á#$Ó&¢1˜R�q”¡1Ñ&Ð&ùò ,ùâ&s   ±A#ÁA(c           	      óv   • U(       d  [        XU5      $ US-
  nU  Vs/ s H  n[        XQXC5      PM     sn$ s  snf )a  
Quotient by a constant in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x,y = ring("x,y", ZZ)
>>> R.dmp_quo_ground(2*x**2*y + 3*x, ZZ(2))
x**2*y + x

>>> R, x,y = ring("x,y", QQ)
>>> R.dmp_quo_ground(2*x**2*y + 3*x, QQ(2))
x**2*y + 3/2*x

r   )rM   Údmp_quo_groundrF   s         r   rO   rO   F  s<   € ö$ Ü˜a AÓ&Ð&à	ˆA‰€Aá34Ó6²1¨RŒ^˜B 1Ö(±1Ñ6Ð6ùÒ6rG   c                 ó„   • U(       d  [        S5      eU (       d  U $ U  Vs/ s H  o2R                  X15      PM     sn$ s  snf )z´
Exact quotient by a constant in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, QQ
>>> R, x = ring("x", QQ)

>>> R.dup_exquo_ground(x**2 + 2, QQ(2))
1/2*x**2 + 1

rI   )rJ   ÚexquorB   s       r   Údup_exquo_groundrR   `  s9   € ö ÜÐ 5Ó6Ð6ÞØˆá&'Ó)¢a �W‰W�RŽ^¡aÑ)Ð)ùÒ)s    =c           	      óv   • U(       d  [        XU5      $ US-
  nU  Vs/ s H  n[        XQXC5      PM     sn$ s  snf )z¾
Exact quotient by a constant in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, QQ
>>> R, x,y = ring("x,y", QQ)

>>> R.dmp_exquo_ground(x**2*y + 2*x, QQ(2))
1/2*x**2*y + x

r   )rR   Údmp_exquo_groundrF   s         r   rT   rT   v  s=   € ö Ü  aÓ(Ð(à	ˆA‰€Aá56Ó8²Q¨rÔ˜b QÖ*±QÑ8Ð8ùÒ8rG   c                 ó8   • U (       d  U $ XR                   /U-  -   $ )z³
Efficiently multiply ``f`` by ``x**n`` in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_lshift(x**2 + 1, 2)
x**4 + x**2

r.   ©r   r   r   s      r   Ú
dup_lshiftrW   Œ  s   € ö Øˆà—F‘F�8˜A‘:‰~Ðr    c                 ó   • U SU*  $ )zß
Efficiently divide ``f`` by ``x**n`` in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_rshift(x**4 + x**2, 2)
x**2 + 1
>>> R.dup_rshift(x**4 + x**2 + 2, 2)
x**2 + 1

NrA   rV   s      r   Ú
dup_rshiftrY      s   € ð  ˆSˆqˆbˆ6€Mr    c                 óN   • U  Vs/ s H  o!R                  U5      PM     sn$ s  snf )z¢
Make all coefficients positive in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_abs(x**2 - 1)
x**2 + 1

)Úabs©r   r   Úcoeffs      r   Údup_absr^   ³  s"   € ñ ()Ó*¢q˜e�U‰U�5Ž\¡qÑ*Ð*ùÒ*s   …"c                 ót   • U(       d  [        X5      $ US-
  nU  Vs/ s H  n[        XCU5      PM     sn$ s  snf )zª
Make all coefficients positive in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_abs(x**2*y - x)
x**2*y + x

r   )r^   Údmp_abs©r   r$   r   r%   r/   s        r   r`   r`   Ä  ó9   € ö Ü�q‹}Ðà	ˆA‰€Aá)*Ó,ª 2ŒW�R˜AÖ©Ñ,Ð,ùÒ,ó   œ5c                 ó2   • U  Vs/ s H  o"* PM     sn$ s  snf )z˜
Negate a polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_neg(x**2 - 1)
-x**2 + 1

rA   r\   s      r   Údup_negre   Ú  s   € ñ "#Ó$¢˜‹V¡Ñ$Ð$ùÒ$s   …c                 ót   • U(       d  [        X5      $ US-
  nU  Vs/ s H  n[        XCU5      PM     sn$ s  snf )z 
Negate a polynomial in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_neg(x**2*y - x)
-x**2*y + x

r   )re   r+   ra   s        r   r+   r+   ë  rb   rc   c                 óZ  • U (       d  U$ U(       d  U $ [        U 5      n[        U5      nX4:X  a+  [        [        X5       VVs/ s H	  u  pVXV-   PM     snn5      $ [        X4-
  5      nX4:”  a	  U SU XS pOUSU XS pU[        X5       VVs/ s H	  u  pVXV-   PM     snn-   $ s  snnf s  snnf )z¤
Add dense polynomials in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_add(x**2 - 1, x - 2)
x**2 + x - 3

N)r   r   Úzipr[   ©	r   Úgr   ÚdfÚdgÚaÚbÚkÚhs	            r   Údup_addrq     s«   € ö ØˆÞØˆä	�A‹€BÜ	�A‹€Bà	ƒxÜ¬S°¬YÔ8ªY¡T Q˜1œ5©YÒ8Ó9Ð9ä�‘‹Lˆà‹7Ø�R�a�5˜!˜B˜%‰qà�R�a�5˜!˜B˜%ˆqà¤s¨1¤yÔ2¢y™t˜q�Q”U¡yÒ2Ñ2Ð2ùó 9ùó 3s   ÁB!
ÂB'c                 ó¨  • U(       d  [        XU5      $ [        X5      nUS:  a  U$ [        X5      nUS:  a  U $ US-
  nXE:X  a4  [        [        X5       VVs/ s H  u  px[	        XxXc5      PM     snnU5      $ [        XE-
  5      n	XE:”  a	  U SU	 X	S p
OUSU	 XS pU
[        X5       VVs/ s H  u  px[	        XxXc5      PM     snn-   $ s  snnf s  snnf )z¶
Add dense polynomials in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_add(x**2 + y, x**2*y + x)
x**2*y + x**2 + x + y

r   r   N)rq   r   r	   rh   r"   r[   ©r   rj   r$   r   rk   rl   r%   rm   rn   ro   rp   s              r   r"   r"   $  sÜ   € ö Ü�q˜QÓÐä	�AÓ	€Bà	ˆAƒvØˆä	�AÓ	€Bà	ˆAƒvØˆà	ˆA‰€Aà	ƒxÜ¼3¸q¼9ÔFº9±4°1œ7 1¨Ö.¹9ÒFÈÓJÐJä�‘‹Lˆà‹7Ø�R�a�5˜!˜B˜%‰qà�R�a�5˜!˜B˜%ˆqà´S¸´YÔ@²Y©T¨Q”W˜Q 1Ö(±YÒ@Ñ@Ð@ùó Gùó As   ÁC
Â*Cc                 ó€  • U (       d  [        X5      $ U(       d  U $ [        U 5      n[        U5      nX4:X  a+  [        [        X5       VVs/ s H	  u  pVXV-
  PM     snn5      $ [	        X4-
  5      nX4:”  a	  U SU XS pO[        USU U5      XS pU[        X5       VVs/ s H	  u  pVXV-
  PM     snn-   $ s  snnf s  snnf )z©
Subtract dense polynomials in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_sub(x**2 - 1, x - 2)
x**2 - x + 1

N)re   r   r   rh   r[   ri   s	            r   Údup_subru   N  s·   € ö Ü�q‹}ÐÞØˆä	�A‹€BÜ	�A‹€Bà	ƒxÜ¬S°¬YÔ8ªY¡T Q˜1œ5©YÒ8Ó9Ð9ä�‘‹Lˆà‹7Ø�R�a�5˜!˜B˜%‰qä˜1˜R˜a˜5 !Ó$ a¨ eˆqà¤s¨1¤yÔ2¢y™t˜q�Q”U¡yÒ2Ñ2Ð2ùó 9ùó 3s   Á
B4
ÂB:c                 óÐ  • U(       d  [        XU5      $ [        X5      nUS:  a  [        XU5      $ [        X5      nUS:  a  U $ US-
  nXE:X  a4  [        [	        X5       VVs/ s H  u  px[        XxXc5      PM     snnU5      $ [        XE-
  5      n	XE:”  a	  U SU	 X	S p
O[        USU	 X#5      XS pU
[	        X5       VVs/ s H  u  px[        XxXc5      PM     snn-   $ s  snnf s  snnf )z¼
Subtract dense polynomials in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_sub(x**2 + y, x**2*y + x)
-x**2*y + x**2 - x + y

r   r   N)ru   r   r+   r	   rh   r*   r[   rs   s              r   r*   r*   q  së   € ö Ü�q˜QÓÐä	�AÓ	€Bà	ˆAƒvÜ�q˜QÓÐä	�AÓ	€Bà	ˆAƒvØˆà	ˆA‰€Aà	ƒxÜ¼3¸q¼9ÔFº9±4°1œ7 1¨Ö.¹9ÒFÈÓJÐJä�‘‹Lˆà‹7Ø�R�a�5˜!˜B˜%‰qä˜1˜R˜a˜5 !Ó'¨¨2¨ˆqà´S¸´YÔ@²Y©T¨Q”W˜Q 1Ö(±YÒ@Ñ@Ð@ùó Gùó As   Á!C
Â>C"c                 ó0   • [        U [        XU5      U5      $ )zÁ
Returns ``f + g*h`` where ``f, g, h`` are in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_add_mul(x**2 - 1, x - 2, x + 2)
2*x**2 - 5

)rq   Údup_mul©r   rj   rp   r   s       r   Údup_add_mulrz   ›  ó   € ô �1”g˜a AÓ&¨Ó*Ð*r    c           	      ó0   • [        U [        XX45      X45      $ )zÇ
Returns ``f + g*h`` where ``f, g, h`` are in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_add_mul(x**2 + y, x, x + 2)
2*x**2 + 2*x + y

)r"   r2   ©r   rj   rp   r$   r   s        r   Údmp_add_mulr~   ¬  ó   € ô �1”g˜a AÓ)¨1Ó0Ð0r    c                 ó0   • [        U [        XU5      U5      $ )z¸
Returns ``f - g*h`` where ``f, g, h`` are in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_sub_mul(x**2 - 1, x - 2, x + 2)
3

)ru   rx   ry   s       r   Údup_sub_mulr�   ½  r{   r    c           	      ó0   • [        U [        XX45      X45      $ )z¿
Returns ``f - g*h`` where ``f, g, h`` are in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_sub_mul(x**2 + y, x, x + 2)
-2*x + y

)r*   r2   r}   s        r   Údmp_sub_mulrƒ   Î  r   r    c           
      óF  • X:X  a  [        X5      $ U (       a  U(       d  / $ [        U 5      n[        U5      n[        X45      S-   nUS:  d  UR                  (       d|  / n[	        SX4-   S-   5       HZ  nUR
                  n[	        [        SXt-
  5      [        X75      S-   5       H  n	X€U	   XU	-
     -  -  nM     UR                  U5        M\     [        U5      $ US-  n
[        U SX¢5      [        USX¢5      pË[        [        X
XR5      X¢5      n[        [        XXR5      X¢5      n[        X¼U5      [        XÞU5      nn[        [        X½U5      [        XÎU5      U5      n[        U[        UUU5      U5      n[        [        U[        UX¢5      U5      [        USU
-  U5      U5      $ )z¢
Multiply dense polynomials in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_mul(x - 2, x + 2)
x**2 - 4

r   éd   r   é   )Údup_sqrr   ÚmaxÚis_ExactÚranger   ÚminÚappendr   r   rY   rx   rq   ru   rW   )r   rj   r   rk   rl   r   rp   r   r]   ÚjÚn2ÚflÚglÚfhÚghÚloÚhiÚmids                     r   rx   rx   ß  sƒ  € ð 	ƒvÜ�q‹}Ðæ–!Øˆ	ä	�A‹€BÜ	�A‹€BäˆB‹�a‰€Aàˆ3ƒw�a—j—jØˆä�q˜"™' A™+Ö&ˆAØ—F‘FˆEäœ3˜q !¡&›>¬3¨r«:¸©>Ö:�Ø˜1™˜a A¡™h™Ñ&’ñ ;ð �H‰H�UŽOñ 'ô ˜‹|Ðð
 �‰Tˆä˜1˜a Ó'¬°1°a¸Ó)?ˆBäœ	 !¨Ó.°Ó6ˆÜœ	 !¨Ó.°Ó6ˆä˜ Ó#¤W¨R°QÓ%7ˆBˆä”g˜b aÓ(¬'°"¸!Ó*<¸aÓ@ˆÜ�cœ7 2 r¨1Ó-¨qÓ1ˆä”w˜r¤:¨c°2Ó#9¸1Ó=Ü! " a¨¡d¨AÓ.°ó3ð 	3r    c                 ó´  • U(       d  [        XU5      $ X:X  a  [        XU5      $ [        X5      nUS:  a  U $ [        X5      nUS:  a  U$ / US-
  pv[        SXE-   S-   5       Hi  n[	        U5      n	[        [        SX…-
  5      [        XH5      S-   5       H"  n
[        U	[        X
   XU
-
     Xs5      Xs5      n	M$     UR                  U	5        Mk     [        Xb5      $ )z¦
Multiply dense polynomials in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_mul(x*y + 1, x)
x**2*y + x

r   r   )rx   Údmp_sqrr   rŠ   r   rˆ   r‹   r"   r2   rŒ   r	   )r   rj   r$   r   rk   rl   rp   r%   r   r]   r�   s              r   r2   r2     sÖ   € ö Ü�q˜QÓÐàƒvÜ�q˜QÓÐä	�AÓ	€Bà	ˆAƒvØˆä	�AÓ	€Bà	ˆAƒvØˆàˆq�1‰u€qä�1�b‘g ‘kÖ"ˆÜ˜“ˆä”s˜1˜a™f“~¤s¨2£z°A¡~Ö6ˆAÜ˜E¤7¨1©4°°q±5±¸1Ó#@À!ÓGŠEñ 7ð 	
�‰�Žñ #ô �Q‹?Ðr    c                 óv  • [        U 5      S-
  / p2[        SSU-  S-   5       HŠ  nUR                  n[        SXB-
  5      n[	        XB5      nXv-
  S-   nXhS-  -   S-
  n[        XgS-   5       H  n	XPU	   XU	-
     -  -  nM     XU-  nUS-  (       a  XS-      n
XZS-  -  nUR                  U5        MŒ     [        U5      $ )z¥
Square dense polynomials in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_sqr(x**2 + 1)
x**4 + 2*x**2 + 1

r   r   r†   )r   rŠ   r   rˆ   r‹   rŒ   r   )r   r   rk   rp   r   r   ÚjminÚjmaxr   r�   Úelems              r   r‡   r‡   C  sÌ   € ô �‹F�Q‰J˜ˆä�1�a˜‘d˜Q‘hÖˆØ�F‰Fˆä�1�a‘f‹~ˆÜ�1‹zˆà‰K˜!‰Oˆà˜1‘f‰}˜qÑ ˆä�t A™XÖ&ˆAØ�1‘�a˜A™‘h‘ÑŠAñ 'ð 	
‰ˆàˆq�5Ø˜A‘X‘;ˆDØ�q‘‰LˆAà	�‰�Žñ'  ô* �Q‹<Ðr    c                 ó  • U(       d  [        X5      $ [        X5      nUS:  a  U $ / US-
  pT[        SSU-  S-   5       H¶  n[        U5      n[	        SXc-
  5      n[        Xc5      n	X˜-
  S-   n
XŠS-  -   S-
  n	[        X‰S-   5       H"  n[        U[        X   XU-
     XR5      XR5      nM$     [        Xr" S5      XR5      nU
S-  (       a  [        X	S-      XR5      n[        X|XR5      nUR                  U5        M¸     [        XA5      $ )zÐ
Square dense polynomials in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_sqr(x**2 + x*y + y**2)
x**4 + 2*x**3*y + 3*x**2*y**2 + 2*x*y**3 + y**4

r   r   r†   )r‡   r   rŠ   r   rˆ   r‹   r"   r2   rE   r—   rŒ   r	   )r   r$   r   rk   rp   r%   r   r   r™   rš   r   r�   r›   s                r   r—   r—   k  s  € ö Ü�q‹}Ðä	�AÓ	€Bà	ˆAƒvØˆàˆq�1‰u€qä�1�a˜‘d˜Q‘hÖˆÜ�Q‹Kˆä�1�a‘f‹~ˆÜ�1‹zˆà‰K˜!‰Oˆà˜1‘f‰}˜qÑ ˆä�t A™XÖ&ˆAÜ˜œ7 1¡4¨¨q©5©°1Ó8¸!Ó?ŠAñ 'ô ˜1˜a ›d AÓ)ˆàˆq�5Ü˜1 A™X™;¨Ó-ˆDÜ˜ Ó&ˆAà	�‰�Žñ'  ô* �Q‹?Ðr    c                 ó  • U(       d  UR                   /$ US:  a  [        S5      eUS:X  d  U (       a  XR                   /:X  a  U $ UR                   /n US-  UpAUS-  (       a  [        X0U5      nU(       d   U$ [        X5      n M3  )zµ
Raise ``f`` to the ``n``-th power in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_pow(x - 2, 3)
x**3 - 6*x**2 + 12*x - 8

r   ú+Cannot raise polynomial to a negative powerr   r†   )ÚoneÚ
ValueErrorrx   r‡   )r   r   r   rj   r   s        r   Údup_powr¡   ›  s†   € ö Ø—‘ˆwˆØˆ1ƒuÜÐFÓGÐGØˆAƒv–Q˜!§¡˜w›,Øˆà	
�‰ˆ€Aà
Ø�!‰t�Qˆ1àˆq�5Ü˜˜aÓ ˆAæØð €Hô �A‹Mˆñ r    c                 ó@  • U(       d  [        XU5      $ U(       d  [        X#5      $ US:  a  [        S5      eUS:X  d!  [        X5      (       d  [	        XU5      (       a  U $ [        X#5      n US-  UpQUS-  (       a  [        X@X#5      nU(       d   U$ [        XU5      n M4  )zÆ
Raise ``f`` to the ``n``-th power in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_pow(x*y + 1, 3)
x**3*y**3 + 3*x**2*y**2 + 3*x*y + 1

r   rž   r   r†   )r¡   r   r    r
   r   r2   r—   )r   r   r$   r   rj   r   s         r   Údmp_powr£   À  s    € ö Ü�q˜QÓÐæÜ�q‹}ÐØˆ1ƒuÜÐFÓGÐGØˆAƒv”˜A×!Ñ!¤Y¨q°Q×%7Ñ%7Øˆä�‹€Aà
Ø�!‰t�Qˆ1àˆq�5Ü˜˜aÓ#ˆAæØð €Hô �A˜!Óˆñ r    c                 óº  • [        U 5      n[        U5      n/ XpvnU(       d  [        S5      eX4:  a  XV4$ X4-
  S-   n[        X5      n	 [        Xb5      n
Xt-
  US-
  p‹[        XYU5      n[	        XÊX²5      n[        XiU5      n[        XX²5      n[        XÞU5      nU[        U5      pXt:  a  OX:  d  [        XU5      eMt  X˜-  n[        UUU5      n[        UUU5      nXV4$ )z­
Polynomial pseudo-division in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_pdiv(x**2 + 1, 2*x - 4)
(2*x + 4, 20)

rI   r   )r   rJ   r   rC   r   r0   ru   r   )r   rj   r   rk   rl   ÚqÚrÚdrÚNÚlc_gÚlc_rr�   ÚQÚRÚGÚ_drr   s                    r   Údup_pdivr¯   è  sù   € ô 
�A‹€BÜ	�A‹€Bà�1ˆ"€AæÜÐ 5Ó6Ð6Ø	‹Øˆtˆà
‰�!‰€AÜ�!‹<€Dà
Ü�a‹|ˆØ‰w˜˜A™ˆ1ä˜1 AÓ&ˆÜ˜ !Ó'ˆä˜1 AÓ&ˆÜ˜ !Ó'ˆÜ�A˜!Óˆà”j “mˆRà‹7ØØ“(Ü*¨1°Ó3Ð3ñ! ð$ 	‰€Aä�q˜!˜QÓ€AÜ�q˜!˜QÓ€Aàˆ4€Kr    c                 ó`  • [        U 5      n[        U5      nXpeU(       d  [        S5      eX4:  a  U$ X4-
  S-   n[        X5      n [        XR5      n	Xd-
  US-
  pz[        XXU5      n[	        XX¢5      n[        X¼U5      nU[        U5      pmXd:  a  OXm:  d  [        XU5      eM\  [        XXU-  U5      $ )z£
Polynomial pseudo-remainder in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_prem(x**2 + 1, 2*x - 4)
20

rI   r   )r   rJ   r   rC   r0   ru   r   )r   rj   r   rk   rl   r¦   r§   r¨   r©   rª   r�   r¬   r­   r®   s                 r   Údup_premr±     sÂ   € ô 
�A‹€BÜ	�A‹€Bà€ræÜÐ 5Ó6Ð6Ø	‹Øˆà
‰�!‰€AÜ�!‹<€Dà
Ü�a‹|ˆØ‰w˜˜A™ˆ1ä˜1 AÓ&ˆÜ˜ !Ó'ˆÜ�A˜!Óˆà”j “mˆRà‹7ØØ“(Ü*¨1°Ó3Ð3ñ ô ˜! 1™W aÓ(Ð(r    c                 ó    • [        XU5      S   $ )zØ
Polynomial exact pseudo-quotient in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_pquo(x**2 - 1, 2*x - 2)
2*x + 2

>>> R.dup_pquo(x**2 + 1, 2*x - 4)
2*x + 4

r   )r¯   ©r   rj   r   s      r   Údup_pquor´   J  s   € ô" �A˜!Ó˜QÑÐr    c                 óF   • [        XU5      u  p4U(       d  U$ [        X5      e)a,  
Polynomial pseudo-quotient in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_pexquo(x**2 - 1, 2*x - 2)
2*x + 2

>>> R.dup_pexquo(x**2 + 1, 2*x - 4)
Traceback (most recent call last):
...
ExactQuotientFailed: [2, -4] does not divide [1, 0, 1]

)r¯   r   ©r   rj   r   r¥   r¦   s        r   Ú
dup_pexquor·   ^  s%   € ô& �A˜!Ó�D€AæØˆä! !Ó'Ð'r    c                 ó  • U(       d  [        XU5      $ [        X5      n[        X5      nUS:  a  [        S5      e[        U5      Xp‡nXE:  a  Xg4$ XE-
  S-   n	[	        X5      n
 [	        Xs5      nX…-
  U	S-
  pœ[        XjSX#5      n[        XÛXÂU5      n[        XzSX#5      n[        XXÂU5      n[        XïX#5      nU[        Xr5      nnX…:  a  OUU:  d  [        XU5      eMz  [        X©US-
  U5      n[        UUSX#5      n[        UUSX#5      nXg4$ )z¿
Polynomial pseudo-division in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_pdiv(x**2 + x*y, 2*x + 2)
(2*x + 2*y - 2, -4*y + 4)

r   rI   r   )
r¯   r   rJ   r   r   r3   r&   r*   r   r£   )r   rj   r$   r   rk   rl   r¥   r¦   r§   r¨   r©   rª   r�   r«   r¬   r­   r®   r   s                     r   Údmp_pdivr¹   y  s/  € ö Ü˜˜aÓ Ð ä	�AÓ	€BÜ	�AÓ	€Bà	ˆAƒvÜÐ 5Ó6Ð6ä˜‹{˜Aˆ"€Aà	ƒwØˆtˆà
‰�!‰€AÜ�!‹<€Dà
Ü�a‹|ˆØ‰w˜˜A™ˆ1ä˜ ! QÓ*ˆÜ˜ !¨Ó*ˆä˜ ! QÓ*ˆÜ˜ !¨Ó*ˆÜ�A˜!Óˆà”j Ó&ˆRˆà‹7ØØ�s“(Ü*¨1°Ó3Ð3ñ! ô$ 	�˜˜Q™ Ó"€Aä�Q˜˜1˜aÓ#€AÜ�Q˜˜1˜aÓ#€Aàˆ4€Kr    c                 ó¤  • U(       d  [        XU5      $ [        X5      n[        X5      nUS:  a  [        S5      eXpvXE:  a  U$ XE-
  S-   n[        X5      n	 [        Xc5      n
Xu-
  US-
  p‹[	        XiSX#5      n[	        XX²U5      n[        XÍX#5      nU[        Xb5      p~Xu:  a  OX~:  d  [        XU5      eM^  [        X˜US-
  U5      n[	        XoSX#5      $ )z¯
Polynomial pseudo-remainder in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_prem(x**2 + x*y, 2*x + 2)
-4*y + 4

r   rI   r   )r±   r   rJ   r   r3   r*   r   r£   )r   rj   r$   r   rk   rl   r¦   r§   r¨   r©   rª   r�   r¬   r­   r®   r   s                   r   Údmp_premr»   ²  sí   € ö Ü˜˜aÓ Ð ä	�AÓ	€BÜ	�AÓ	€Bà	ˆAƒvÜÐ 5Ó6Ð6à€rà	ƒwØˆà
‰�!‰€AÜ�!‹<€Dà
Ü�a‹|ˆØ‰w˜˜A™ˆ1ä˜ ! QÓ*ˆÜ˜ !¨Ó*ˆÜ�A˜!Óˆà”j Ó&ˆRà‹7ØØ“(Ü*¨1°Ó3Ð3ñ ô 	�˜˜Q™ Ó"€Aä˜˜a Ó&Ð&r    c                 ó    • [        XX#5      S   $ )zú
Polynomial exact pseudo-quotient in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> f = x**2 + x*y
>>> g = 2*x + 2*y
>>> h = 2*x + 2

>>> R.dmp_pquo(f, g)
2*x

>>> R.dmp_pquo(f, h)
2*x + 2*y - 2

r   )r¹   ©r   rj   r$   r   s       r   Údmp_pquor¾   å  s   € ô* �A˜!Ó Ñ"Ð"r    c                 óX   • [        XX#5      u  pE[        XR5      (       a  U$ [        X5      e)aS  
Polynomial pseudo-quotient in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> f = x**2 + x*y
>>> g = 2*x + 2*y
>>> h = 2*x + 2

>>> R.dmp_pexquo(f, g)
2*x

>>> R.dmp_pexquo(f, h)
Traceback (most recent call last):
...
ExactQuotientFailed: [[2], [2]] does not divide [[1], [1, 0], []]

)r¹   r
   r   ©r   rj   r$   r   r¥   r¦   s         r   Ú
dmp_pexquorÁ   ý  s-   € ô. �A˜!Ó�D€Aä�!×ÑØˆä! !Ó'Ð'r    c                 ót  • [        U 5      n[        U5      n/ XpvnU(       d  [        S5      eX4:  a  XV4$ [        X5      n [        Xb5      n	X˜-  (       a   XV4$ UR                  X˜5      n
Xt-
  n[	        XZX²5      n[        XX²5      n[        XlU5      nU[        U5      p}Xt:  a   XV4$ X}:  d  [        XU5      eMy  )z·
Univariate division with remainder over a ring.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_rr_div(x**2 + 1, 2*x - 4)
(0, x**2 + 1)

rI   )r   rJ   r   rQ   r   r0   ru   r   ©r   rj   r   rk   rl   r¥   r¦   r§   r©   rª   r   r�   rp   r®   s                 r   Ú
dup_rr_divrÄ     sÐ   € ô 
�A‹€BÜ	�A‹€Bà�1ˆ"€AæÜÐ 5Ó6Ð6Ø	‹Øˆtˆä�!‹<€Dà
Ü�a‹|ˆà�;Øð  ˆ4€Kð �G‰G�DÓˆØ‰Gˆä˜˜qÓ$ˆÜ˜˜qÓ$ˆÜ�A˜!Óˆà”j “mˆRà‹7Øð ˆ4€Kð “(Ü*¨1°Ó3Ð3ñ% r    c                 óÂ  • U(       d  [        XU5      $ [        X5      n[        X5      nUS:  a  [        S5      e[        U5      Xp‡nXE:  a  Xg4$ [	        X5      US-
  p© [	        Xs5      n[        X¹X£5      u  pÍ[        XÚ5      (       d   Xg4$ X…-
  n[        XlXâU5      n[        XXâU5      n[        XX#5      nU[        Xr5      nnX…:  a   Xg4$ UU:  d  [        XU5      eM�  )zÁ
Multivariate division with remainder over a ring.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_rr_div(x**2 + x*y, 2*x + 2)
(0, x**2 + x*y)

r   rI   r   )rÄ   r   rJ   r   r   Ú
dmp_rr_divr
   r&   r3   r*   r   ©r   rj   r$   r   rk   rl   r¥   r¦   r§   r©   r%   rª   r   r¬   r�   rp   r®   s                    r   rÆ   rÆ   M  óÿ   € ö Ü˜! Ó"Ð"ä	�AÓ	€BÜ	�AÓ	€Bà	ˆAƒvÜÐ 5Ó6Ð6ä˜‹{˜Aˆ"€Aà	ƒwØˆtˆä�Q‹l˜A ™Eˆ!à
Ü�a‹|ˆÜ˜$ aÓ+‰ˆä˜!×ÑØð ˆ4€Kð ‰Gˆä˜˜q QÓ'ˆÜ˜˜q QÓ'ˆÜ�A˜!Óˆà”j Ó&ˆRˆà‹7Øð ˆ4€Kð �s“(Ü*¨1°Ó3Ð3ñ% r    c                 óÌ  • [        U 5      n[        U5      n/ XpvnU(       d  [        S5      eX4:  a  XV4$ [        X5      n [        Xb5      n	UR                  X˜5      n
Xt-
  n[	        XZX²5      n[        XX²5      n[        XlU5      nU[        U5      p}Xt:  a   XV4$ X}:X  a4  UR                  (       d#  [        USS 5      n[        U5      nXt:  a   XV4$ OX}:  d  [        XU5      eM¥  )z¹
Polynomial division with remainder over a field.

Examples
========

>>> from sympy.polys import ring, QQ
>>> R, x = ring("x", QQ)

>>> R.dup_ff_div(x**2 + 1, 2*x - 4)
(1/2*x + 1, 5)

rI   r   N)
r   rJ   r   rQ   r   r0   ru   r‰   r   r   rÃ   s                 r   Ú
dup_ff_divrÊ   ‚  s÷   € ô 
�A‹€BÜ	�A‹€Bà�1ˆ"€AæÜÐ 5Ó6Ð6Ø	‹Øˆtˆä�!‹<€Dà
Ü�a‹|ˆà�G‰G�DÓˆØ‰Gˆä˜˜qÓ$ˆÜ˜˜qÓ$ˆÜ�A˜!Óˆà”j “mˆRà‹7Øð ˆ4€Kð ‹Y˜qŸzŸzä˜!˜A˜B˜%Ó ˆAÜ˜A“ˆBØ‹wØð ˆ4€Kð à“(Ü*¨1°Ó3Ð3ñ+ r    c                 óÂ  • U(       d  [        XU5      $ [        X5      n[        X5      nUS:  a  [        S5      e[        U5      Xp‡nXE:  a  Xg4$ [	        X5      US-
  p© [	        Xs5      n[        X¹X£5      u  pÍ[        XÚ5      (       d   Xg4$ X…-
  n[        XlXâU5      n[        XXâU5      n[        XX#5      nU[        Xr5      nnX…:  a   Xg4$ UU:  d  [        XU5      eM�  )zÎ
Polynomial division with remainder over a field.

Examples
========

>>> from sympy.polys import ring, QQ
>>> R, x,y = ring("x,y", QQ)

>>> R.dmp_ff_div(x**2 + x*y, 2*x + 2)
(1/2*x + 1/2*y - 1/2, -y + 1)

r   rI   r   )rÊ   r   rJ   r   r   Ú
dmp_ff_divr
   r&   r3   r*   r   rÇ   s                    r   rÌ   rÌ   ¶  rÈ   r    c                 óT   • UR                   (       a  [        XU5      $ [        XU5      $ )a  
Polynomial division with remainder in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x = ring("x", ZZ)
>>> R.dup_div(x**2 + 1, 2*x - 4)
(0, x**2 + 1)

>>> R, x = ring("x", QQ)
>>> R.dup_div(x**2 + 1, 2*x - 4)
(1/2*x + 1, 5)

)rK   rÊ   rÄ   r³   s      r   Údup_divrÎ   ë  s%   € ð$ 	‡z‡zÜ˜! Ó"Ð"ä˜! Ó"Ð"r    c                 ó    • [        XU5      S   $ )zê
Returns polynomial remainder in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x = ring("x", ZZ)
>>> R.dup_rem(x**2 + 1, 2*x - 4)
x**2 + 1

>>> R, x = ring("x", QQ)
>>> R.dup_rem(x**2 + 1, 2*x - 4)
5

r   ©rÎ   r³   s      r   Údup_remrÑ     ó   € ô$ �1˜Ó˜AÑÐr    c                 ó    • [        XU5      S   $ )zð
Returns exact polynomial quotient in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x = ring("x", ZZ)
>>> R.dup_quo(x**2 + 1, 2*x - 4)
0

>>> R, x = ring("x", QQ)
>>> R.dup_quo(x**2 + 1, 2*x - 4)
1/2*x + 1

r   rÐ   r³   s      r   Údup_quorÔ     rÒ   r    c                 óF   • [        XU5      u  p4U(       d  U$ [        X5      e)a'  
Returns polynomial quotient in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_exquo(x**2 - 1, x - 1)
x + 1

>>> R.dup_exquo(x**2 + 1, 2*x - 4)
Traceback (most recent call last):
...
ExactQuotientFailed: [2, -4] does not divide [1, 0, 1]

)rÎ   r   r¶   s        r   Ú	dup_exquorÖ   -  s%   € ô& �1˜Ó�D€AæØˆä! !Ó'Ð'r    c                 óT   • UR                   (       a  [        XX#5      $ [        XX#5      $ )a  
Polynomial division with remainder in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x,y = ring("x,y", ZZ)
>>> R.dmp_div(x**2 + x*y, 2*x + 2)
(0, x**2 + x*y)

>>> R, x,y = ring("x,y", QQ)
>>> R.dmp_div(x**2 + x*y, 2*x + 2)
(1/2*x + 1/2*y - 1/2, -y + 1)

)rK   rÌ   rÆ   r½   s       r   Údmp_divrØ   H  s%   € ð$ 	‡z‡zÜ˜! Ó%Ð%ä˜! Ó%Ð%r    c                 ó    • [        XX#5      S   $ )zý
Returns polynomial remainder in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x,y = ring("x,y", ZZ)
>>> R.dmp_rem(x**2 + x*y, 2*x + 2)
x**2 + x*y

>>> R, x,y = ring("x,y", QQ)
>>> R.dmp_rem(x**2 + x*y, 2*x + 2)
-y + 1

r   ©rØ   r½   s       r   Údmp_remrÛ   `  ó   € ô$ �1˜Ó˜qÑ!Ð!r    c                 ó    • [        XX#5      S   $ )a  
Returns exact polynomial quotient in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ, QQ

>>> R, x,y = ring("x,y", ZZ)
>>> R.dmp_quo(x**2 + x*y, 2*x + 2)
0

>>> R, x,y = ring("x,y", QQ)
>>> R.dmp_quo(x**2 + x*y, 2*x + 2)
1/2*x + 1/2*y - 1/2

r   rÚ   r½   s       r   Údmp_quorÞ   u  rÜ   r    c                 óX   • [        XX#5      u  pE[        XR5      (       a  U$ [        X5      e)aL  
Returns polynomial quotient in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> f = x**2 + x*y
>>> g = x + y
>>> h = 2*x + 2

>>> R.dmp_exquo(f, g)
x

>>> R.dmp_exquo(f, h)
Traceback (most recent call last):
...
ExactQuotientFailed: [[2], [2]] does not divide [[1], [1, 0], []]

)rØ   r
   r   rÀ   s         r   Ú	dmp_exquorà   Š  s-   € ô. �1˜Ó�D€Aä�!×ÑØˆä! !Ó'Ð'r    c                 óP   • U (       d  UR                   $ [        [        X5      5      $ )z­
Returns maximum norm of a polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_max_norm(-x**2 + 2*x - 3)
3

)r   rˆ   r^   ©r   r   s     r   Údup_max_normrã   ©  ó   € ö Ø�v‰vˆä”7˜1“=Ó!Ð!r    c                 ób   ^^• U(       d  [        U T5      $ US-
  m[        UU4S jU  5       5      $ )z¯
Returns maximum norm of a polynomial in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_max_norm(2*x*y - x - 3)
3

r   c              3   ó>   >#   • U  H  n[        UTT5      v •  M     g 7f©N)Údmp_max_norm©Ú.0r   r   r%   s     €€r   Ú	<genexpr>Údmp_max_norm.<locals>.<genexpr>Ð  s   øé € Ð0ªa¨Œ|˜A˜q !×$Ð$ªaùó   ƒ)rã   rˆ   ©r   r$   r   r%   s     `@r   rè   rè   ½  s/   ù€ ö Ü˜A˜qÓ!Ð!à	ˆA‰€AäÕ0©aÓ0Ó0Ð0r    c                 óP   • U (       d  UR                   $ [        [        X5      5      $ )z«
Returns l1 norm of a polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_l1_norm(2*x**3 - 3*x**2 + 1)
6

)r   Úsumr^   râ   s     r   Údup_l1_normrñ   Ó  rä   r    c                 ób   ^^• U(       d  [        U T5      $ US-
  m[        UU4S jU  5       5      $ )z©
Returns l1 norm of a polynomial in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_l1_norm(2*x*y - x - 3)
6

r   c              3   ó>   >#   • U  H  n[        UTT5      v •  M     g 7frç   )Údmp_l1_normré   s     €€r   rë   Údmp_l1_norm.<locals>.<genexpr>ú  s   øé € Ð/ªQ¨Œ{˜1˜a ×#Ð#ªQùrí   )rñ   rð   rî   s     `@r   rô   rô   ç  s/   ù€ ö Ü˜1˜aÓ Ð à	ˆA‰€AäÕ/©QÓ/Ó/Ð/r    c                 ó^   • [        U  Vs/ s H  o"S-  PM	     snUR                  5      $ s  snf )z¼
Returns squared l2 norm of a polynomial in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_l2_norm_squared(2*x**3 - 3*x**2 + 1)
14

r†   )rð   r   r\   s      r   Údup_l2_norm_squaredr÷   ý  s)   € ô ¡aÓ(¢a˜U�q”¡aÑ(¨!¯&©&Ó1Ð1ùÒ(s   Š*c                 ób   ^^• U(       d  [        U T5      $ US-
  m[        UU4S jU  5       5      $ )zº
Returns squared l2 norm of a polynomial in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_l2_norm_squared(2*x*y - x - 3)
14

r   c              3   ó>   >#   • U  H  n[        UTT5      v •  M     g 7frç   )Údmp_l2_norm_squaredré   s     €€r   rë   Ú&dmp_l2_norm_squared.<locals>.<genexpr>!  s   øé € Ð7²Q°Ô" 1 a¨×+Ð+²Qùrí   )r÷   rð   rî   s     `@r   rú   rú     s/   ù€ ö Ü" 1 aÓ(Ð(à	ˆA‰€AäÕ7±QÓ7Ó7Ð7r    c                 óh   • U (       d  UR                   /$ U S   nU SS  H  n[        X#U5      nM     U$ )z¸
Multiply together several polynomials in ``K[x]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x = ring("x", ZZ)

>>> R.dup_expand([x**2 - 1, x, 2])
2*x**3 - 2*x

r   r   N)rŸ   rx   )Úpolysr   r   rj   s       r   Ú
dup_expandrþ   $  s>   € ö Ø—‘ˆwˆàˆa‰€Aà�1�2‹YˆÜ�A˜!ÓŠñ ð €Hr    c                 ód   • U (       d  [        X5      $ U S   nU SS  H  n[        X4X5      nM     U$ )zÏ
Multiply together several polynomials in ``K[X]``.

Examples
========

>>> from sympy.polys import ring, ZZ
>>> R, x,y = ring("x,y", ZZ)

>>> R.dmp_expand([x**2 + y**2, x + 1])
x**3 + x**2 + x*y**2 + y**2

r   r   N)r   r2   )rý   r$   r   r   rj   s        r   Ú
dmp_expandr   =  s=   € ö Ü�q‹}Ðàˆa‰€Aà�1�2‹YˆÜ�A˜!ÓŠñ ð €Hr    N)RÚ__doc__Úsympy.polys.densebasicr   r   r   r   r   r   r	   r
   r   r   r   r   r   Úsympy.polys.polyerrorsr   r   r   r&   r(   r,   r0   r3   r6   r:   r=   r?   rC   rE   rM   rO   rR   rT   rW   rY   r^   r`   re   r+   rq   r"   ru   r*   rz   r~   r�   rƒ   rx   r2   r‡   r—   r¡   r£   r¯   r±   r´   r·   r¹   r»   r¾   rÁ   rÄ   rÆ   rÊ   rÌ   rÎ   rÑ   rÔ   rÖ   rØ   rÛ   rÞ   rà   rã   rè   rñ   rô   r÷   rú   rþ   r   rA   r    r   Ú<module>r     s{  ðÙ K÷÷ ÷ õ ÷ Sò2ò:@òD2ò:@òD3ò(Iò6$ò":ò"$ò":ò"&ò(7ò,'ò:7ò4*ò,9ò,ò(ò&+ò"-ò,%ò"-ò, 3òF'AòT 3òF'AòT+ò"1ò"+ò"1ò"63òr(òV%òP-ò`"òJ%òP2òj*)òZ ò((ò66òr0'òf#ò0(ò>.òb2òj1òh2òj#ò0ò*ò*(ò6&ò0"ò*"ò*(ò>"ò(1ò,"ò(0ò,2ò"8ò,ó2r    