+
    i                         R t ^ RIHt ^ RIH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 ^ 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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,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t>H?t?H@t@HAtAHBtBHCtCHDtD ^ RIEHFtFHGtGHHtHHItIHJtJHKtKHLtLHMtMHNtNHOtOHPtPHQtQHRtRHStSHTtT ^ RIUHVtVHWtWHXtX ^ RIYHZtZH[t[H\t\H]t]H^t^H_t_H`t` ^ R	IaHbtb ^ R
IcHdtd ^ RIeHftfHgtgHhthHiti ^ RIjHktk ^ RIlHmtnHotpHqtr ]R8X  d   ^ RIsHttt MRttR tuR tvR twR txR tyR tzR t{R t|R t}R6R lt~R tR tR tR tR tR  tR! tR" tR# tR$ tR% tR7R& ltR' tR( tR) tR* tR+ tR, tR- tR. tR/ tR0 tR1 tR2 tR3 tR4 tR5 tR# )8z:Polynomial factorization routines in characteristic zero. )GROUND_TYPES)_randint)gf_from_int_polygf_to_int_poly	gf_lshift
gf_add_mulgf_mulgf_divgf_remgf_gcdexgf_sqf_pgf_factor_sqf	gf_factor)dup_LCdmp_LCdmp_ground_LCdup_TCdup_convertdmp_convert
dup_degree
dmp_degreedmp_degree_indmp_degree_listdmp_from_dict
dmp_zero_pdmp_onedmp_nest	dmp_raise	dup_strip
dmp_grounddup_inflatedmp_excludedmp_include
dmp_inject	dmp_ejectdup_terms_gcddmp_terms_gcd)dup_negdmp_negdup_adddmp_adddup_subdmp_subdup_muldmp_muldup_sqrdmp_powdup_divdmp_divdup_quodmp_quo
dmp_expanddmp_add_muldup_sub_muldmp_sub_mul
dup_lshiftdup_max_normdmp_max_normdup_l1_normdup_mul_grounddmp_mul_grounddup_quo_grounddmp_quo_ground)dup_clear_denomsdmp_clear_denoms	dup_truncdmp_ground_truncdup_content	dup_monicdmp_ground_monicdup_primitivedmp_ground_primitivedmp_eval_taildmp_eval_indmp_diff_eval_in	dup_shift	dmp_shift
dup_mirror)dmp_primitivedup_inner_gcddmp_inner_gcd)	dup_sqf_pdup_sqf_normdmp_sqf_normdup_sqf_partdmp_sqf_part_dup_check_degrees_dmp_check_degrees)_sort_factors)query)ExtraneousFactorsDomainErrorCoercionFailedEvaluationFailed)subsets)ceilloglog2flint)	fmpz_polyNc                    . pV FL  p^ p \        WV4      w  rgV'       g   Ye^,           rPK"   T^ 8X  d   \        R4      hTP                  YE34       KN  	  \        V4      # )z
Determine multiplicities of factors for a univariate polynomial
using trial division.

An error will be raised if any factor does not divide ``f``.
trial division failed)r1   RuntimeErrorappendrZ   )ffactorsKresultfactorkqrs   &&&     w/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/factortools.pydup_trial_divisionrs   X   sf     F1a(DAa%16677vk"         c                    . pV FU  p^ p \        WW#4      w  rx\        W4      '       d   Yv^,           r`K+   T^ 8X  d   \        R4      hTP                  YV34       KW  	  \	        V4      # )z
Determine multiplicities of factors for a multivariate polynomial
using trial division.

An error will be raised if any factor does not divide ``f``.
rg   )r2   r   rh   ri   rZ   )	rj   rk   url   rm   rn   ro   rp   rq   s	   &&&&     rr   dmp_trial_divisionrw   t   sn     F1a+DA!a%16677vk"     rt   c                   ^ RI Hp \        V 4      p\        V^,          4      p\        V^,          4      pVP	                  \        R V  4       4      4      pV! V^,
          V4      pV! V^,
          V^,
          4      pVP                  \        W4      4      p	Wv,          W,          ,           p
V
\        W4      ,          p
\        V
^,          4      ^,          p
V
# )ae  
The Knuth-Cohen variant of Mignotte bound for
univariate polynomials in ``K[x]``.

Examples
========

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

>>> f = x**3 + 14*x**2 + 56*x + 64
>>> R.dup_zz_mignotte_bound(f)
152

By checking ``factor(f)`` we can see that max coeff is 8

Also consider a case that ``f`` is irreducible for example
``f = 2*x**2 + 3*x + 4``. To avoid a bug for these cases, we return the
bound plus the max coefficient of ``f``

>>> f = 2*x**2 + 3*x + 4
>>> R.dup_zz_mignotte_bound(f)
6

Lastly, to see the difference between the new and the old Mignotte bound
consider the irreducible polynomial:

>>> f = 87*x**7 + 4*x**6 + 80*x**5 + 17*x**4 + 9*x**3 + 12*x**2 + 49*x + 26
>>> R.dup_zz_mignotte_bound(f)
744

The new Mignotte bound is 744 whereas the old one (SymPy 1.5.1) is 1937664.


References
==========

..[1] [Abbott13]_

)binomialc              3   2   "   T F  q^,          x  K  	  R# 5i)   N .0cfs   & rr   	<genexpr>(dup_zz_mignotte_bound.<locals>.<genexpr>   s     0QrUUQs   )	(sympy.functions.combinatorial.factorialsry   r   _ceilsqrtsumabsr   r:   )rj   rl   ry   ddeltadelta2	eucl_normt1t2lcbounds   &&         rr   dup_zz_mignotte_boundr      s    R B1A!a%LE519F 0Q002I 
%!)V	$B	%!)VaZ	(B	
va|	BNRW$E	\!E%!)q ELrt   c                    \        WV4      p\        \        WV4      4      p\        \	        W4      4      pVP                  V! V^,           4      4      ^V,          ,          V,          V,          # )z7Mignotte bound for multivariate polynomials in `K[X]`. )r;   r   r   r   r   r   )rj   rv   rl   abns   &&&   rr   dmp_zz_mignotte_boundr      sX    Q1AM!"#AOA!"A66!AE(AqD "1$$rt   c                   V ^,          p\        WW64      p\        WV4      p\        \        WHV4      W64      w  r\        WV4      p	\        WV4      p
\	        \        WXV4      \        WV4      V4      p\        \	        W+V4      Wv4      p\        \	        W:V4      Wv4      p\	        \        WLV4      \        W]V4      V4      p\        \        WP                  .V4      Wv4      p\        \        WNV4      W4      w  pp\        WV4      p\        VWv4      p\	        \        W^V4      \        WV4      V4      p\        \        VVV4      Wv4      p\        \        W[V4      Wv4      pWVV3# )a  
One step in Hensel lifting in `Z[x]`.

Given positive integer `m` and `Z[x]` polynomials `f`, `g`, `h`, `s`
and `t` such that::

    f = g*h (mod m)
    s*g + t*h = 1 (mod m)

    lc(f) is not a zero divisor (mod m)
    lc(h) = 1

    deg(f) = deg(g) + deg(h)
    deg(s) < deg(h)
    deg(t) < deg(g)

returns polynomials `G`, `H`, `S` and `T`, such that::

    f = G*H (mod m**2)
    S*G + T*H = 1 (mod m**2)

References
==========

.. [1] [Gathen99]_

)r7   rC   r1   r-   r)   r+   one)mrj   ghstrl   Merp   rq   rv   GHr   cr   STs   &&&&&&&            rr   dup_zz_hensel_stepr      sH   8 	
1AA!A!A71#Q*DA!A!Aa '!"2A6A'!"A)A'!"A)Aa '!"2A6A'!eeWa(!/A71#Q*DAq!A!QAa '!"2A6A'!Q"A)A'!"A)AA:rt   c           
         \        V4      p\        W4      pV^8X  d>   \        WP                  W`V,          4      ^ ,          V4      p\	        WpV,          V4      .# T pV^,          p	\        \        \        V4      4      4      p
\        V.V 4      pVRV	  F  p\        V\        W4      W4      pK  	  \        W),          V 4      pW)^,           R  F  p\        V\        W4      W4      pK  	  \        WW4      w  rp\        W4      p\        W4      p\        W4      p\        W4      p\        ^V
^,           4       F  p\        WWWV4      V^,          uw  rrpK   	  \        WVRV	 W44      \        WW)R W44      ,           # )a  
Multifactor Hensel lifting in `Z[x]`.

Given a prime `p`, polynomial `f` over `Z[x]` such that `lc(f)`
is a unit modulo `p`, monic pair-wise coprime polynomials `f_i`
over `Z[x]` satisfying::

    f = lc(f) f_1 ... f_r (mod p)

and a positive integer `l`, returns a list of monic polynomials
`F_1,\ F_2,\ \dots,\ F_r` satisfying::

   f = lc(f) F_1 ... F_r (mod p**l)

   F_i = f_i (mod p), i = 1..r

References
==========

.. [1] [Gathen99]_

N)lenr   r=   gcdexrC   intr   _log2r   r   r   r   ranger   dup_zz_hensel_lift)prj   f_listlrl   rq   r   Fr   ro   r   r   f_ir   r   r   _s   &&&&&            rr   r   r     sq   . 	FA	BAv1ggbQ$/2A61dA&((	A	QAE%(OA"q!Abqz1&s.5  	A&A!ef~1&s.5  qQ"GA!qAqAqAqA1a!e_,Q1qA1a4qa  aF2AJ5
Q6":q
45 5rt   c                 V    W^,          8  d	   W,
          pV'       g   R# W,          ^ 8H  # )r{   Tr|   )fcrp   pls   &&&rr   _test_plr   G  s$    7{F6Q;rt   c           
     |   \        V 4      pV^8X  d   V .# ^ RIHp V R,          p\        W4      p\	        W4      p\        \        VP                  V! V^,           4      4      ^V,          ,          V,          V,          4      4      p\        V^,           ^V,          ,          V^V,          ^,
          ,          ,          4      p\        \        ^\        V4      ,          4      4      p	\        ^V	,          \        V	4      ,          4      p
. p\        ^V
^,           4       F  pV! V4      '       d   Wl,          ^ 8X  d   K   VP                  V4      p\        W4      p\        WV4      '       g   KP  \        WV4      ^,          pVP!                  W34       \#        V4      ^8  g   \#        V4      ^8  g   K   M	  \%        VR R7      w  pp\        \        \        ^V,          ^,           V4      4      4      pV Uu. uF  p\'        VV4      NK  	  pp\)        WVVV4      p\        \#        V4      4      p\+        V4      p. ^ppVV,          p^V,          \#        V4      8:  Ed   \-        VV4       EF  pV^8X  dB   ^pV F  pVVV,          R,          ,          pK  	  VV,          p\/        VVV4      '       g   KK  MaV.pV F  p\1        VVV,          V4      pK  	  \3        VVV4      p\5        VV4      ^,          pVR,          pV'       d   VV,          ^ 8w  d   K  V.p\+        V4      pVV,
          pV^8X  d.   V.pV F  p\1        VVV,          V4      pK  	  \3        VVV4      pV F  p\1        VVV,          V4      pK  	  \3        VVV4      p\7        XV4      p \7        VV4      p!V V!,          V8:  g   EKK  TpV Uu. uF  pVV9  g   K  VNK  	  pp\5        VV4      ^,          p\5        VV4      ^,          p VP!                  V4       \	        W4      p EK  	  V^,          pEK  VV .,           # u upi u upi )z4Factor primitive square-free polynomials in `Z[x]`. )isprimec                 &    \        V ^,          4      #    )r   )xs   &rr   <lambda>#dup_zz_zassenhaus.<locals>.<lambda>p  s    3qt9rt   )key)r   sympy.ntheoryr   r:   r   r   r   r   r   r   _logr   convertr   r   r   ri   r   minr   r   setr`   r   r-   rC   rH   r<   )"rj   rl   r   r   r   Ar   BCgammar   r   pxr   fsqfxr   fsqfr   ffmodularr   sorted_Tr   rk   r   r   r   rp   ir   r   T_SG_normH_norms"   &&                                rr   dup_zz_zassenhausr   N  s   1AAvs
%	
2BQAqACqQx A%a')*+AQUacN1qsQw<'(Aaaj!"E%U#$E
A Auqy!r{{afkYYr]Q#q!!aQ'*	"u:?c!fqj " !,-GAtE$qsQw"#$A/34t~b!$tG41!Q/ASV}HHAQQG	
AB
A#Q-1%A
 AvA!A$r(
A FAr** + CA1Q4+A aQ'!!Q'*bEa1AAAa%CAvCA1Q4+A aQ'AqtQ'  !R#A A&F A&Ff}!'/>x!1A:AAx>!!Q'*!!Q'*q!1Le &h FAaS=A 5h ?s   :P4 	P9P9c                   \        W4      p\        W4      p\        V R,          V4      pV'       dY   ^ RIHp V! \        V4      4      pVP                  4        F+  pW',          '       g   K  W7^,          ,          '       g   K*   R# 	  R# R# )z2Test irreducibility using Eisenstein's criterion. r   NN	factorintTN)r   r   rE   r   r   r   keys)rj   rl   r   tce_fcr   e_ffr   s   &&      rr   dup_zz_irreducible_pr     sa    	B	Bqua D+T#ARQ$YY 	 rt   c                *   VP                   '       d    YP                  4       r\        WV4      p MVP                  '       g   R# \        W4      p\        W4      pV^8w  g   VR8w  d
   V^8w  d   R# V'       g)   \        W4      w  rgWaP                  8w  g
   Wp^3.8w  d   R# \        V 4      p. . r\        VRR4       F  pV	P                  ^ W,          4       K  	  \        V^,
          RR4       F  pV
P                  ^ W,          4       K  	  \        \        V	4      V4      p	\        \        V
4      V4      p
\        V	\        V
^V4      V4      pVP!                  \        W4      4      '       d   \#        W4      pW8X  d   R# \%        W4      p	VP!                  \        W4      4      '       d   \#        W4      p	W8X  d   \'        W4      '       d   R# \)        W4      p\        W4      V8X  d   \'        W4      '       d   R# R#   \         d     R# i ; i)a   
Efficiently test if ``f`` is a cyclotomic polynomial.

Examples
========

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

>>> f = x**16 + x**14 - x**10 + x**8 - x**6 + x**2 + 1
>>> R.dup_cyclotomic_p(f)
False

>>> g = x**16 + x**14 - x**10 - x**8 - x**6 + x**2 + 1
>>> R.dup_cyclotomic_p(g)
True

References
==========

Bradford, Russell J., and James H. Davenport. "Effective tests for
cyclotomic polynomials." In International Symposium on Symbolic and
Algebraic Computation, pp. 244-251. Springer, Berlin, Heidelberg, 1988.

FTr   )is_QQget_ringr   r^   is_ZZr   r   dup_factor_listr   r   r   insertr/   r   r+   r9   is_negativer'   rO   dup_cyclotomic_prV   )rj   rl   irreducibleK0r   r   coeffrk   r   r   r   r   r   r   s   &&&           rr   r   r     s   4 	www	zz|A1%A WWW	B	B	Qw28a(.EE>WQ01Arq1b"	AD  1q5"b!	AD " 		!a A	!a A:aA&*A}}VA\""AMv1A}}VA\""AMv"1((QAq}.q44e  		s   H HHc                    ^ RI Hp VP                  VP                  ) .pV! V 4      P                  4        F5  w  rE\	        \        W4V4      W14      p\        W4V^,
          ,          V4      pK7  	  V# )z1Efficiently generate n-th cyclotomic polynomial. r   )r   r   r   itemsr3   r    )r   rl   r   r   r   ro   s   &&    rr   dup_zz_cyclotomic_polyr     s_    '	
A!""$Ka(!/q1u:q) % Hrt   c                    ^ RI Hp VP                  VP                  ) ..pV! V 4      P                  4        Fz  w  rEV Uu. uF  p\	        \        WdV4      Wa4      NK  	  ppVP                  V4       \        ^V4       F/  pV U	u. uF  p	\        WV4      NK  	  pp	VP                  V4       K1  	  K|  	  V# u upi u up	i )    r   )r   r   r   r   r3   r    extendr   )
r   rl   r   r   r   ro   r   Qr   rp   s
   &&        rr   _dup_cyclotomic_decomposer   &  s    '
%%!%%A!""$;<>1agk!*A11>	q!A0131+aA&A3HHQK 	 % H ? 4s    B7B<c                   \        W4      \        W4      r2\        V 4      ^ 8:  d   R# V^8w  g   VR9  d   R# \        ;QJ d    R V ^R  4       F  '       g   K   RM	  RM! R V ^R  4       4      '       d   R# \        V 4      p\	        WA4      pVP                  V4      '       g   V# . p\	        ^V,          V4       F  pWu9  g   K  VP                  V4       K  	  V# )a  
Efficiently factor polynomials `x**n - 1` and `x**n + 1` in `Z[x]`.

Given a univariate polynomial `f` in `Z[x]` returns a list of factors
of `f`, provided that `f` is in the form `x**n - 1` or `x**n + 1` for
`n >= 1`. Otherwise returns None.

Factorization is performed using cyclotomic decomposition of `f`,
which makes this method much faster that any other direct factorization
approach (e.g. Zassenhaus's).

References
==========

.. [1] [Weisstein09]_

Nc              3   8   "   T F  p\        V4      x  K  	  R # 5i)N)boolr}   s   & rr   r   +dup_zz_cyclotomic_factor.<locals>.<genexpr>P  s     
&g488gs   TFr   )r   r   )r   r   r   anyr   is_oneri   )rj   rl   lc_ftc_fr   r   r   r   s   &&      rr   dup_zz_cyclotomic_factorr   6  s    $ va|$!}qyD'
s
&a"g
&sss
&a"g
&&&1A!!'A88D>>*1Q32Az 3 rt   c                \   \        W4      w  r#\        V4      p\        W14      ^ 8  d   V) \        W14      r2V^ 8:  d   V. 3# V^8X  d   W#.3# \	        R4      '       d   \        W14      '       d   W#.3# Rp\	        R4      '       d   \        W14      pVf   \        W14      pV\        VRR7      3# )z:Factor square-free (non-primitive) polynomials in `Z[x]`. USE_IRREDUCIBLE_IN_FACTORNUSE_CYCLOTOMIC_FACTORF)multiple)	rH   r   r   r'   r[   r   r   r   rZ   )rj   rl   contr   r   rk   s   &&    rr   dup_zz_factor_sqfr   b  s    A!GD1Aa|a%aAvRx	
aSy())%%9G$%%*10#A)w777rt   c                x   \         R8X  dd   \        V RRR1,          4      pVP                  4       w  r4V UUu. uF!  w  rVVP                  4       RRR1,          V3NK#  	  pppV\	        V4      3# \        W4      w  r7\        V4      p\        Wq4      ^ 8  d   V) \        Wq4      rsV^ 8:  d   V. 3# V^8X  d   W7^3.3# \        R4      '       d   \        Wq4      '       d   W7^3.3# \        Wq4      pRp	\        R4      '       d   \        Wq4      p	V	f   \        Wq4      p	\        W	V4      p\        W4       W43# u uppi )a  
Factor (non square-free) polynomials in `Z[x]`.

Given a univariate polynomial `f` in `Z[x]` computes its complete
factorization `f_1, ..., f_n` into irreducibles over integers::

            f = content(f) f_1**k_1 ... f_n**k_n

The factorization is computed by reducing the input polynomial
into a primitive square-free polynomial and factoring it using
Zassenhaus algorithm. Trial division is used to recover the
multiplicities of factors.

The result is returned as a tuple consisting of::

          (content(f), [(f_1, k_1), ..., (f_n, k_n))

Examples
========

Consider the polynomial `f = 2*x**4 - 2`::

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

    >>> R.dup_zz_factor(2*x**4 - 2)
    (2, [(x - 1, 1), (x + 1, 1), (x**2 + 1, 1)])

In result we got the following factorization::

             f = 2 (x - 1) (x + 1) (x**2 + 1)

Note that this is a complete factorization over integers,
however over Gaussian integers we can factor the last term.

By default, polynomials `x**n - 1` and `x**n + 1` are factored
using cyclotomic decomposition to speedup computations. To
disable this behaviour set cyclotomic=False.

References
==========

.. [1] [Gathen99]_

rd   Nr   r   r   )r   re   rn   coeffsrZ   rH   r   r   r'   r[   r   rV   r   r   rs   rX   )
rj   rl   f_flintr   rk   facexpr   r   r   s
   &&        rr   dup_zz_factorr    s6   \ wAddG$(=DEWCJJL2&,WE]7+++A!GD1Aa|a%aAvRx	
a!fX~())%%a&>!QAA$%%$Q*ya# q)Gq"=A Fs   'D6c                   W,          .pV  Fn  p\        V4      p\        V4       F@  pV^8w  d   VP                  We4      pWV,          pK"  VP                  V4      '       g   K>    R# 	  VP	                  V4       Kp  	  VR,          # )z,Wang/EEZ: Compute a set of valid divisors.  Nr   )r   reversedgcdr   ri   )Ecsctrl   rm   rp   rq   s   &&&&   rr   dmp_zz_wang_non_divisorsr    sr    uYFF&!Aq&EE!KFxx{{ " 	a  ":rt   c           
        \        \        W4      W4^,
          V4      '       g   \        R4      h\        WWE4      p\        We4      '       g   \        R4      h\	        We4      w  rxVP                  \        W4      4      '       d   V) \        W4      rV^,
          p	V U
Uu. uF  w  r\        WW4      NK  	  pp
p\        WW%4      pVe   WxV3# \        R4      hu upp
i )z2Wang/EEZ: Test evaluation points for suitability. zno luck)	rJ   r   r_   rS   rH   r   r   r'   r  )rj   r   r
  r   rv   rl   r   r   r   vr   r   r  Ds   &&&&&&        rr   dmp_zz_wang_test_pointsr    s    qa%33y))aA!AQ??y))DA}}VA\""r71=1	AA013-a
#A3 r-A}Qwy)) 	4s   Cc                p   . ^ .\        V4      ,          V^,
          rpV F  p\        W4      p\        W4      V,          p\        \	        \        V4      4      4       Fa  p^ W>,          W,          uppw  ppVV,          '       g   VV,          V^,           rK"  V^ 8w  g   KD  \        V\        VWV4      W4      ^uqV&   Kc  	  VP                  V4       K  	  \        V	4      '       g   \        h. . pp\        W4       F  w  r\        WW4      p\        W4      pVP                  V4      '       d   VV,          pM7VP                  VV4      pVV,          VV,          pp\        WV4      W-,          r+\        VVW4      pVP                  V4       VP                  V4       K  	  VP                  V4      '       d   V VV3# . . pp\        VV4       F<  w  rVP                  \        WW4      4       VP                  \        W^ V4      4       K>  	  \        W\        V4      ^,
          ,          Wg4      p V VV3# )z0Wang/EEZ: Compute correct leading coefficients. )r   r   r   r  r   r.   r0   ri   allr\   ziprJ   r   r  r=   r>   )rj   r   r	  r  r   r   rv   rl   r   Jr  r   r   r   r   ro   r   r   r   CCHHr   ccr   CCCHHHs   &&&&&&&&                  rr   dmp_zz_wang_lead_coeffsr    s   1#c!f*a!e!AAM1LO%A-(AadADLAq&1a1uu!tQU1Av!!WQa%8!?Q4 ) 	
  q66BA	!%A\88B<<QBb!AqD"a%rA"1+RUr1b!'
		!
		!   	xx||"by2CB

>!./

>!A./  	qs1vz*A1Ac3;rt   c           
         \        V 4      ^8X  dx   V w  rE\        WB4      p\        WR4      p\        WvW#4      w  rp
\        WV4      p\        WV4      p	\	        WW#4      w  r\        WWrV4      p	\        W4      p\        W4      p	W.pV# V R,          .p
\        V ^R 4       F&  pV
P                  ^ \        Wj^ ,          V4      4       K(  	  . ^..r\        W
4       FB  w  rg\        Wv.VR,          . ^ V^V4      w  rVP                  V	4       VP                  V4       KD  	  . WR,          .,           r\        W4       FN  w  r\        W4      p\        Wb4      p\        \        WV4      WbV4      p\        W4      pVP                  V4       KP  	  V# )z2Wang/EEZ: Solve univariate Diophantine equations. r   )r   r   r   r   r	   r   r   r  r   r-   r  dmp_zz_diophantineri   r
   )r   r   r   rl   r   r   rj   r   r   r   r   rp   rm   r   r   rq   s   &&&&            rr   dup_zz_diophantiner  7  s   
1v{Q"Q"1&aaAaAaA!qQ1%1 1 2 M/ rUG!Ab'"AHHQQ4+, # QC51IDA%qfaeRAq!DDAHHQKHHQK 
 rUGIDA &A &Ayq)13Aq$AMM!  Mrt   c           
        V'       g   V  Uu. uF  p. NK  	  pp\        V4      p	\        V4       Ff  w  rV'       g   K  \        W	V
,
          WF4      p\        \        W4      4       F,  w  pw  r\	        WV4      p\        \        WV4      WF4      W&   K.  	  Kh  	  V# \        V4      p	\        WV4      pVR,          VRR pp. . ppV  F<  pVP                  \        VVWV4      4       VP                  \        VVWV4      4       K>  	  \        VVWV4      pV^,
          p\        VVW#VVV4      pV Uu. uF  p\        V^VV4      NK  	  pp\        VV4       F  w  pp\        WVWV4      pK  	  \        WWV4      p\!        VP"                  V) .W4      p\%        W4      p\'        ^ V4       EF  p\)        W4      '       d    EM\+        VVWV4      p\-        VV^,           VWV4      p\)        VV4      '       d   KO  \/        VVP1                  V! V4      ^,           4      VV4      p\        VVW#VVV4      p\        V4       F   w  r\+        \        V^VV4      VWV4      W&   K"  	  \        \        W4      4       F  w  p
w  r\3        WWV4      W&   K  	  \        VV4       F  w  pp\        WVWV4      pK  	  \        WWV4      pEK  	  V Uu. uF  p\        WWV4      NK  	  ppV# u upi u upi u upi )z4Wang/EEZ: Solve multivariate Diophantine equations. Nr   )r   	enumerater  r  r=   rC   r)   r   r5   ri   r4   rK   r  r   r8   rD   r   r   r   r   r   r.   rL   r@   	factorialr*   )r   r   r   r   r   rv   rl   r   r   r   r   r   r   jr   r   r   r   r   r   rj   r   r  r   r   r   ro   s   &&&&&&&                    rr   r  r  g  s   !Qb!qM!!HA"1!eQ2A&s1y1	6A"1Q/ q!118 2 %v Hc FqQuaf121AHHWQ1()HH[AqQ/0  1aA&Eq!Q1a3-.0Qi1a#Q01IDAqA!Q*A  Q1(aeeaR[!'AMq!A!1a#A AE1aA6Aa##"1akk!A$(&;QB&q!Q1a;%aLDA"9Q1a#8!QBAD ) "+3q9!5IAv"1.AD "6  1IDAq#A!Q2A & %Q10) , 567AqqQ*A7H} 8 1@ 8s   K!2K&K+c                   V .\        V4      V^,
          rp\        V4      p\        \        VR,          4      4       FJ  w  r\	        V^ ,          WV
,
          WZ,
          V4      pVP                  ^ \        WW,
          V4      4       KL  	  \        \        W4      R,          4      p\        \        ^V^,           4      Ws4       EF  w  rp\        V4      V^,
          ppVRV^,
           W>^,
          R pp\        \        W4      4       FO  w  p
w  pp\        \        VVW4      VV^,
          V4      pV.\        VR,          ^V^,
          V4      ,           W&   KQ  	  \        VP                  V) .VV4      p\        VV4      p\!        V\#        VVV4      VV4      p\%        VVV4      p\        ^ V4       EF  p\'        VV4      '       d    EK  \)        VVVV4      p\+        VV^,           VVVV4      p\'        VV^,
          4      '       d   KZ  \-        VVP/                  V! V4      ^,           4      V^,
          V4      p\1        VVVWV^,
          V4      p\        \        VV4      4       F;  w  p
w  pp\3        V\        V^V^,
          V4      VVV4      p\        VVVV4      W&   K=  	  \!        V\#        VVV4      VV4      p\        VVVV4      pEK   	  EK  	  \#        WV4      V 8w  d   \4        hV# )z-Wang/EEZ: Parallel Hensel lifting algorithm. r   N)r   listr  r  rK   r   rD   maxr   r  r   rJ   r   r   r   r   r,   r5   r   r   r.   rL   r@   r  r  r6   r\   )rj   r   LCr   r   rv   rl   r   r   r  r   r   r   r   r   r   wIr  r   r   r   r   r   djro   r   r   r   s   &&&&&&&                      rr   dmp_zz_wang_hensel_liftingr(    s   c3q61q5!AQA(1R5/*!aQq1	$Q15!45 + 	OA!"%&AuQA-aAwA1!a%y!EF)1#CJ/JAw2!-Aq"<aQJB4)AbE1a!eQ77AD 0 aeeaR[!Q'AqMAz!Q*Aq11a#q"A!Q1a#A AE1aA6AaQ''"1akk!A$(&;QUAF&q!Qa!eQ?!*3q!9!5IAv1#AyAq1ua'@!QJA+Aq!Q7AD "6 Az!Q2Aq9$Q1a0! ! .D !art   c           
     "   ^ RI Hp \        V4      p\        \	        W4      V^,
          V4      w  rx\        WV4      p	V! V! V	4      4      p
Vf   V^8X  d   ^pM^p\        4       . VP                  .V,          R3w  rr \        WW}W4      w  ppp\        VV4      w  pp\        V4      pV^8X  d   V .# VVVVV3.p\        R4      p\        R4      p\        R4      p\        V4      V8  d   \        V4       F  p\        V4       Uu. uF  pV! V! V) V4      4      NK  	  pp\        V4      V9  d   VP                  \        V4      4       MKX   \        WW}W4      w  ppp\        TT4      w  pp\        T4      pTe   TT8w  d   TT8  d   . TrMK  MTpT^8X  d   T .u # TP!                  TTTTT34       \        T4      T8X  g   K   K  	  VV,          pK  R^ ^ pppV F0  w  p   p\#        VV4      pVe   VV8  d   TpTpMTpV^,          pK2  	  VV,          w  pppppT p \%        WVVVWV4      w  p pp\'        V VVWW4      p. pT FP  p \-        YT4      w  pp TP/                  \1        YT4      4      '       d   \3        YT4      p TP!                  T 4       KR  	  T#   \         d     ELi ; iu upi   \         d     EK  i ; i  \(         d4    \        R4      '       d   \+        TYT^,           4      u # \)        R4      hi ; i)a  
Factor primitive square-free polynomials in `Z[X]`.

Given a multivariate polynomial `f` in `Z[x_1,...,x_n]`, which is
primitive and square-free in `x_1`, computes factorization of `f` into
irreducibles over integers.

The procedure is based on Wang's Enhanced Extended Zassenhaus
algorithm. The algorithm works by viewing `f` as a univariate polynomial
in `Z[x_2,...,x_n][x_1]`, for which an evaluation mapping is computed::

                  x_2 -> a_2, ..., x_n -> a_n

where `a_i`, for `i = 2, \dots, n`, are carefully chosen integers.  The
mapping is used to transform `f` into a univariate polynomial in `Z[x_1]`,
which can be factored efficiently using Zassenhaus algorithm. The last
step is to lift univariate factors to obtain true multivariate
factors. For this purpose a parallel Hensel lifting procedure is used.

The parameter ``seed`` is passed to _randint and can be used to seed randint
(when an integer) or (for testing purposes) can be a sequence of numbers.

References
==========

.. [1] [Wang78]_
.. [2] [Geddes92]_

)	nextprimeNEEZ_NUMBER_OF_CONFIGSEEZ_NUMBER_OF_TRIESEEZ_MODULUS_STEPEEZ_RESTART_IF_NEEDEDz3we need to restart algorithm with better parameters)r   r*  r   dmp_zz_factorr   r   r   zeror  r   r   r_   r[   r   tupleaddri   r:   r  r(  r\   dmp_zz_wangrI   r   r   r(   ) rj   rv   rl   modseedr*  randintr
  r   r   r   historyconfigsr   rq   r	  r   r  r   r   eez_num_configseez_num_trieseez_mod_steprrs_norms_argr   _s_normorig_fr$  rk   rm   s    &&&&&                           rr   r3  r3    sR   < (tnG&,Aq1EBaA&A	)A,A
{6CC UB
D8Ga*1=Aq A&1F63Jr1a#$ 34O/0M+,L
g,
(}%A16q;A!GSD#&'A;Qxw&E!H%21EAq %Q*DAqQB}7Av%' 	  Avs
NNAr1a+,7|.A &D <CQ1EF 1aAq!$ F	Q ! U^NAr1aFG*1Q1C1b,Q2qQB F#A!,1==qQ/00a Aa  Mc   < $ \  G())vqS1W55#EG G	GsB   ?4J& 4J& J8J=)#K &J54J5=KK0LLc                   V'       g   \        W4      # \        W4      '       d   VP                  . 3# \        WV4      w  r4\	        WAV4      ^ 8  d   V) \        WAV4      rC\        ;QJ d%    R \        WA4       4       F  '       d   K   RM	  RM! R \        WA4       4       4      '       d   V. 3# \        WAV4      w  rT. p\        WA4      ^ 8  d%   \        WAV4      p\        WAV4      p\        WW4      p\        WQ^,
          V4      ^,           F  w  rHVP                  ^ V.V34       K  	  \        WV4       V\!        V4      3# )a  
Factor (non square-free) polynomials in `Z[X]`.

Given a multivariate polynomial `f` in `Z[x]` computes its complete
factorization `f_1, \dots, f_n` into irreducibles over integers::

             f = content(f) f_1**k_1 ... f_n**k_n

The factorization is computed by reducing the input polynomial
into a primitive square-free polynomial and factoring it using
Enhanced Extended Zassenhaus (EEZ) algorithm. Trial division
is used to recover the multiplicities of factors.

The result is returned as a tuple consisting of::

         (content(f), [(f_1, k_1), ..., (f_n, k_n))

Consider polynomial `f = 2*(x**2 - y**2)`::

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

    >>> R.dmp_zz_factor(2*x**2 - 2*y**2)
    (2, [(x - y, 1), (x + y, 1)])

In result we got the following factorization::

                f = 2 (x - y) (x + y)

References
==========

.. [1] [Gathen99]_

c              3   *   "   T F	  q^ 8*  x  K  	  R# 5ir   Nr|   r~   r   s   & rr   r    dmp_zz_factor.<locals>.<genexpr>       
10a60   FT)r  r   r0  rI   r   r(   r  r   rP   r   rW   r3  rw   r/  r   rY   rZ   )	rj   rv   rl   r   r   r   rk   r   ro   s	   &&&      rr   r/  r/  m  s    H Q""!vvrz"1+GDQ1!%q)a
s
1?10
1sss
1?10
111Rxq!DAG!!q!a $Q10aQ*1--qA3(# . qW%w'''rt   c           	         VP                  4       p\        WV4      p \        W4      w  r4V UUu. uF  w  rV\        WRV4      V3NK  	  pppVP                  W24      pW43# u uppi )z>Factor univariate polynomials into irreducibles in `QQ_I[x]`. )as_AlgebraicFieldr   r   r   )rj   r   K1r   rk   r  r   s   &&     rr   dup_qq_i_factorrK    sh     
			BA2A$Q+NE;BC7CR(!,7GCJJu!E> Ds   Ac                F   VP                  4       p\        WV4      p \        W4      w  r4. pV F[  w  rg\        Wb4      w  r\        WV4      p
\	        V
^ V4      w  rW;V,          ,          W,          ,          pVP                  W34       K]  	  TpVP                  W24      pW43# )z>Factor univariate polynomials into irreducibles in `ZZ_I[x]`. )	get_fieldr   rK  rA   rI   ri   r   )rj   r   rJ  r   rk   new_factorsr  r   	fac_denomfac_numfac_num_ZZ_Icontentfac_prims   &&           rr   dup_zz_i_factorrT    s     
BA2A$Q+NEK-c6	"730q"EA%).8H=)  GJJu!E>rt   c           
         VP                  4       p\        WW#4      p \        WV4      w  rEV UUu. uF  w  rg\        WaW24      V3NK  	  pppVP                  WC4      pWE3# u uppi )z@Factor multivariate polynomials into irreducibles in `QQ_I[X]`. )rI  r   dmp_factor_listr   )rj   rv   r   rJ  r   rk   r  r   s   &&&     rr   dmp_qq_i_factorrW    sj     
			BA"!A$Q2.NE>EFgFCCB+Q/gGFJJu!E> Gs   A c                H   VP                  4       p\        WW#4      p \        WV4      w  rE. pV F[  w  rx\        WqV4      w  r\        WW24      p\	        WV4      w  rWLV,          ,          W,          ,          pVP                  W34       K]  	  TpVP                  WC4      pWE3# )z@Factor multivariate polynomials into irreducibles in `ZZ_I[X]`. )rM  r   rW  rB   rI   ri   r   )rj   rv   r   rJ  r   rk   rN  r  r   rO  rP  rQ  rR  rS  s   &&&           rr   dmp_zz_i_factorrY    s     
BA"!A$Q2.NEK-cb9	"7r60"EA%).8H=)  GJJu!E>rt   c                   \        V 4      \        W4      r2\        W4      p V^ 8:  d   V. 3# V^8X  d   W0^3.3# \        W4      T r@\	        W4      w  rVp\        WqP                  4      p\        V4      ^8X  d   W0V\        V 4      ,          3.3# WQP                  ,          p	\        V4       F=  w  p
w  r\        WP                  V4      p\        WV4      w  rp\        WV4      pWV
&   K?  	  \        WHV4      p\        WH4       W83# )a  Factor univariate polynomials over algebraic number fields.

The domain `K` must be an algebraic number field `k(a)` (see :ref:`QQ(a)`).

Examples
========

First define the algebraic number field `K = \mathbb{Q}(\sqrt{2})`:

>>> from sympy import QQ, sqrt
>>> from sympy.polys.factortools import dup_ext_factor
>>> K = QQ.algebraic_field(sqrt(2))

We can now factorise the polynomial `x^2 - 2` over `K`:

>>> p = [K(1), K(0), K(-2)] # x^2 - 2
>>> p1 = [K(1), -K.unit]    # x - sqrt(2)
>>> p2 = [K(1), +K.unit]    # x + sqrt(2)
>>> dup_ext_factor(p, K) == (K.one, [(p1, 1), (p2, 1)])
True

Usually this would be done at a higher level:

>>> from sympy import factor
>>> from sympy.abc import x
>>> factor(x**2 - 2, extension=sqrt(2))
(x - sqrt(2))*(x + sqrt(2))

Explanation
===========

Uses Trager's algorithm. In particular this function is algorithm
``alg_factor`` from [Trager76]_.

If `f` is a polynomial in `k(a)[x]` then its norm `g(x)` is a polynomial in
`k[x]`. If `g(x)` is square-free and has irreducible factors `g_1(x)`,
`g_2(x)`, `\cdots` then the irreducible factors of `f` in `k(a)[x]` are
given by `f_i(x) = \gcd(f(x), g_i(x))` where the GCD is computed in
`k(a)[x]`.

The first step in Trager's algorithm is to find an integer shift `s` so
that `f(x-sa)` has square-free norm. Then the norm is factorized in `k[x]`
and the GCD of (shifted) `f` with each factor gives the shifted factors of
`f`. At the end the shift is undone to recover the unshifted factors of `f`
in `k(a)[x]`.

The algorithm reduces the problem of factorization in `k(a)[x]` to
factorization in `k[x]` with the main additional steps being to compute the
norm (a resultant calculation in `k[x,y]`) and some polynomial GCDs in
`k(a)[x]`.

In practice in SymPy the base field `k` will be the rationals :ref:`QQ` and
this function factorizes a polynomial with coefficients in an algebraic
number field  like `\mathbb{Q}(\sqrt{2})`.

See Also
========

dmp_ext_factor:
    Analogous function for multivariate polynomials over ``k(a)``.
dup_sqf_norm:
    Subroutine ``sqfr_norm`` also from [Trager76]_.
sympy.polys.polytools.factor:
    The high-level function that ultimately uses this function as needed.
)r   r   rF   rV   rT   dup_factor_list_includedomr   unitr  r   rQ   rM   rs   rX   )rj   rl   r   r   r   r   r   rq   rk   r   r   rn   r   r   s   &&            rr   dup_ext_factorr^    s   D qM6!<r!AAv2vAvF8|qq1 GA!%a/G
7|q:a=()***	&&A#G,;Fq)a(aaA
	 - !Q/Gq";rt   c                   V'       g   \        W4      # \        WV4      p\        WV4      p \        ;QJ d%    R \	        W4       4       F  '       d   K   RM	  RM! R \	        W4       4       4      '       d   V. 3# \        WV4      T r@\        WV4      w  rVp\        WqVP                  4      p\        V4      ^8X  d   V .pMn\        V4       F_  w  p	w  r\        WVP                  V4      p\        WW4      w  rpV Uu. uF  qVP                  ,          NK  	  pp\        WW4      pWV	&   Ka  	  \        WHW4      p\!        WAV4       W?3# u upi )a.  Factor multivariate polynomials over algebraic number fields.

The domain `K` must be an algebraic number field `k(a)` (see :ref:`QQ(a)`).

Examples
========

First define the algebraic number field `K = \mathbb{Q}(\sqrt{2})`:

>>> from sympy import QQ, sqrt
>>> from sympy.polys.factortools import dmp_ext_factor
>>> K = QQ.algebraic_field(sqrt(2))

We can now factorise the polynomial `x^2 y^2 - 2` over `K`:

>>> p = [[K(1),K(0),K(0)], [], [K(-2)]] # x**2*y**2 - 2
>>> p1 = [[K(1),K(0)], [-K.unit]]       # x*y - sqrt(2)
>>> p2 = [[K(1),K(0)], [+K.unit]]       # x*y + sqrt(2)
>>> dmp_ext_factor(p, 1, K) == (K.one, [(p1, 1), (p2, 1)])
True

Usually this would be done at a higher level:

>>> from sympy import factor
>>> from sympy.abc import x, y
>>> factor(x**2*y**2 - 2, extension=sqrt(2))
(x*y - sqrt(2))*(x*y + sqrt(2))

Explanation
===========

This is Trager's algorithm for multivariate polynomials. In particular this
function is algorithm ``alg_factor`` from [Trager76]_.

See :func:`dup_ext_factor` for explanation.

See Also
========

dup_ext_factor:
    Analogous function for univariate polynomials over ``k(a)``.
dmp_sqf_norm:
    Multivariate version of subroutine ``sqfr_norm`` also from [Trager76]_.
sympy.polys.polytools.factor:
    The high-level function that ultimately uses this function as needed.
c              3   *   "   T F	  q^ 8*  x  K  	  R# 5irC  r|   rD  s   & rr   r   !dmp_ext_factor.<locals>.<genexpr>  rF  rG  FT)r^  r   rG   r  r   rW   rU   dmp_factor_list_includer\  r   r  r   rR   r]  rN   rw   rY   )rj   rv   rl   r   r   r   r   rq   rk   r   rn   r   r   sir   rm   s   &&&             rr   dmp_ext_factorrd  T  s+   ^ a##	qQ	Bq!A
s
1?10
1sss
1?10
1112va !q1#GA!%aAEE2G
7|q#'0NA{Fquua0A#A!/GA!%&'QrAFFQA'!%AAJ 1  A1FqV$: (s   ?Ec                   \        WVP                  4      p \        WP                  VP                  4      w  r#\	        V4       F"  w  pw  r\        WP                  V4      V3W4&   K$  	  VP                  W!P                  4      V3# )z2Factor univariate polynomials over finite fields. )r   r\  r   r4  r  r   )rj   rl   r   rk   r   ro   s   &&    rr   dup_gf_factorrf    sn    A!%% Aq%%/NEw'	6A!!UUA.2
 ( 99UEE"G++rt   c                    \        R4      h)z4Factor multivariate polynomials over finite fields. z+multivariate polynomials over finite fields)NotImplementedError)rj   rv   rl   s   &&&rr   dmp_gf_factorri    s    
K
LLrt   c                   \        W4      w  r \        W4      w  r0VP                  '       d   \        W4      w  rEEMWVP                  '       d   \        W4      w  rEEM6VP                  '       d   \        W4      w  rEEMVP                  '       d   \        W4      w  rEEMVP                  '       g   YP                  4       r\        WV4      p MRpVP                  '       d,   VP                  4       p\        WV4      w  r\        WV4      p MTpVP                   '       d   \#        W4      w  rEMVP$                  '       dk   \'        V ^ V4      w  r	\)        W	VP*                  4      w  rE\-        V4       F  w  p
w  r\/        W	V4      V3WZ&   K  	  VP1                  WGP*                  4      pM\3        RV,          4      hVP                  '       d   \-        V4       F  w  p
w  r\        WV4      V3WZ&   K  	  VP1                  WG4      pVP5                  VX4      pV'       ds   \-        V4       FP  w  p
w  r\7        W4      p\9        WV4      p \        WV4      p W3WZ&   VP;                  WAP=                  W4      4      pKR  	  VP1                  WA4      pTpV'       d+   VP?                  ^ VP@                  VPB                  .V34       WC,          \E        V4      3# );Factor univariate polynomials into irreducibles in `K[x]`. N#factorization not supported over %s)#r%   rH   is_FiniteFieldrf  is_Algebraicr^  is_GaussianRingrT  is_GaussianFieldrK  is_Exact	get_exactr   is_Fieldr   rA   r   r  is_Polyr#   rV  r\  r  r$   r   r]   quor:   r?   mulpowr   r   r0  rZ   )rj   r   r   r   r   rk   
K0_inexactrl   denomrv   r   ro   max_norms   &&           rr   r   r     s]   DAA"GD	&q-w	'.w				(/w				(/w{{{A2.AJ;;;A'q1HEA1%AA777*10NE7YYYaA&DA,Q1559NE&w/	6A'a0!4
 0 IIeUU+ECbHII;;;&w/	6A)!3Q7
 0 JJu(EFF5%(E!*7!3IAv+A2H&qB7A#A:6A"#GJFF5&&*=>E "4 #**55qBFFBGG,a01:}W---rt   c                    \        W4      w  r#V'       g   \        V.4      ^3.# \        V^ ,          ^ ,          W!4      pWC^ ,          ^,          3.VR,          ,           # )rk  r   )r   r   r=   )rj   rl   r   rk   r   s   &&   rr   r[  r[    sW    $Q*NEE7#Q'((71:a=%3AJqM"#gbk11rt   c           	        V'       g   \        W4      # \        WV4      w  r0\        WV4      w  r@VP                  '       d   \	        WV4      w  rVEMVP
                  '       d   \        WV4      w  rVEMoVP                  '       d   \        WV4      w  rVEMMVP                  '       d   \        WV4      w  rVEM+VP                  '       g   Y"P                  4       r'\        WWr4      p MRpVP                  '       d,   VP                  4       p\!        WW(4      w  r\        WW(4      p MTpVP"                  '       dF   \%        WV4      w  rp\'        WV4      w  rV\)        V4       F  w  pw  r\+        W
W4      V3Wl&   K  	  MVP,                  '       dj   \/        WV4      w  r\1        WVP2                  4      w  rV\)        V4       F  w  pw  r\5        WV4      V3Wl&   K  	  VP7                  WXP2                  4      pM\9        RV,          4      hVP                  '       d   \)        V4       F  w  pw  r\        WW4      V3Wl&   K  	  VP7                  WX4      pVP;                  VX	4      pV'       dt   \)        V4       FQ  w  pw  r\=        WV4      p\?        WW4      p \        WW'4      p W3Wl&   VPA                  WRPC                  W4      4      pKS  	  VP7                  WR4      pTp\)        \E        V4      4       F]  w  rV'       g   K  RW,
          ,          R,           RV,          ,           VPF                  /pVPI                  ^ \K        VW4      V34       K_  	  WT,          \M        V4      3# )=Factor multivariate polynomials into irreducibles in `K[X]`. Nrl  )r   r   )'r   r&   rI   rm  ri  rn  rd  ro  rY  rp  rW  rq  rr  r   rs  r   rB   r   r!   r/  r  r"   rt  r#   rV  r\  r$   r   r]   ru  r;   r@   rv  rw  r  r   r   r   rZ   )rj   rv   r   r  r   r   rk   rx  rl   ry  levelsr  r   ro   rz  r   terms   &&&              rr   rV  rV     s   q%%r"DA"1,GD	&qR0w	'b1w				(r2w				(r2w{{{A*1AJ;;;A'b4HEA"(AA777&qQ/LFq*13NE&w/	6A)!Q:A>
 0YYYaA&DA,Q1559NE&w/	6A'a0!4
 0 IIeUU+ECbHII;;;&w/	6A)!6:
 0 JJu(EFF5%(E!*7!3IAv+A"5H&qA:A#A"9A"#GJFF5&&*=>E "4 #**55(1+&aet#d1f,bff5q=q5q9: ' :}W---rt   c                    V'       g   \        W4      # \        WV4      w  r4V'       g   \        W14      ^3.# \        V^ ,          ^ ,          W1V4      pWT^ ,          ^,          3.VR,          ,           # )r}  r   )r[  rV  r   r>   )rj   rv   rl   r   rk   r   s   &&&   rr   rb  rb  M  sg    &q,,$Q1-NEE%q)**71:a=%A6AJqM"#gbk11rt   c                    \        V ^ V4      # )zS
Returns ``True`` if a univariate polynomial ``f`` has no factors
over its domain.
)dmp_irreducible_p)rj   rl   s   &&rr   dup_irreducible_pr  [  s    
 Q1%%rt   c                v    \        WV4      w  r4V'       g   R# \        V4      ^8  d   R# V^ ,          w  r5V^8H  # )zU
Returns ``True`` if a multivariate polynomial ``f`` has no factors
over its domain.
TF)rV  r   )rj   rv   rl   r   rk   ro   s   &&&   rr   r  r  c  s;    
 !q)JA	W	qzAvrt   )F)NN)__doc__sympy.external.gmpyr   sympy.core.randomr   sympy.polys.galoistoolsr   r   r   r   r   r	   r
   r   r   r   r   sympy.polys.densebasicr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   sympy.polys.densearithr'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   sympy.polys.densetoolsrA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   sympy.polys.euclidtoolsrP   rQ   rR   sympy.polys.sqfreetoolsrS   rT   rU   rV   rW   rX   rY   sympy.polys.polyutilsrZ   sympy.polys.polyconfigr[   sympy.polys.polyerrorsr\   r]   r^   r_   sympy.utilitiesr`   mathra   r   rb   r   rc   r   rd   re   rs   rw   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r(  r3  r/  rK  rT  rW  rY  r^  rd  rf  ri  r   r[  rV  rb  r  r  r|   rt   rr   <module>r     s   @ , &   " " " " " " ""$ $ $ $ $ $ $$& & & & &" "   0 (F F $ : : 7I!8!8:x%6r75rfR Pf	 )X8:Qh(*43l-`AH1hK\@(F,,_DK\	,M
?.D2J.Z2&rt   