+
    iB                        R t ^ RIHtHtHtHtHtHtHtH	t	H
t
HtHtHtHt ^ RIHtHt R tR tR tR tR tR tR	 tR
 tR tR tR tR tR tR tR t R t!R t"R t#R t$R t%R t&R t'R t(R t)R t*R t+R t,R t-R t.R  t/R! t0R" t1R# t2R$ t3R% t4R& t5R' t6R( t7R) t8R* t9R+ t:R, t;R- t<R. t=R/ t>R0 t?R1 t@R2 tAR3 tBR4 tCR5 tDR6 tER7 tFR8 tGR9 tHR: tIR; tJR< tKR= tLR> tMR? tNR@ tORA tPRB tQRC# )DzEArithmetics 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                f   V'       g   V # \        V 4      pWB,
          ^,
          pW$^,
          8X  d)   \        V ^ ,          V,           .V R,          ,           4      # W$8  d*   V.VP                  .W$,
          ,          ,           V ,           # V RV W,          V,           .,           W^,           R ,           # )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

   NNNlenr   zerofciKnms   &&&&  v/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/densearith.pydup_add_termr      s     AA		AEz!A$(ae+,,63!&&15))A--Ra5AD1H:%a%&	11    c                   V'       g   \        WW$4      # V^,
          p\        W4      '       d   V # \        V 4      pWb,
          ^,
          pW&^,
          8X  d.   \        \	        V ^ ,          WV4      .V R,          ,           V4      # W&8  d"   V.\        W&,
          WT4      ,           V ,           # V RV \	        W,          WV4      .,           W^,           R ,           # )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   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Ez'!A$a01AbE91==6315!//!33Ra5GAD!233aAi??r    c                h   V'       g   V # \        V 4      pWB,
          ^,
          pW$^,
          8X  d)   \        V ^ ,          V,
          .V R,          ,           4      # W$8  d+   V) .VP                  .W$,
          ,          ,           V ,           # V RV W,          V,
          .,           W^,           R ,           # )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   Nr   r   s   &&&&  r   dup_sub_termr(   M   s     AA		AEz!A$(ae+,,6B4166(AE**Q..Ra5AD1H:%a%&	11r    c                   V'       g   \        W) W$4      # V^,
          p\        W4      '       d   V # \        V 4      pWb,
          ^,
          pW&^,
          8X  d.   \        \	        V ^ ,          WV4      .V R,          ,           V4      # W&8  d,   \        WV4      .\        W&,
          WT4      ,           V ,           # V RV \	        W,          WV4      .,           W^,           R ,           # )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   N)r   r	   r   r   dmp_subdmp_negr   r#   s   &&&&&   r   dmp_sub_termr,   j   s     Ar1((	AA!AA		AEz'!A$a01AbE91==6A!$%	!%(>>BBRa5GAD!233aAi??r    c                    V'       d	   V '       g   . # V  Uu. uF  qDV,          NK  	  upVP                   .V,          ,           # u upi )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      s9     A	"#%!Ba!%
22%s   Ac           	         V'       g   \        WW$4      # V^,
          p\        W4      '       d   V # \        W4      '       d   \        V4      # V  Uu. uF  p\        WaWT4      NK  	  up\	        W%V4      ,           # u upi )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

)r0   r	   r
   dmp_mulr   )r   r   r   r$   r   r%   r/   s   &&&&&  r   dmp_mul_termr3      sm     A!''	AA!!{013"%3ia6HHH3s   A:c                    \        W^ V4      # )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   s   &&&r   dup_add_groundr6           a##r    c                >    \        V \        W^,
          4      ^ W#4      # )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   s   &&&&r   dmp_add_groundr:           :aQ/A99r    c                    \        W^ V4      # )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(   r5   s   &&&r   dup_sub_groundr=      r7   r    c                >    \        V \        W^,
          4      ^ W#4      # )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   r9   s   &&&&r   dmp_sub_groundr?      r;   r    c                `    V'       d	   V '       g   . # V  Uu. uF  q3V,          NK  	  up# u upi )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	"#%!Ba!%%%s   +c           	     ~    V'       g   \        WV4      # V^,
          pV  Uu. uF  p\        WQWC4      NK  	  up# u upi )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

)rC   dmp_mul_groundr   r   r$   r   r%   r/   s   &&&&  r   rE   rE     s<     aA&&	AA3461R^B1(1666   :c                    V'       g   \        R4      hV '       g   V # VP                  '       d!   V  Uu. uF  q2P                  W14      NK  	  up# V  Uu. uF  q3V,          NK  	  up# u upi u upi )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zzz()+"r++#$&1Rq1&& ,&s   A(A-c           	     ~    V'       g   \        WV4      # V^,
          pV  Uu. uF  p\        WQWC4      NK  	  up# u upi )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

)rM   dmp_quo_groundrF   s   &&&&  r   rO   rO   F  s<    $ aA&&	AA3461R^B1(1666rG   c                    V'       g   \        R4      hV '       g   V # V  Uu. uF  q2P                  W14      NK  	  up# u upi )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WWR^a)))s   >c           	     ~    V'       g   \        WV4      # V^,
          pV  Uu. uF  p\        WQWC4      NK  	  up# u upi )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

)rR   dmp_exquo_groundrF   s   &&&&  r   rT   rT   v  s=     a((	AA568QrbQ*Q888rG   c                J    V '       g   V # WP                   .V,          ,           # )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     FF8A:~r    c                    V RV)  # )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      Sqb6Mr    c                L    V  Uu. uF  q!P                  V4      NK  	  up# u upi )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"     ()*qeUU5\q***s   !c                |    V'       g   \        W4      # V^,
          pV  Uu. uF  p\        WCV4      NK  	  up# u upi )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^   dmp_absr   r$   r   r%   r/   s   &&&  r   r`   r`     9     q}	AA)*,2WRA,,,   9c                0    V  Uu. uF  q") NK  	  up# u upi )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                |    V'       g   \        W4      # V^,
          pV  Uu. uF  p\        WCV4      NK  	  up# u upi )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

)re   r+   ra   s   &&&  r   r+   r+     rb   rc   c                ~   V '       g   V# V'       g   V # \        V 4      p\        V4      pW48X  d/   \        \        W4       UUu. uF  w  rVWV,           NK  	  upp4      # \        W4,
          4      pW48  d
   V RV WR rMVRV WR rT\        W4       UUu. uF  w  rVWV,           NK  	  upp,           # u uppi u uppi )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8YTQ155Y899L7Ra5!B%qRa5!B%qs1y2ytqQUUy222 9 3s   B3
B9c                   V'       g   \        WV4      # \        W4      pV^ 8  d   V# \        W4      pV^ 8  d   V # V^,
          pWE8X  d4   \        \        W4       UUu. uF  w  rx\	        WxWc4      NK  	  uppV4      # \        WE,
          4      p	WE8  d
   V RV	 W	R r
MVRV	 WR rT
\        W4       UUu. uF  w  rx\	        WxWc4      NK  	  upp,           # u uppi u uppi )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

N)rq   r   r   rh   r"   r[   r   rj   r$   r   rk   rl   r%   rm   rn   ro   rp   s   &&&&       r   r"   r"   $  s     qQ	A	B	Av	A	B	Av	AA	x3q9F94171.9FJJL7Ra5!B%qRa5!B%qSY@YTQWQ1(Y@@@ G As   C
6Cc                   V '       g   \        W4      # V'       g   V # \        V 4      p\        V4      pW48X  d/   \        \        W4       UUu. uF  w  rVWV,
          NK  	  upp4      # \	        W4,
          4      pW48  d
   V RV WR rM\        VRV V4      WR rT\        W4       UUu. uF  w  rVWV,
          NK  	  upp,           # u uppi u uppi )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8YTQ155Y899L7Ra5!B%q1Ra5!$aeqs1y2ytqQUUy222 9 3s   C
)Cc                   V'       g   \        WV4      # \        W4      pV^ 8  d   \        WV4      # \        W4      pV^ 8  d   V # V^,
          pWE8X  d4   \        \	        W4       UUu. uF  w  rx\        WxWc4      NK  	  uppV4      # \        WE,
          4      p	WE8  d
   V RV	 W	R r
M\        VRV	 W#4      WR rT
\	        W4       UUu. uF  w  rx\        WxWc4      NK  	  upp,           # u uppi u uppi )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

N)ru   r   r+   r   rh   r*   r[   rs   s   &&&&       r   r*   r*   q  s     qQ	A	B	AvqQ	A	B	Av	AA	x3q9F94171.9FJJL7Ra5!B%q1Ra5!'2qSY@YTQWQ1(Y@@@ G As   )C+

C1c                0    \        V \        WV4      V4      # )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          1gaA&**r    c           	     0    \        V \        WW44      W44      # )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~          1gaA)100r    c                0    \        V \        WV4      V4      # )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    \        V \        WW44      W44      # )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           
        W8X  d   \        W4      # V '       d	   V'       g   . # \        V 4      p\        V4      p\        W44      ^,           pV^d8  g   VP                  '       g   . p\	        ^ W4,           ^,           4       Fv  pVP
                  p\	        \        ^ Wt,
          4      \        W74      ^,           4       F&  p	WV	,          WV	,
          ,          ,          ,          pK(  	  VP                  V4       Kx  	  \        V4      # V^,          p
\        V ^ W4      \        V^ W4      r\        \        W
WR4      W4      p\        \        WWR4      W4      p\        WV4      \        WV4      pp\        \        WV4      \        WV4      V4      p\        V\        VVV4      V4      p\        \        V\        VW4      V4      \        V^V
,          V4      V4      # )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

)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3wajjjq"'A+&AFFE3q!&>3r:>:1aAh& ; HHUO ' |
 T1a'1a)?B	!.6	!.6#WRQ%7Bgba('"!*<a@c72r1-q1wr:c2#91=!"adA.3 	3r    c                   V'       g   \        WV4      # W8X  d   \        WV4      # \        W4      pV^ 8  d   V # \        W4      pV^ 8  d   V# . V^,
          rv\        ^ WE,           ^,           4       F}  p\	        V4      p	\        \        ^ W,
          4      \        WH4      ^,           4       F.  p
\        V	\        W
,          WV
,
          ,          Ws4      Ws4      p	K0  	  VP                  V	4       K  	  \        Wb4      # )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

)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     qQvqQ	A	B	Av	A	B	Avq1uq1bgk"s1af~s2zA~6AE714q51#@!GE 7 	
 # Q?r    c                    \        V 4      ^,
          . r2\        ^ ^V,          ^,           4       F  pVP                  p\        ^ WB,
          4      p\	        WB4      pWv,
          ^,           pWh^,          ,           ^,
          p\        Wg^,           4       F&  p	WPV	,          WV	,
          ,          ,          ,          pK(  	  WU,          pV^,          '       d   W^,           ,          p
WZ^,          ,          pVP                  V4       K  	  \        V4      # )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   rk   rp   r   r   jminjmaxr   r   elems   &&         r   r   r   C  s     FQJ1adQhFF1af~1zK!O1f}q tAX&A1aAhA ' 	
q55AX;DqLA	'  * Q<r    c                   V'       g   \        W4      # \        W4      pV^ 8  d   V # . V^,
          rT\        ^ ^V,          ^,           4       F  p\        V4      p\	        ^ Wc,
          4      p\        Wc4      p	W,
          ^,           p
W^,          ,           ^,
          p	\        W^,           4       F.  p\        V\        W,          WV,
          ,          WR4      WR4      pK0  	  \        Wr! ^4      WR4      pV
^,          '       d&   \        W	^,           ,          WR4      p\        W|WR4      pVP                  V4       K  	  \        WA4      # )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"   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	Avq1uq1adQhQK1af~1zK!O1f}q tAX&A714q518!?A ' 1adA)q551AX;-D&A	'  * Q?r    c                *   V'       g   VP                   .# V^ 8  d   \        R4      hV^8X  g   V '       d   WP                   .8X  d   V # VP                   .p V^,          TrAV^,          '       d   \        W0V4      pV'       g    V# \        W4      p K>  )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

+Cannot raise polynomial to a negative power)one
ValueErrorrx   r   )r   r   r   rj   r   s   &&&  r   dup_powr     s     w1uFGGAvQ!w,	
A
!tQ1q55a A H AMr    c                `   V'       g   \        WV4      # V'       g   \        W#4      # V^ 8  d   \        R4      hV^8X  g$   \        W4      '       g   \	        WV4      '       d   V # \        W#4      p V^,          TrQV^,          '       d   \        W@W#4      pV'       g    V# \        WV4      p K?  )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   r2   r   )r   r   r$   r   rj   r   s   &&&&  r   dmp_powr     s     qQq}1uFGGAvA!!YqQ%7%7A
!tQ1q55a#A H A!r    c                   \        V 4      p\        V4      p. YrvpV'       g   \        R4      hW48  d   WV3# W4,
          ^,           p\        W4      p	 \        Wb4      p
Wt,
          V^,
          r\        WYV4      p\	        WW4      p\        WiV4      p\        WW4      p\        WV4      pT\        V4      rWt8  d   MW8  d   Ks  \        WV4      hW,          p\        VVV4      p\        VVV4      pWV3# )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   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1A&!'1A&!'A!jmR7(*133Aq!QAq!QA4Kr    c                   \        V 4      p\        V4      pYreV'       g   \        R4      hW48  d   V# W4,
          ^,           p\        W4      p \        WR4      p	Wd,
          V^,
          rz\        WXV4      p\	        WW4      p\        WV4      pT\        V4      rmWd8  d   MWm8  d   K[  \        WV4      h\        WXV,          V4      # )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   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1A&!'A!jmR7(*133!1Wa((r    c                (    \        WV4      ^ ,          # )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   rj   r   s   &&&r   dup_pquor   J  s    " A!Qr    c                H    \        WV4      w  r4V'       g   V# \        W4      h)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!DA!!''r    c                J   V'       g   \        WV4      # \        W4      p\        W4      pV^ 8  d   \        R4      h\        V4      YrpWE8  d   Wg3# WE,
          ^,           p	\	        W4      p
 \	        Ws4      pW,
          V	^,
          r\        Wj^ W#4      p\        WWV4      p\        Wz^ W#4      p\        WWV4      p\        WW#4      pT\        Wr4      ppW8  d   MVV8  d   Ky  \        WV4      h\        WV^,
          V4      p\        VV^ W#4      p\        VV^ W#4      pWg3# )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)

rI   )
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	Av 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1a#AQ1a#A4Kr    c                   V'       g   \        WV4      # \        W4      p\        W4      pV^ 8  d   \        R4      hYrvWE8  d   V# WE,
          ^,           p\        W4      p	 \        Wc4      p
Wu,
          V^,
          r\	        Wi^ W#4      p\	        WWV4      p\        WW#4      pT\        Wb4      r~Wu8  d   MW~8  d   K]  \        WV4      h\        WV^,
          V4      p\	        Wo^ W#4      # )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

rI   )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	Av 566r	w
!A!<D
a|wA1!Q*!*A!j&R7(*133Q"Aa&&r    c                (    \        WW#4      ^ ,          # )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   rj   r$   r   s   &&&&r   dmp_pquor     s    * A!""r    c                Z    \        WW#4      w  rE\        WR4      '       d   V# \        W4      h)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!DA!!!''r    c                   \        V 4      p\        V4      p. YrvpV'       g   \        R4      hW48  d   WV3# \        W4      p \        Wb4      p	W,          '       d    WV3# VP                  W4      p
Wt,
          p\	        WZW4      p\        WW4      p\        WlV4      pT\        V4      r}Wt8  d    WV3# W}8  d   Ky  \        WV4      h)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|;;  4K GGDGq$q$A!jmR7 4K (*133r    c                   V'       g   \        WV4      # \        W4      p\        W4      pV^ 8  d   \        R4      h\        V4      YrpWE8  d   Wg3# \	        W4      V^,
          r \	        Ws4      p\        WW4      w  r\        W4      '       g    Wg3# W,
          p\        WlWV4      p\        WWV4      p\        WW#4      pT\        Wr4      ppW8  d    Wg3# VV8  d   K}  \        WV4      h)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)

rI   )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	Av 566{A"A	wtQlAE!
a|$a+! 4K GqQ'qQ'A!j&R7 4K s(*133r    c                   \        V 4      p\        V4      p. YrvpV'       g   \        R4      hW48  d   WV3# \        W4      p \        Wb4      p	VP                  W4      p
Wt,
          p\	        WZW4      p\        WW4      p\        WlV4      pT\        V4      r}Wt8  d    WV3# W}8X  d<   VP                  '       g*   \        VR,          4      p\        V4      pWt8  d    WV3# K  W}8  d   K  \        WV4      h)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   )
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|GGDGq$q$A!jmR7 4K Yqzzz!B% AABw 4K (*133r    c                   V'       g   \        WV4      # \        W4      p\        W4      pV^ 8  d   \        R4      h\        V4      YrpWE8  d   Wg3# \	        W4      V^,
          r \	        Ws4      p\        WW4      w  r\        W4      '       g    Wg3# W,
          p\        WlWV4      p\        WWV4      p\        WW#4      pT\        Wr4      ppW8  d    Wg3# VV8  d   K}  \        WV4      h)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)

rI   )r   r   rJ   r
   r   
dmp_ff_divr	   r&   r3   r*   r   r   s   &&&&             r   r   r     r   r    c                V    VP                   '       d   \        WV4      # \        WV4      # )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'    $ 	zzz!""!""r    c                (    \        WV4      ^,          # )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   s   &&&r   dup_remr         $ 1Ar    c                (    \        WV4      ^ ,          # )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   s   &&&r   dup_quor     r   r    c                H    \        WV4      w  r4V'       g   V# \        W4      h)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DA!!''r    c                V    VP                   '       d   \        WW#4      # \        WW#4      # )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'    $ 	zzz!%%!%%r    c                (    \        WW#4      ^,          # )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   s   &&&&r   dmp_remr   `      $ 1q!!r    c                (    \        WW#4      ^ ,          # )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   s   &&&&r   dmp_quor   u  r   r    c                Z    \        WW#4      w  rE\        WR4      '       d   V# \        W4      h)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DA!!!''r    c                R    V '       g   VP                   # \        \        W4      4      # )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          vv71=!!r    c                l   aa V'       g   \        V S4      # V^,
          o\        VV3R lV  4       4      # )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

c              3   >   <"   T F  p\        VSS4      x  K  	  R # 5iN)dmp_max_norm.0r   r   r%   s   & r   	<genexpr>dmp_max_norm.<locals>.<genexpr>  s     0a|Aq!$$a   )r   r   r   r$   r   r%   s   &&f@r   r   r     s/     Aq!!	AA0a000r    c                R    V '       g   VP                   # \        \        W4      4      # )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                l   aa V'       g   \        V S4      # V^,
          o\        VV3R lV  4       4      # )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

c              3   >   <"   T F  p\        VSS4      x  K  	  R # 5ir   )dmp_l1_normr   s   & r   r   dmp_l1_norm.<locals>.<genexpr>  s     /Q{1a##Qr   )r   r   r   s   &&f@r   r   r     s/     1a  	AA/Q///r    c                d    \        V  Uu. uF  q"^,          NK  	  upVP                  4      # u upi )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\   s   && r   dup_l2_norm_squaredr     s+     a(aUqa(!&&11(s   -c                l   aa V'       g   \        V S4      # V^,
          o\        VV3R lV  4       4      # )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

c              3   >   <"   T F  p\        VSS4      x  K  	  R # 5ir   )dmp_l2_norm_squaredr   s   & r   r   &dmp_l2_norm_squared.<locals>.<genexpr>!  s     7Q"1a++Qr   )r   r   r   s   &&f@r   r   r     s/     "1a((	AA7Q777r    c                z    V '       g   VP                   .# V ^ ,          pV R,           F  p\        W#V4      pK  	  V# )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   rx   )polysr   r   rj   s   &&  r   
dup_expandr   $  s>     waA2YYA!  Hr    c                v    V '       g   \        W4      # V ^ ,          pV R,           F  p\        W4W4      pK  	  V# )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   r2   )r   r$   r   r   rj   s   &&&  r   
dmp_expandr   =  s=     q}aA2YY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,':74*,9,(&+"-,%"-, 3F'AT 3F'AT+"1"+"1"63r(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    