+
    ir                        ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHtH	t	 ^ RI
Ht ^ RIHt ^ RIHtHt ^ RIHtHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIH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-H.t.H/t/H0t0H1t1H2t2 ]! R4      t3]! R4      t4R t5R t6R t7R t8R t9R t:R t;R t<R t=R t>R t?R t@R tAR  tBR! tCR" tDR# tER$ tFR% tGR& tH]!R' 4       tIR(# ))    )randint)Function)Mul)IRationaloo)Eq)S)Dummysymbols)explog)tanh)sqrt)sin)Poly)ratsimp)checkodesol)slow)riccati_normalriccati_inverse_normalriccati_reducedmatch_riccatiinverse_transform_polylimit_at_infcheck_necessary_conds
val_at_infconstruct_c_case_1construct_c_case_2construct_c_case_3construct_d_case_4construct_d_case_5construct_d_case_6rational_laurent_seriessolve_riccatifxc                 D    \        \        V ) V 4      \        ^V 4      4      #    )r   r   )maxints   &b/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/solvers/ode/tests/test_riccati.pyrand_rationalr-      s    GVGV,ga.@AA    c                 v    \        \        V^,           4       Uu. uF  p\        V4      NK  	  upV 4      # u upi r)   )r   ranger-   )r'   degreer+   _s   &&& r,   	rand_polyr3   !   s.    fQh@1v&@!DD@s   6c                     \        ^V4      p\        ^V4      p\        WV4      p\        WV4      pV\        ^ V 4      8X  d   \        WV4      pK  WV,          # r)   )r   r3   r   )r'   r1   r+   degnumdegdennumdens   &&&    r,   rand_rational_functionr9   %   sT    QFQF
Av
&C
Av
&C
a
6*9r.   c                    T pVP                  V4      p\        V^^4      p\        V^^4      pV^ 8X  d   \        V^^4      pK  \        WEV,          ,
          Wc^,          ,          ,
          4      p\        VP                  4       WuV,          ,           Wb^,          ,          ,           4      p\        W#4      p	\	        W4      R8X  g   Q hWWV3# )r*   )Tr   )diffr9   r   r	   r   )
ratfuncr'   yfyypq1q2q0eqsols
   &&&       r,   find_riccati_oderE   /   s    A	
B	1a	(B	1a	(B
'#Aq!,	dR1W$	%B	BGGIrrEzB1uH,	-B
R)Cr9,,,2>r.   c                 D   \         \         ^,
          ,          \         ^,          ^,           ^,          \         ,          \         \         ^,          ) \         ^,
          ,          \         \         ^,          ^,          \        ^4      ^,          ,           ,          ^,          ,
          ^^\         ,          ,          ,
          3^\         ,          ^,           ^\         ,          ^,           ,          ^^\         ,          ,
          \         ^,           ,          ^\         ,          R\         ,          ^\         ,          ^,           ,          ^\         ,          ^,           ,          ^^\         ,          ,
          \        ^\         ^,           RR7      ,          ,
          ^^\         ,          ,          ,
          3R^\         ^,          ,          ^,
          ,          ^ ^\         ,
          ^\         ,          ^,
          ,          ^\         ,
          ^\         ,          ^,
          ^\         ^,          ,          ^,
          ,          ,          ^\         ,          ^,
          \        R^\         ,
          RR7      ^\         ,          ^,
          ^,          ,          ^^\         ,          ^,
          ,          ,
          ,          \        ^^\         ,
          RR7      ,          ,
          3\         ^\         ,          ^,
          ^\         ,          ^	,           ,          \         ^,          ^\         ,          ^	,
          ,          \         ^,          ) ^\         ,          ^	,
          ,          ^\         ,          ^,
          \        ^^\         ,          ^	,           RR7      ,          ,
          ^\         ,          ^	,
          R\         ^,          ,          ^\         ,          ^	,
          ^,          ,          ^\         ^,          ,          ^\         ,          ^	,
          ,          ,           ,          ^\         ^,          ,          ,          ,
          3.p V  FD  w  rr4V\        V\         W#4      8X  g   Q hV\	        V\         W#4      P                  4       8X  d   KD  Q h	  R\         ,          ^,
          ^\         ^,          ,          ^\         ,          ,           ^,
          ,          R\         ,          \         ) ^,
          ^\         ,          ,          ^\         ^,          ,          ^^\         ,          ,          \         ) ^,
          ^\         ^,          ,          ,          ,           ,          \         ) ^,
          ^,          ,          ^\         ) ^,
          ,          ,           R\         ,          R^\         ,          ,          \         ) ^,
          ^\         ^,          ,          ,          ,
          ,          \         ) ^,
          ,          R\         ,          ^,
          \         ) ^,
          ,          ^\         ,          ^\         ^,          ,          ^\         ,          ,           ^,
          ,          ,          ,
          ^\         ,          ,           3^^\         ^,          ,          ,          R\         ,          \         ) ^,
          ^\         ,          ,          ^\         ^,          ,          ^^\         ,          ,          \         ) ^,
          ^\         ^,          ,          ,          ,           ,          \         ) ^,
          ^,          ,          ^\         ) ^,
          ,          ,           R\         ,          R^\         ,          ,          \         ) ^,
          ^\         ^,          ,          ,          ,
          ,          \         ) ^,
          ,          ^\         ,          ,           \        ^\         ) ^,
          RR7      ^\         ^,          ,          ,          ,
          3.p V  FF  w  rr5pV\        V\         W#4      8X  g   Q hV\	        V\         W#V4      P                  4       8X  d   KF  Q h	  R# )	aN  
This function tests the transformation of the
solution of a Riccati ODE to the solution of
its corresponding normal Riccati ODE.

Each test case 4 values -

1. w - The solution to be transformed
2. b1 - The coefficient of f(x) in the ODE.
3. b2 - The coefficient of f(x)**2 in the ODE.
4. y - The solution to the normal Riccati ODE.
FevaluateN)r'   r
   r   r   r   cancel)testswb1b2r>   bps         r,   test_riccati_transformationrT   ?   sB    	
1q5		
A1Q		
Aq1u1a46AaDF?+A--1Q37	 
1q1Q37	
QqS1q5	!
1acAg!a A!Gc!QUU.K#LLqRSTURUwV	 	AadFQJ		
Q1q	
Q!A#'AadFQJ'(AaC!Gc"a!ee6TVWXYVY	W
V 71Q377 ,!!QUU;,= 	=	 	
	
1rBqD1H	1acAg	
AqsQw1Q38c!RTAX&FGG1Q3QR7UWXY[\X\U\^_`a^a
_^ VAqD&!A#'"V# K$%&q!tVK- 	-	)E6 rN1a0000*1a8??AAAA  
AAadFQqSL1$%
1
a!A#	!Q$1Q3A26AadF++,qb1fq[81qb1f:E
1b!A#h1"q&1QT6**+aR!V41qA267JAaCQRSTVWSWQWZ[\]Z]Q]
R M 8 	!	 	
1QT6

1
a!A#	!Q$1Q3A26AadF++,qb1fq[81qb1f:E
1b!A#h1"q&1QT6**+aR!V4qs:SQBFUZ=[]^_`bc_c]c=ddE  "rqN1a0000*1a<CCEEEE "r.   c                 l   \        \        4      P                  \        4      \        ^,          ,
          \        \        \        4      ,          ,
          \        \        \        4      ^,          ,          ,
          \        \        4      P                  \        4      \        \        4      ^,          ,           \        ^,          ,           \        ^,          ^,          ,
          ^^\        ^,          ,          ,          ,
          3^\        ,          ^\        ,          ^	,           ,          \        \        4      P                  \        4      ,           \        ^,           \        \        4      ^,          ,          \        ,          ,
          R\        ^,          ,          ^\        ,          \        ) ^,
          \        ^,          ,          ,           ^,          ,          ^\        ) ^,
          ^,          ,          ,          \        ^\        ) ^,
          RR7      ^\        ,          ^	,           ,          ,           \        \        4      ^,          ,           \        \        4      P                  \        4      ,           R\        ^,           \        ,          ,           \        \        ) ^,
          ,          ,          ,
          3\        \        4      ^,          \        \        4      P                  \        4      ,           \        ^,
          \        \        4      ,          \        ) \	        ^4      ^,          ,
          ,          ,
          ^\        ,          ^,
          ^,          ) ^^\        ,          ^,           ^,          ,          ,          ^\        ,          ^,
          ^\        ,          ^,           ^,          ,          ,           \        \        4      ^,          ,           \        \        4      P                  \        4      ,           ^^\        ,          ^,           ,          ,
          3\        \        4      P                  \        4      \        \        4      ^,          \        ,          ,
          \        \        4      ^,          \        \        4      P                  \        4      ,           ^^\        ^,          ,          ,          ,           3R\        ^,          ) \        ,
          ^,           ,          \        ^,          ^\        ,          ,           ^,           ,          \        \        4      P                  \        4      ,           \        \        4      ^,          \        ,          ,           \        \        4      ^,          \        \        4      P                  \        4      ,           ^\        ^,          ,          \        ^,          ^\        ,          ,           ^,           ,          ^\        ,          \        ^,          ^\        ,          ,           ^,           ,          ,           ^\        ^,          ^\        ,          ,           ^,           ,          ,
          \        ,          ,           ^^\        ^,          ,          ,          ,           3^\        ,          ^\        ,          ^	,           ,          \        \        4      P                  \        4      ,           \        ^,           \        \        4      ,          \        ,          ,
          R3\        \        4      \        \        4      P                  \        4      ,          ^\        ,          ,
          \        \        4      ^,          ,           \        \        4      ^,          \        ^,          ^,
          ,          ,           R3.p V  F!  w  rV\        V\         \        4      8X  d   K!  Q h	  R# )z
This function tests the transformation of a
Riccati ODE to its normal Riccati ODE.

Each test case 2 values -

1. eq - A Riccati ODE.
2. normal_eq - The normal Riccati ODE of eq.
FrG   NrJ   )r&   r'   r;   r   r
   r   )rO   rC   	normal_eqs      r,   test_riccati_reducedrX      sJ    	
!		!q!ta!f$q1qy0	!		!qtQwA%1Q.AadF; 	
!QqS1W!		!$AqtQwq'88
1a41Q1}$q((!aR!VaK-83q	
Q< !"1q<* 	*,-aD!G	467diil	CQ	>ArAvJ
'	( 	
!a!A$))A,!a%1rAaDF{!;;
A#'Aq!A#'A~&!A#'AaC!Ga<)??	!a	A$))A,	!"AaC!G	- 	
!		!qtQwqy 	!a!A$))A,AadF+ 	QTEAIMAqD1Q3JN+adiil:QqT1WQYF	!a!A$))A,!AqD&!Q$1*q."9AaCA
A#BB = #1qs
Q'#()*"+ 	+-.!Q$Z	8 	
!QqS1W!		!$Aqt|A~5 	
!QqTYYq\AaC!A$q&(1Q47AqD1H+==G'EP OB15555 r.   c                    \        \        4      P                  \        4      R\        ^,          ,          R\        ^,          ,          ,
          ^N\        ,          ,
          ^\,           ^\        ^,          ,          R\        ^,          ,          ,
          R\        ^,          ,          ,           ^\        ,          ,           ^H,
          ,          ,
          ^,
          \        \        4      ^,          ^\        ,          ^,           ,          ,
          \        ^4      ^,          \        ,
          \        \        4      ,          \        ^4      ^,          ^\        ,          ^,          ,
          ,          ,
          R^-\        ^,          ,          ^\        ^,          ,          ^i\        ^,          ,          ,
          ^^\        ^,          ,          ,           ^\        ,          ,           ^,
          ,          ^b\        ^,          ,          ^\        ^,          ,          ^i\        ^,          ,          ,
          ^^\        ^,          ,          ,           ^\        ,          ,           ^,
          ,          ,
          ^\        ,          ^Q\        ^,          ,          R\        ^,          ,          ,
          R\        ^,          ,          ,           ^<\        ,          ,           ^,
          ,          ,
          ^,           ^\^\        ^,          ,          R\        ^,          ,          ,
          R\        ^,          ,          ,           ^\        ,          ,           ^H,
          ,          ,           \	        R^^\        ,          ,
          RR	7      ^	\        ,          ^,
          ,          ^^\        ,          ^,           ,          3\        \        4      P                  \        4      ^\        ,          ^,          ,           \        ^,          ^,
          \        \        4      ^,          ,          ,
          ^\        ,          ^,          ^,           \        \        4      ,          ^\        ,          ^,           ,          ,
          \        ^
4      ^,          ,
          R
\        ^,          ,          R\        ,          ,           ^,           R\        ^,          ,          ^\        ^,          ,          ,           ,          ,
          RR\        ,          ^,          \        ^
4      ^,          ,           ^^\        ^,          ,          ^\        ^,          ,          ,           ,          ,           ^/^$\        ^,          ,          ^\        ,          ,           ,          ,           R
R\        ,          ^,           ,          ,           \	        RR\        ,          ^,
          RR	7      ^	\        ,          ^,           ,          \        ^,          ^,
          3\        \        4      P                  \        4      R\        ^,          ,          R\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          ^\        ,          ,           ^l,
          ^$\        ^,          ,          ^\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ^,          ,          ,           ^l\        ,          ,
          ,          ,
          \        ^4      ^	,          ,
          \        \        ^4      ^,          ,
          \        \        4      ,          \        ^,          \        ^4      ^,          ,
          ,          ,
          \        ^,          ^,
          \        \        4      ^,          ,          ^\        ,          ,          ,
          RR\        ^,          ,          ^$\        ^,          ,          ^\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ,          ,           ^l,
          ,          R\        ^,          ,          ^$\        ^,          ,          ^\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ,          ,           ^l,
          ,          ,
          R\        ^,          ,          ^$\        ^,          ,          ^\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ,          ,           ^l,
          ,          ,           R\        ,          ^\        ^,          ,          ^H\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ^,          ,          ,
          ^x\        ,          ,           ^$,
          ,          ,
          \        ^4      ^	,          ,           ^^\        ^,          ,          ^\        ^,          ,          ,
          ^5\        ^,          ,          ,           ^?\        ^,          ,          ,
          ^(\        ^,          ,          ,           ^\        ,          ,
          ,          ,
          ^^\        ^,          ,          ^\        ^,          ,          ,
          ^5\        ^,          ,          ,           ^?\        ^,          ,          ,
          ^(\        ,          ,           ^,
          ,          ,           \	        R^^\        ,          ,
          RR	7      \        ^,
          ,          \	        R^	\        ,
          RR	7      ^	\        ,          ,          3\        \        4      P                  \        4      \        \        ^4      ^,          ,          \        \        ^4      ^,          ,          ^,
          ,          ,
          \        ^,          \        \        4      ,          ,           \        \        \        4      ^,          ,          \        \        ^4      ^,          ,          ,          ,           R^ ^ ^ 3\        \        4      P                  \        4      \        \        ^,          4      ,
          \        \        4      \        \        4      ,          ,           \        \        4      \        \        4      ^,          ,          ,           R^ ^ ^ 3\        \        4      P                  \        4      \        \        \        \        4      ,           4      ,
          \        \        4      ,           \        ^,          \        \        4      ^,          ,          ,           R^ ^ ^ 3^\        ^,          ,
          \        \        4      P                  \        ^4      ,          ^\        ,          \        \        4      P                  \        4      ,          ,
          ^\        \        4      ,          ,           R^ ^ ^ 3\        \        4      P                  \        4      \        ^,          ,
          \        ^,          \        \        4      ,          ,           \        ^,          \        ^,           ,          \        \        4      ^,          ,          ,           R^ ^ ^ 3\        \        4      P                  \        4      \        \        4      ^,          ,          \        ^,          ^,
          \        ^,          ^,           ,          \        \        4      ,          ,           ^^\        ,          ^,           ,          ,           \        \        4      ^,          ,           R^ ^ ^ 3.	p V  F;  w  rr4p\        V\         \        4      w  rgWb8X  g   Q hV'       g   K0  W4V.V8X  d   K;  Q h	  R# )z
This function tests if an ODE is Riccati or not.

Each test case has 5 values -

1. eq - The Riccati ODE.
2. match - Boolean indicating if eq is a Riccati ODE.
3. b0 -
4. b1 - Coefficient of f(x) in eq.
5. b2 - Coefficient of f(x)**2 in eq.
i  ir  i  iN  T;  i  FrG   i	  i  iD  i0  i  iw  il  i  i7  ih  i$  NrJ   rK   rM   )r&   r'   r;   r
   r   r   r   r   r   r   r   )rO   rC   resb0rQ   rR   matchfuncss           r,   test_match_riccatir_      s	    	
!		!AqD3q!t8+bd2R7#ad(
ad(;AX; #A;&(*;+ , 	,./	023A$'1Q372C	DQ46A:qt
QqT!Vac!e^
,	- 	
1a4AqD3q!t8#bAg-14q89Bq!tG	AqD3q!t8	bAg	%1	,q	0=2 	246qD"QT'AqD;q!t8; d;#%';( 5)	)+,	-/13q!t8c!Q$h3F
ad(4U44  0!	!
 	BAaC%(!A#'2	1Q37" 	
!		!qs2v1q!A$' 11QqSU	6
Q451q5 	bE"H	%(+AqD3q5(83(>
ad(SAX
(	 	
1R!B%(Q!Q$1a4002r!Q$w
Q$8 4 	s1us{#	$ 	B1q5)1Q373	!a 	
!		!AqD3q!t8+c!Q$h6QTA
a%1a4#ad(*SAX5AqD@AqDq5 	bE!G	$'(1Q46z1Q4&71	!Q: '	 Q37AaD!G#QqS)	*
 	AqD"QT'C1H$s1a4x/#ad(:SUB 	1a4xAqD3q!t8+c!Q$h6QTAA 	1a4xAqD3q!t8!3c!Q$h!>	1B "1u"" 	 "!eR1Wr!Q$w%6QT%AAqD&q5&& 	 "#2q		) ,.qAv1a4/?
1a40QT'0q!tG0$&(d0+ ,,		,
 /1!AqD&2ad72B
QT'3q!tG3 d3#%'3( /)	) 	BAaC%(!a%0BA&!,%, 	
!		!q1Q46{A!QK!O44q!tAaDy@	!A$'	1qtAv;	 q!Q 	
!		!s1a4y 3q6!A$;.Q!a?q!Q
 	
!		!tAQK((1Q4/!Q$qtQw,>q!Q 
QT1Q499Q?"QqS11%551Q4?q!Q
 	
!		!q!tad1Q4i'1a4Q<1q*@@q!Q
 	
!		!QqT1W1q1a4!84QqT99Aqs
@ = 	tQw	q!QWOE`  %$RA.||3B<5(((	  %r.   c                 	   \        ^
\        ^,          ,          ^\        ^,          ,          ,           ^\        ,          ,
          ^,           \        4      \        R\        ^
,          ,          \        ^	,          ,
          ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^
\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ^,          ,          ,
          ^\        ,          ,           ^,           \        4      ^3\        ^\        4      \        R\        ^,          ,          ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ,          ,
          ^,
          \        4      ^3\        R\        ^,          ,          ^\        ^,          ,          ,
          ^\        ,          ,           ^,
          \        4      \        R\        ^,          ,          ^\        ^,          ,          ,           ^\        ,          ,
          ^	,
          \        4      ^ 3\        ^\        ^,          ,          ^\        ^,          ,          ,
          ^\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ^,          ,          ,           \        ^,          ,
          \        ^,          ,           ^\        ,          ,
          \        4      \        R\        ^,          ,          \        ,           \        4      R3\        ^\        ^,          ,          ^	\        ^,          ,          ,           ^\        ^,          ,          ,
          ^	\        ^,          ,          ,
          \        ^,          ,           ^\        ,          ,
          ^,           \        4      \        ^\        ^,          ,          ^\        ^,          ,          ,           ^\        ^,          ,          ,
          ^\        ,          ,           ^,           \        4      R3.p V  F  w  rp\        W\        4      V8X  d   K  Q h	  R# )z
This function tests the valuation of rational
function at oo.

Each test case has 3 values -

1. num - Numerator of rational function.
2. den - Denominator of rational function.
3. val_inf - Valuation of rational function at oo
NirL   rI   irM   )r   r'   r   )rO   r7   r8   vals       r,   test_val_at_infrc     s    	R1WqAv1$q(!,SBYA!Q$&1a4/"QT'9AadFBQq!tVKbQRTUQUgUXYZ[]^Z^X^^abcdaddgiiklm	
 	Q
R1WqAv1a4'!A#-2A6	
 	R1WqAv!#a'+R1Wr!Q$w1$q(!,	
 	R1Wr!Q$wAqD(1QT61AadF:QTAAqDH2a4OQRSSAX\1	 	Qq!tVa1f_r!Q$w&1a4/!Q$61<q@!DR1WqAv!Q$&A-2A6	1E: ##A&#--- r.   c                     \        R. RO4      R8X  g   Q h\        ^. RO4      R8X  g   Q h\        ^. RO4      R8X  g   Q h\        R. RO4      R8X  g   Q hR# )	zh
This function tests the necessary conditions for
a Riccati ODE to have a rational particular solution.
FTNrV   )r*         )   r*      )r*   re         )r    r.   r,   test_necessary_condsrm   F  sX     !Y/5888 I.%777 I.%777 m4<<<r.   c            	        ^\         ^,          ,          ^\         ^,          ,          ,
          ^\         ,          ,
          ^,
          ^\         ,          ^,           ,          ^\         ^,          ,          ^(\         ^,          ,          ,           ^P\         ^,          ,          ,           ^\         ^,          ,          ,           ^<\         ,          ,
          ^P,
          ^\         ^,          ,          ^\         ^,          ,          ,
          ^K\         ,          ,           ^,           ,          R\         ^,          ,          ^$\         ^,          ,          ,
          ^K\         ^,          ,          ,           ^<\         ^,          ,          ,
          ^P\         ,          ,
          ^<,
          ^P\         ^,          ,          ^<\         ^,          ,          ,           ^<\         ^,          ,          ,           ^<\         ,          ,           ^P,
          ,          ^<\         ^,          ,          ^\         ^,          ,          ,           ^\         ^,          ,          ,
          ^\         ^,          ,          ,
          ^\         ^,          ,          ,           ^d\         ,          ,           ^<,
          ^\         ^,          ,          ^\         ,          ,
          ^,
          ,          ^\         ^,          ,          ^\         ^,          ,          ,
          ^\         ^,          ,          ,           ^\         ^,          ,          ,
          ^
\         ,          ,           ^<,           ^\         ^
,          ,          ^-\         ^	,          ,          ,
          ^\         ^,          ,          ,           ^\         ^,          ,          ,           ^\         ^,          ,          ,
          ^\         ^,          ,          ,           ^-\         ,          ,           ^,
          ,          .p V  F  pVP                  4        Uu. uF  p\        V\         4      NK  	  upw  r4\        W4\         4      w  r4VP	                  \         ^\         ,          4      P                  4       W4,          8X  d   K  Q h	  R# u upi )z]
This function tests the substitution x -> 1/x
in rational functions represented using Poly.
Ni)r'   as_numer_denomr   r   subsrN   )fnsr&   er7   r8   s        r,   test_inverse_transform_polyrs   U  s    1WqAv!a"Q$(+AX1a4"QT'!Bq!tG+bd2R7#ad(SAX:MPRSTPT:TWY:YZAX1a4"QT'!Bq!tG+bd2R7"QT'Bq!tG:KbQRTUQUg:UXZ[\X\:\_a:ab1Wr!Q$wAqD 2ad7*R1W4s1u<rAC1HrRStOVXDXY1Wr!Q$wAqD 2ad7*RT1B61b52ad79JRPQSTPTW9TWYZ[]^Z^W^9^abcdfgcgag9gAg:1:: C ()(8(8(:;(:1DAJ(:;)#A6vva1~$$&#'111 ;s   =Q/c                 
   \        R \        ^,          ,          ^\        ,          ,           ^ ,           \        4      \        ^ \        ^,          ,          ^H\        ^,          ,          ,           ^\        ,          ,           ^ ,
          \        4      ^ 3\        R\        ^,          ,          R\        ^,          ,          ,
          R\        ^,          ,          ,
          R\        ,          ,
          R,           \        4      \        R\        ^,          ,          R\        ^,          ,          ,
          R\        ,          ,           R,
          \        4      \        3\        R!\        ^,          ,          R\        ^,          ,          ,
          R	\        ^,          ,          ,           R
\        ^,          ,          ,
          R\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ,          ,           R,           \        4      \        R\        ^,          ,          R\        ^,          ,          ,
          ^T\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ^,          ,          ,           ^i\        ,          ,           ^,           \        4      \        ) 3\        ^i\        ^,          ,          R\        ^,          ,          ,
          ^<\        ^,          ,          ,           ^<\        ^,          ,          ,           ^P\        ^,          ,          ,
          ^-\        ^,          ,          ,           ^x\        ,          ,           ^,           \        4      \        R\        ^,          ,          R\        ^,          ,          ,           R\        ^,          ,          ,           R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ^,          ,          ,
          R\        ,          ,           R,           \        4      \        ^4      ^,          3\        R\        ^,          ,          R\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ,          ,
          ^Z,
          \        4      \        R\        ^,          ,          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ,          ,           R,           \        4      \        R4      R,          3.p V  F  w  rp\	        W\        4      V8X  d   K  Q h	  R# )"z
This function tests the limit at oo of a
rational function.

Each test case has 3 values -

1. num - Numerator of rational function.
2. den - Denominator of rational function.
3. limit_at_inf - Limit of rational function at oo
  i  ix  i  i'    i  i  i  rZ   iX  H  i  iv  i  i  |    i  i  i  i   i	  i
  i     i  i  i_  i  Ni!)r   r'   r   r
   r   )rO   r7   r8   lims       r,   test_limit_at_infr}   l  sD    	SAX1_r!1%R1Wr!Q$w1$r)1-	 	T!Q$Yad"SAX-Q6=qAT!Q$Yad"SU*S0!4
 	T!Q$Yad"T!Q$Y.QT9C1HDs1a4xORUVWYZVZRZZ
a%	T!Q$Yad"R1W,tAqDy83q!t8Cd1a4iORUVWRWWZ]]_`a		 	SAXAqD 2ad7*R1W4r!Q$w>AqDH3q5PSUUWXYSAXAqD 3q!t8+c!Q$h6adBT!Q$YNQUVWQWWZ]]_`a	!Q 	SAXAqD 3q!t8+c!e3b8!<SAXAqD 419,s1u4s:A>	#s
5E> #Ca(C/// r.   c                 	   \        R\        ^,          ,          ^\        ^,          ,          ,           ^\        ,          ,           ^,
          \        RR7      \        ^\        ^,          ,          ^\        ^,          ,          ,           ^	\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,           \        RR7      \        ^ 4      \        ^4      ^,          \        ^4      \        ,          ^,          ,           .\        ^4      ^,          \        ^4      \        ,          ^,          ,
          ..3\        R\        ^,          ,          R\        ^,          ,          ,           R\        ,          ,           R,           \        RR7      \        ^\        ^,          ,          R\        ^,          ,          ,
          R\        ^,          ,          ,           R	\        ^,          ,          ,
          R
\        ,          ,           ^1,           \        RR7      \        ^4      ^,          \        ^4      ^,          \        R4      R,          ,           .\        ^4      ^,          \        R4      R,          ,
          ..3\        ^\        ,          ^,           \        RR7      \        ^\        ^,          ,          ^^\        ^4      ,          ,
          \        ^,          ,          ,           ^^\        ^4      ,          ,
          \        ^,          ,          ,           ^^\        ^4      ,          ,
          \        ,          ,           ^\        ^4      ,          ,           ^,           \        RR7      \        ^4      \        ^4      ,           ^,          \        ^4      ^,          \        \        ^^\        ^4      ,          ^,           RR7      ^\        ^4      ,          ^,,           ,          ^,           4      ^,          ,           .\        ^4      ^,          \        \        ^^\        ^4      ,          ^,           RR7      ^\        ^4      ,          ^,,           ,          ^,           4      ^,          ,
          ..3.p V  F  w  rr4\        W\        V4      V8X  d   K  Q h	  R# )a>  
This function tests the Case 1 in the step
to calculate coefficients of c-vectors.

Each test case has 4 values -

1. num - Numerator of the rational function a(x).
2. den - Denominator of the rational function a(x).
3. pole - Pole of a(x) for which c-vector is being
   calculated.
4. c - The c-vector for the pole.
T	extensioni  i  i0  i0  i  i  ie  i  ij iz  zQQ<sqrt(3)>domainFrG   NrV   )r   r'   r
   r   r   r   r   )rO   r7   r8   polecs        r,   test_construct_c_case_1r     s    	R1WqAv!#a'd;Qq!tVbAg!Q$&AqD01QT69Bq!tGCQRVW	!
A$q&4719Q;
	!A$q&4719Q;"6!78	 	T!Q$Yad"SU*S0!tDSAXAqD 419,tAqDy83q5@2EqTXY	!Q
A$q&4>#%
%	&1a$x.2D)D(EF	 	QqS1Wa4(R1WBtAwJ1,,RQZA/EEQtTUwYXYHYYQi	7	
1Q
A$q&4Aqay1}u=r$q'zBORSSTUVV
V	WqT!Vd3q!DG)a-%@"T!W*r/RUVVWXYYYZ	\E* #$!#At4999 #r.   c                    \        ^\        RR7      \        \        ^,
          ^,          \        ^,
          ,          \        RR7      ^^\        ) R
\        ,
          ,          ^,          .\        R
\        ,           ,          ^,          ..3\        ^\        ^,          ,          ^\        ^,          ,          ,
          ^\        ^,          ,          ,
          ^,           \        RR7      \        ^\        ,          ^,
          ^,          \        ^,           ^,          ,          \        RR7      \        ^4      ^,          ^\        ^Y4      ) ^b,          .\        ^	4      ) ^b,          ..3\        \        ^,          \        ^,          ,
          ^\        ,          ,           \        RR7      \        \        ^,
          ^,          \        ^,           ^,          ,          \        RR7      ^^^\	        ^4      ,          \        ^<4      R,          ^\	        ^4      ,          ^,          ,
          ,          ^,          ^\	        ^4      ,          ^,          .R\	        ^4      ,          \        ^<4      R,          ^\	        ^4      ,          ^,          ,           ,          ^,          R\	        ^4      ,          ^,          ..3\        ^\        ^,          ,          \        ^,          ,           ^,           \        RR7      \        ^\        ,          ^,           ^,          \        ^,           ,          \        RR7      \        ^4      ) ^,          ^^\	        R4      ,          \	        R4      ) ^,          \        ^74      R,          ,
          ,          R,          \	        R4      R,          .R\	        R4      ,          \	        R4      ^,          \        ^74      R,          ,
          ,          R,          \	        R4      ) R,          ..3\        \        ^,          ^,           \        RR7      \        ^\        ,          ^,
          ^,          \        ^,          ^,           ,          \        RR7      \        ^4      ^,          ^^\	        ^B4      ,          \	        ^B4      ) ^6,          \        ^4      R,          ,
          ,          ^,          R\	        ^B4      ,          R,          \	        ^B4      ^,          .R\	        ^B4      ,          \	        ^B4      ^6,          \        ^4      R,          ,
          ,          ^,          ^\	        ^B4      ,          R,          \	        ^B4      ) ^,          ..3\        \        ^,          ^,           \        RR7      \        \        \	        ^4      ,
          ^,          \        RR7      \	        ^4      ^\	        ^4      \        ^4      ^,          ^\	        ^4      ,          ,
          ,          ^,          \	        ^4      ^,          \	        ^4      .\	        ^4      ) \        ^4      ^,          ^\	        ^4      ,          ,           ,          ^,          \	        ^4      ) ^,          \	        ^4      ) ..3.p V  F  w  rr4p\        W\        W44      V8X  d   K  Q h	  R	# )ae  
This function tests the Case 2 in the step
to calculate coefficients of c-vectors.

Each test case has 5 values -

1. num - Numerator of the rational function a(x).
2. den - Denominator of the rational function a(x).
3. pole - Pole of a(x) for which c-vector is being
   calculated.
4. mul - The multiplicity of the pole.
5. c - The c-vector for the pole.
Tr   iW  i  i 8     i$ i  NrJ   rM   ii)r   r'   r   r
   r   r   )rO   r7   r8   r   mulr   s         r,   test_construct_c_case_2r     s^   " 	QT"a!eaZQd3	1"b1f+a-1b1f:a<.)	 	Qq!tVbAg!Q$&*A>acAg\1q51*$a48	!QR5&)!uRxj!	 	QTAqD[1Q3T2a!eaZQ
"A6	1
DG)QrU3Y471,
-b
0!DG)A+	>	DGQrU3Y471,	-b	0"T!W*Q,?	A	 	Qq!tVad]QT2acAg\1q5!15	
1a
d3i-$s)C!B%+5
6s
:DIcM	J	d3ic32u4	5c	9DI:c>J	L	 	QTAXqD)acAg\1a4!8$a48	!Q
T"X+Ry|afVm3
4R
7DHT9I4PR8TW<	X	T"XtBx{QsVF]2	3B	6$r(
4$r(SVW	Y	 	QTBYT*a$q'kAqD1Q
r(AaDFQtBxZ'
(
+T!WQYR	A
r(AaDFQtBxZ'	(	+d1gXaZ$r(C	E	K+EX #($Q!#At9Q>>> #(r.   c                 ,    \        4       ^..8X  g   Q hR# )zT
This function tests the Case 3 in the step
to calculate coefficients of c-vectors.
N)r    rl   r.   r,   test_construct_c_case_3r     s    
 QC5(((r.   c                    \        \        ^,          ) ^\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ,          ,           ^,           \        RR7      \        ^	\        ^,          ,          ^\        ^,          ,          ,
          ^
\        ,          ,           ^,
          \        RR7      ^^
\        ,          ^,          \        ^,          R	\        ,          \        ^4      ^,          \        ^,          ,
          ,          ^,          .R
\        ,          ^,          \        ) ^,          ^\        ,          \        ^4      ^,          \        ^,          ,           ,          ^,          ..3\        \        ^,          ) ^	\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ,          ,           ^,           \        RR7      \        \        ^,          ^\        ^,          ,          ,           ^\        ^,          ,          ,           \        ,
          ^,           \        RR7      ^R\        ,          \        \        ) ^\        ,
          ,          ^,          .^\        ,          \        ) \        ^\        ,           ,          ^,          ..3\        R\        ^,          ,          \        ^,          ,
          \        ^,          ,
          ^\        ^,          ,          ,
          \        ^,          ,
          ^\        ,          ,
          ^,
          \        RR7      \        ^\        ^,          ,          ^
\        ,          ,           ^,           \        RR7      ^R\	        ^4      ,          \        ,          R,          R\	        ^4      ,          \        ,          ^$,          \	        ^4      \        ,          ^,          \	        ^4      ) \        ,          \        R4      R,          ^\	        ^4      ,          \        ,          ^,          ,
          ,          ^,          .R\	        ^4      ,          \        ,          R,          ^\	        ^4      ,          \        ,          ^$,          \	        ^4      ) \        ,          ^,          \	        ^4      \        ,          \        R4      R,          ^\	        ^4      ,          \        ,          ^,          ,           ,          ^,          ..3\        R	\        ^,          ,          ^\        ^,          ,          ,
          ^\        ^,          ,          ,
          \        ^,          ,
          ^,
          \        RR7      \        ^\        ,          ^,
          \        RR7      ^^)\        ,          ^,          ^\        ,          ^,          \        ^,          \        ) \        ^;4      ) R,          \        ,
          ,          .R\        ,          ^,          R\        ,          ^,          \        ) ^,          \        \        ^;4      ) R,          \        ,           ,          ..3\        \        ^,          ) \        ^,          ,
          \        ^,          ,
          \        ^,          ,
          \        ,
          \        RR7      \        \        ^,           \        RR7      ^R\        ,          ^,          ^\        ,          \        ) \        \        ) R^\        ,          ,
          ,          ^,          .^\        ,          ^,          R\        ,          \        \        ) \        R^\        ,          ,           ,          ^,          ..3\        \        ^,          ) \        ^,          ,
          ^\        ^,          ,          ,
          ^\        ^,          ,          ,
          \        ^,          ,
          \        ^,          ,
          ^\        ,          ,           ^,
          \        RR7      \        ^\        ,          ^,
          \        RR7      ^^\	        ^4      ,          \        ,          ^,          ^\	        ^4      ,          \        ,          ^,          \	        ^4      \        ,          ^,          \	        ^4      \        ,          ^,          \	        ^4      ) \        ,          \        ^4      ) ^,          ^\	        ^4      ,          \        ,          ^,          ,
          ,          ^,          .R	\	        ^4      ,          \        ,          ^,          R	\	        ^4      ,          \        ,          ^,          \	        ^4      ) \        ,          ^,          \	        ^4      ) \        ,          ^,          \	        ^4      \        ,          \        ^4      ) ^,          ^\	        ^4      ,          \        ,          ^,          ,           ,          ^,          ..3.p V  F6  w  rr4\        W\        \        V^4      p\        WS^,          4      V8X  d   K6  Q h	  R# )a  
This function tests the Case 4 in the step
to calculate coefficients of the d-vector.

Each test case has 4 values -

1. num - Numerator of the rational function a(x).
2. den - Denominator of the rational function a(x).
3. mul - Multiplicity of oo as a pole.
4. d - The d-vector.
Tr   i  rz   iIB  i 
  i   NrV   ri   rL   rM   iiir   rI   ra   )r   r'   r   r
   r   r$   r   r!   )rO   r7   r8   r   dsers         r,   test_construct_d_case_4r     s@    	adUQq!tV^a1f$qs*Q.TBQq!tVa1f_r!t#a'd;	
Q$r'1Q31afSj1Q3./1	2	QrA2a41afSj1Q3./12	4	 	adUQq!tV^a1f$qAv-!Q$61<q@!tTQTAadF]R1W$q(1,a4@	
Q$A2rAv;q=	!AaC!QQZ\#:;	 	R1Wq!t^ad"Qq!tV+ad2QqS81<a4PQq!tVbd]QT2	
d1g+a-
Sa[]2-tAwqy{T!WHQJ%QU
DG)A+a-I == 
"47l1nS0"T!W*Q,r/DG8A:a<Q	1U8D=1T!W9Q;q=01!35	6	 	R1WqAv!Q$&A-11ERTAXqD)	
Q$s(AaCFAaC!aeVD[1_!5	6	QsBqDGaRT1qufTkAo#67	9	 	adUQT\AqD 1a4'!+Q$?QUA&	
Q$q&!A#r1qb"qs(mAo	.1Q1a!QQqS\RS^0TU	 	adUQT\AadF"Qq!tV+ad2QT9AaC?!CQRVWQqS1Wa4(	
DG)A+a-471QQ	!T!WQYq[47(1*qQRteTUg	$q'	!AO CC 
tAwJqLNBtAwJqLNT!WHQJqL4PQ7(ST*UV,Q	AaD57QtAwYq[]*+A-/	0	M-E\ "#%c2sA>!#Av.!333 "r.   c            
     b   \        ^\        ^,          ,          \        ^,          ,           \        ,           ^,
          \        RR7      \        ^	\        ^,          ,          ^\        ^,          ,          ,           ^\        ,          ,           ^,
          \        RR7      \        ^4      ^,          \        ^4      ) ^l,          .\        ^4      ) ^,          \        ^4      ^l,          ..3\        ^\        ^,          ,          \        ^,          ,           \        ^,          ,
          \        ^,          ,           ^\        ,          ,
          ^,
          \        RR7      \        ^	\        ^,          ,          ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ,          ,           ^,           \        RR7      \        ^4      ^,          R\        ^4      ,          ^,          .\        ^4      ) ^,          ^\        ^4      ,          ^,          ..3\        \        ^,          \        ,
          ^,           \        RR7      \        ^\        ^,          ,          ^\        ,          ,           ^,           \        RR7      \        ^4      ^,          R\        ^4      ,          ^	,          .\        ^4      ) ^,          ^\        ^4      ,          ^	,          ..3.p V  F/  w  rp\        W\        \        ^ ^4      p\        V4      V8X  d   K/  Q h	  R# )z
This function tests the Case 5 in the step
to calculate coefficients of the d-vector.

Each test case has 3 values -

1. num - Numerator of the rational function a(x).
2. den - Denominator of the rational function a(x).
3. d - The d-vector.
Tr   ZZr   NrM   rI   )r   r'   r   r$   r   r"   )rO   r7   r8   r   r   s        r,   test_construct_d_case_5r   E  s    	Qq!tVad]Q"A6Qq!tVa1f_qs"Q&T:
q'!)d1gXc\	"d1gXaZa$=> 	Qq!tVad]QT!AqD(1Q3.2AdCQq!tVa1f_qAv%!Q$.14q8!DI
q'!)RQZ]	#tAwhqj!DG)B,%?@ 	QTAX\1T*Qq!tVac\Aq.
q'!)RQZ\	"d1gXaZ471$=>E  !%c2q!<!#&!+++ r.   c            	        \        R\        ^,          ,          ^,
          \        RR7      \        ^\        ^,          ,          ^\        ^,          ,          ,           ^
\        ,          ,           ^,           \        RR7      \        ^4      ^,          \        ^,          ,           .\        ^4      ^,          \        ^,          ,
          ..3\        R\        ^,          ,          ^\        ^,          ,          ,
          ^\        ,          ,
          ^,
          \        RR7      \        \        ^,          \        ^,          ,
          ^\        ^,          ,          ,           ^\        ^,          ,          ,
          ^\        ^,          ,          ,
          ^\        ,          ,
          ^	,           \        RR7      ^.^ ..3\        R\        ^,          ,          \        ^,          ,           ^\        ,          ,           ^,           \        RR7      \        ^\        ^,          ,          ^\        ^,          ,          ,
          ^\        ^,          ,          ,
          ^
\        ^,          ,          ,
          ^,\        ^,          ,          ,
          ^.\        ^,          ,          ,
          ^"\        ^,          ,          ,
          ^\        ,          ,
          ^*,
          \        RR7      ^.^ ..3.p V  F  w  rp\	        W\        4      V8X  d   K  Q h	  R# )z
This function tests the Case 6 in the step
to calculate coefficients of the d-vector.

Each test case has 3 values -

1. num - Numerator of the rational function a(x).
2. den - Denominator of the rational function a(x).
3. d - The d-vector.
r   r   NrM   rI   )r   r'   r
   r   r#   )rO   r7   r8   r   s       r,   test_construct_d_case_6r   f  s    	R1Wq[!D)Qq!tVa1f_r!t#a'48
A$q&1Q3,!A$q&1Q3,( 	R1WqAv!#a'48QTAqD[1QT6!AadF*Qq!tV3ac9A=qN
qc
 	R1Wq!t^bd"R'48Qq!tVbAg1a4'"QT'1Bq!tG;bAgE1a4O
Q$t	%
qc
	E" !!#A.!333 r.   c                    \        \        ^,          ^\        ,          ,
          ^	,           \        RR7      \        \        ^,          \        ,
          \        RR7      \        ^4      ^^^^^ RR^	RRR^	R R/3\        ^@\        ^,          ,          R\        ,          ,
          R,           \        RR7      \        ^@\        ^,          ,          ^P\        ^,          ,          ,
          R\        ^,          ,          ,
          R\        ,          ,           R,
          \        RR7      \        ^	4      ^,          ^^^ \        R4      R	,          ^\        R
4      R,          R\        R4      R,          ^\        R4      R,          /3\        ^\        RR7      \        \        ^,          R \        ^4      ,          ^,
          \        ^,          ,          ,           ^\        ^4      ,          ^,           \        ^,          ,          ,           R!^\        ^4      ,          ,
          \        ^,          ,          ,           ^^\        ^4      ,          ,           \        ,          ,           ^,
          \        RR7      \        ^4      ^^^^\        ^4      ,           ^R^\        ^4      ,          ,
          ^\	        RR^\        ^4      ,          ,
          RR7      R\        ^4      ,           ,          ^R^\        ^4      ,          ,
          R\        ^4      ,           ^,          ,          ^ \	        RR^\        ^4      ,          ,
          RR7      R\        ^4      ,           ^,          ,          RR^\        ^4      ,          ,
          R\        ^4      ,           ^,          ,          /3\        \        ^,          ^\        ^,          ,          ,
          ^\        ^,          ,          ,           ^
\        ,          ,           ^,
          \        RR7      \        \        ^,          ^,
          \        RR7      \
        ^^^^^^ ^^^ ^R^R^/3\        ^\        ^,          ,          ^\        ^,          ,          ,           ^\        ,          ,
          ^,           \        RR7      \        ^	\        ^,          ,          \        ^,          ,
          ^\        ^,          ,          ,
          ^\        ,          ,           ^,           \        RR7      \        ^4      ^,          ^ ^^ \        R4      R,          R\        R4      R,          R\        R4      R,          R\        R"4      R,          R \        R#4      R,          /3\        R$\        ^,          ,          ^\        ,          ,           ^,
          \        RR7      \        ^\        ^,          ,          ^	\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ,          ,           ^	,           \        RR7      \
        ^ ^^ ^ R^ R%\        ^G4      ) ^1,          R^ RRR \        ^4      ^,          /3.p V  F   w  rr4rVV\        W\        W4V4      8X  d   K   Q h	  R# )&a  
This function tests the computation of coefficients
of Laurent series of a rational function.

Each test case has 5 values -

1. num - Numerator of the rational function.
2. den - Denominator of the rational function.
3. x0 - Point about which Laurent series is to
   be calculated.
4. mul - Multiplicity of x0 if x0 is a pole of
   the rational function (0 otherwise).
5. n - Number of terms upto which the series
   is to be calculated.
Tr   i  i  i?  i  i  i iKi  i  l    `B l   -R i0 i}' FrG   i  i  i i) l   ?PT l   @qs l   @4l    Zdjm NirJ   rM   ra   rV   rK   r{   lF41lJ!tz r   rI   )r   r'   r
   r   r   r   r$   )rO   r7   r8   x0r   nr   s          r,   test_rational_laurent_seriesr     s   & 	QTAaCZ!^Q$/QTAXqD)	!a	
Aq"b!RRB3	 	R1WtAv$a48R1Wr!Q$wQT)DF2S8!tL	!Q1	
AhK !QtWS["an[6P	1V9U?		 	QT"QTRQZ!^QT))QtAwY^QT,AAS1TRSW9_VWYZVZDZZqay=!
 !"d	4QA	
AQKB47NAs2rAd1gI~PU/VXZ
q'Y 0QtAwYd1g(991c"b1TRSW9n_d ?
Q<!
?"qay.2Q<!2C!C	E 	QTAadF]Qq!tV#bd*R/dCQTAXqD)
Aq	
Aq!Q1aRR0	 	Qq!tVa1f_qs"Q&T:Qq!tVad]Qq!tV#ac)A-qDA	!Q1	
AdGDL"ai/Qz]:5M
Anm+R3D1EFV1V	X	 	R1Wqs]QT2Qq!tVa1f_qAv%!Q$.14q8!tL
Aq	
Ar1b1R5&)RBB"a@	S.E^ &+!"1-c2AFFFF &+r.   c                ~  a \        V \        4      '       d   V P                  V P                  ,
          p \	        V \
        \        4      w  r4\        \        \        4      \        .VO5!  p\        R4      pV Uu. uF  qwP                  VS4      NK  	  pp\        ;QJ d%    R \        W4       4       F  '       d   K   RM	  RM! R \        W4       4       4      '       g   Q h\        ;QJ d(    V3R l\        WQ4       4       F  '       d   K   RM	  RM! V3R l\        WQ4       4       4      '       g   Q hR# u upi )zr
Helper function to check if actual solution
matches expected solution if actual solution
contains dummy symbols.
C1c              3   2   "   T F  q^ ,          x  K  	  R# 5i)r   Nrl   ).0r'   s   & r,   	<genexpr>"check_dummy_sol.<locals>.<genexpr>  s     32tt2s   FTc              3   L   <"   T F  w  rVP                  VS4      x  K  	  R # 5i)N)dummy_eq)r   s1s2	dummy_syms   &  r,   r   r     s#     I8Hfbr{{2y))8Hs   !$N)
isinstancer	   lhsrhsr   r&   r'   r%   r   rp   allr   zip)rC   solser   r2   r^   solsr   rD   s   &&f     r,   check_dummy_solr     s     "bVVbff_RA&HA1q)5)D	tB/34tHHR#tD433[233333[2333333ID8HI333ID8HIIIII 5s   :D:c                 D/   \        R4      p \        \        \        4      P	                  \        4      \        \        4      ^,          ,           ^,
          ^ 4      \        \        \        4      \        ^4      4      \        \        \        4      \        ^4      ) 4      .3\        \        4      ^,          \        \        4      P	                  \        4      ,           ^\        \        4      ,          \        ,          ,           ^\        ^,          ,          ,           \        \        \        4      R V ,          \        ,
          V \        ,          \        ^,          ,           ,          4      .3^\        ^,          ,          \        \        4      P	                  \        4      ,          \        ^\        \        4      ,          \        \        4      P	                  \        4      ,           ^,
          ,          ,
          \        \        4      ^,
          \        \        4      ,          ,           \        \        \        4      V ^\        ^,          ,          ,           V \        ,           ,          4      .3\        \        \        4      P	                  \        4      \        \        4      ^,          ) ^\        ^,          \        ^,          ,
          ,          ,
          4      \        \        \        4      ^\        ^,          \        ,
          ,          4      .3\        ^,          ^\        ,          ^\        ,          ,           \        \        4      ,          ,
          \        \        4      ^,          ,           \        \        4      P	                  \        4      ,           \        \        \        4      V \        ,          \        ^,          ,           ^\        ,          ,           V \        ^,          ,           ,          4      \        \        \        4      \        4      .3\        ^,          \        \        4      P	                  \        4      ,          \        ^,          ,           \        ^\        \        4      ^,          ,          \        \        4      P	                  \        4      ,           ,          ,
          \        \        4      ,           \        \        \        4      V \        ^,          ,          \        ,           V \        ^,          ,           ,          4      \        \        \        4      \        ^,          4      .3\        \        4      ^,          ) \        \        4      P	                  \        4      ,           ^\        ^,          ,          ^\        ,          ,
          ^,           \        ^,
          ^,          ^\        ,          ^,
          ^,          ,          ,          ,           \        \        \        4      ^	V ,          \        ,          ^V ,          ,
          ^\        ^,          ,          ,
          ^<\        ^,          ,          ,           ^^\        ^,          ,          ,
          ^H\        ^,          ,          ,           ^\        ,          ,
          ^,           ^V ,          \        ^,          ,          ^	V ,          \        ,          ,
          ^V ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,
          ^9\        ^,          ,          ,           ^:\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ,          ,
          ,          4      \        \        \        4      ^\        ,          ^,
          ^\        ^,          ,          ^\        ,          ,
          ^,           ,          4      .3\        \        4      ^,          \        \        4      P	                  \        4      ,           ^\        ^,          ,          ^\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ^,          ,          ,           ^\        ,          ,
          ^,           ^\        ^,          ,          ,          ,
          \        \        \        4      ^\        ^,          ,          ^\        ^,          ,          ,
          \        ^,          ,
          ^\        ^,          ,          ,           ^\        ,          ,           ^,
          ^\        ^,          ,          ^\        ^,          ,          ,
          ,          4      .3\        \        \        4      P	                  \        4      \        ^,          ) ^\        ^,          ,          ,           ^(\        ^,          ,          ,
          ^-\        ^,          ,          ,           ^\        ,          ,
          ^,           \        ^,          ^\        ^,          ,          ,
          ^B\        ^
,          ,          ,           ^\        ^	,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ^,          ,          ,
          R\        ^,          ,          ,           ^\        ^,          ,          ,
          ^B\        ^,          ,          ,           ^\        ,          ,
          ^,           ,          \        \        4      ^,          ,           \        \        4      ,           4      \        \        \        4      ^\        ^,          ^\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ^,          ,          ,
          ^\        ^,          ,          ,           ^\        ,          ,
          ^,           ,          4      .3\        \        \        4      P	                  \        4      \        \        \        4      ,          ^\        ,          ,           ^\        ,          ^,
          \        \        4      ^,          ,          ^\        ,          ^,           ,          ,           ^\        ^,          ,          ^\        ,          ,
          ^,           ^\        ^,          ,          ^\        ^,          ,          ,
          ^,           ,          ,           \        ^4      ^,          ,
          4      \        \        \        4      ^^\        ,          ,
          ^\        ,          ^,
          ,          4      .3\        \        \        4      P	                  \        4      R!\        ^,          ,          ^0\        ,          ,
          ^,
          ^\        ^,          ,          ^(\        ^,          ,          ,
          ^\        ,          ,           ^,           ,          ^\        \        4      ^,          ,          ^\        ,          ^,           ,          ,           4      \        \        \        4      ^\        ,          ^,           ^\        ,          ^,
          ,          4      .3\        \        4      P	                  \        4      ^\        ^,          ,          ^,           \        \        4      ^,          ,          \        ,          ,           ^\        ^,          ,          \        ,
          ^,           \        \        4      ,          \        \        ^,
          ,          ,          ,           ^\        ^,          ,          ^\        ,          ,
          ^,           \        \        ^,
          ^,          ,          ,          ,           \        \        \        4      V ) \        ^,          ,
          \        ^,          ,           ^\        ,          ,
          V \        ,          V ,
          \        ^,          ,           \        ^,          ,
          \        ^,          ,           \        ,
          ,          4      \        \        \        4      R"\        ^,
          ,          4      .3\        \        4      P	                  \        4      ^\        ,          \        \        4      ^,          ^,           ,          \        ,          ,
          \        \        \        4      \        ) V ,          \        \        ^,          ,          ,           V \        ^,          ,           ,          4      \        \        \        4      \        ) 4      .3\        \        \        4      P	                  \        4      \        \        \        4      ,          \        ^4      ^,          ^\        ,          ,
          ,          \        ^,          \        ^4      ^,          ,
          \        \        4      ^,          ,          ^\        ,          ^,          \        ^4      ^,          ,
          ,          ,           \        ^4      ^,          ,
          R\        ^,          ,          R\        ,          ,
          R,           ^\        ^,          ,          ^\        ^,          ,          ,
          ,          ,           4      \        \        \        4      ^	\        ,
          \        ,          4      \        \        \        4      ^(\        ^,          ,          ^\        ^,          ,          ,           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\        ,          ,           ,          4      .3\        \        \        4      P	                  \        4      ^\        ^,          ,          ^\        ^,          ,          ,           \        ) ^,          \        ^4      ^,          ,
          \        \        4      ^,          ,          ,           ^,           4      \        \        \        4      ^\        ,          4      .3\        \        \        4      P	                  \        4      R#\        ^,          ,          ^,          ^\        ,          ^,          ,           \        ^,          \        ^4      ^,          ,
          \        \        4      ^,          ,          ,           ^	,           ^\        ,
          \        \        4      ,          \        ,          ,           ^\        ,          ,           4      \        \        \        4      R#\        ,          ^,          ^,
          4      .3.pV F  w  r#\        W#V 4       K  	  R# )$a  
This function tests the computation of rational
particular solutions for a Riccati ODE.

Each test case has 2 values -

1. eq - Riccati ODE to be solved.
2. sol - Expected solution to the equation.

Some examples have been taken from the paper - "Statistical Investigation of
First-Order Algebraic ODEs and their Rational General Solutions" by
Georg Grasegger, N. Thieu Vo, Franz Winkler

https://www3.risc.jku.at/publications/download/risc_5197/RISCReport15-19.pdf
C0  i  i  i  ru   rv   ry   rx   i0H  i iF i4" i< ii2ҍi"0	iimi^rw   i  i<Z  i8X i4 iLB i i|Mi:i NrM   r{   rJ   rV   )	r   r	   r&   r'   r;   r   r
   r   r   r   rO   rC   rD   s       r,   test_solve_riccatir     s     
tB 	1Q499Q<!A$'!A%q)	AaD$q'	Bqtd1gX./ 	
!a!A$))A,1Q4)AadF2	AaD2b519r!tad{+	,- 	
!Q$qtyy|a1Q4!A$))A,!6!:;;qtax1oM	AaD2!Q$;a(	)* 	1Q499Q<!A$'Aq!tad{O34	AaD!QTAX,	  	
1!ac	1Q4!A$')AaDIIaL8	AaD2a4!Q$;1$rAqDy1	2BqtQK@
 	
1QqTYYq\AqD 1a!ai!A$))A,&>#??!A$F	AaD2ad7Q;ad+	,b1q!tn= 
1q1Q499Q<2ad7RT>A#5Q
AaCED 9 # 		AaD1R46AbD=2ad7*R1W4r!Q$w>AqDH
Q$rT!Q$Y2a'!B$.1a47"QT'A
1a4QT'q!tG$&'c*+ 
,-/!qsQw1a4
A#BB 7 .	 	
!a!A$))A,!AqD&1QT6/Bq!tG";a1f"DadF#T## !!Q$"( 	(	AaD1QT6AadF?QT)AadF2QqS81<qAv1f@  
 	 	1Q499Q<1a4%"QT'/Bq!tG3bAg=1DqHUR2X1b5(3q!t83c!Q$h>QTICPQSTPTHT1H1a4x "%ad(+-/1W579!t<>?@ACDQ47KMNqTR 	S 
AaD!QTAadF]R1W,r!Q$w6AqD@1Q3FJK	LM	 	1Q499Q<1Q4!A#1q!A$'(91Q37(CCq!tVac\BAqD2ad7!2Q!678:;A$q&A 	B	AaD1qs7QqS1W%	&' 	1Q499Q<#ad(RT/B.AqD2ad71BQqS1H11LM!ai1q!" 	#	AaD1Q37QqS1W%	&' 	
!		!!Q$
AaD!G+A--1a4!a10Eq!K H 1 	q!tVac\A%1q51*5	6	AaDB3A:1$qs*RTBYA-=1-Dq!t-K.  
adBAJ'	) 	
!		!qsAaD!GaK(**	AaDA2b51QT6>BAI.	/AaD1"> 	1Q499Q<1Q41a!A#.!A#!Q,!a1GqSUQqT!V^2  tAv&),QTDF):S)@2ad7RPQSTPTWCT(UV 	W	AaD1q5!)	b11b52ae8(;c!R%i(G$qRTu*(T!R%K) A+)&(.q!t)46=adl)CELQPQT\)RT\qDU)AqD=)!#,QT>)24=adN)CENq[)QS\)] BhQU"SBY.ae;eArEkIFSTVWSWKW1a4K!!Q$,')0A68@AFHPQRTUQUVX`TYQTM"$,QJ/(1 2 	3	 	1Q499Q<AqD2ad7*qbdQqT!VmQqT1W-DDqHI	AaD!A# 	1Q499Q<AqDRT!V+qsQqT!V|QqT1W.DDq5!A$,q.!#$Q3' 	(	AaD"Q$q&1*	AdEJ $ r.   c            	        \        R4      p \        \        \        4      P	                  \        4      ^\        ,
          \        \        4      ,          \        ^,
          ,          ^^\        ,          ,
          \        \        4      ^,          ,          ^\        ,          ^	,
          ,          ,           R\        ^,          ,          R\        ^,          ,          ,
          R\        ,          ,           R,
          ^\        ^,          ,          ^\        ^,          ,          ,
          R\        ^,          ,          ,           R\        ,          ,
          R,           ,          ,           R,           4      \        \        \        4      ^\        ,          ^,           ^\        ,          ^	,
          ,          4      .3.pV F  w  r#\        W#V 4       K  	  R	# )
z
This function tests the computation of rational
particular solutions for a Riccati ODE.

Each test case has 2 values -

1. eq - Riccati ODE to be solved.
2. sol - Expected solution to the equation.
r   i  i/ i i- i*  i  r   N)r   r	   r&   r'   r;   r   r   s       r,   test_solve_riccati_slowr   X  s$    
tB 	1Q499Q<!a%1q1u-RT1Q470BAaC!G0LL1a4Z&A+%	1G;a1fs1a4x>ORUVWYZVZRZ>ZF??  ! 	" 
AaD2a4!8acAg&	'(	E $ r.   N)Jsympy.core.randomr   sympy.core.functionr   sympy.core.mulr   sympy.core.numbersr   r   r   sympy.core.relationalr	   sympy.core.singletonr
   sympy.core.symbolr   r   &sympy.functions.elementary.exponentialr   r   %sympy.functions.elementary.hyperbolicr   (sympy.functions.elementary.miscellaneousr   (sympy.functions.elementary.trigonometricr   sympy.polys.polytoolsr   sympy.simplify.ratsimpr   sympy.solvers.ode.subscheckr   sympy.testing.pytestr   sympy.solvers.ode.riccatir   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r-   r3   r9   rE   rT   rX   r_   rc   rm   rs   r}   r   r   r   r   r   r   r   r   r   r   rl   r.   r,   <module>r      s    % (  0 0 $ " . = 6 9 8 & * 3 %     SMCL
BE ?FD36l`)F).X=2.+0\#:L;?|)<4~,B4@@GFJ$z%z % %r.   