o
    GZhr                    @   sJ  d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZmZmZmZmZmZmZ ddlmZ dd	lmZ dd
lmZmZmZmZmZmZmZm Z  ddl!m"Z"m#Z# ddl$m%Z% ddl&m'Z'm(Z(m)Z) ddl*m+Z+m,Z,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5m6Z6m7Z7m8Z8 ddl9m:Z:m;Z;m<Z< ddl=m>Z>m?Z?m@Z@mAZA ddlBmCZCmDZD ddlEmFZFmGZGmHZH ddlImJZJ ddlKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZU ddlVmWZW ddlXmYZY ddlZm[Z[m\Z\ ddl]m^Z^m_Z_ ddl`maZa ddlbmcZcmdZd ddlemfZf ddlgmhZh ddlimjZj dd lkmlZlmmZm dd!lnmoZo dd"lpmqZrmsZtmuZvmwZx dd#lymzZz dd$l{m|Z| dd%l}m~Z~ dd&lmZ dd'lmZ dd(lmZmZmZmZ dd)lmZ dd*lmZ dd+lmZ dd,lmZ dd-lmZ dd.lmZmZmZmZ dd/lmZ dd0lmZ dd1lmZmZ dd2lmZ dd3lmZmZ dd4lmZ dd5lmZ dd6lmZ dd7lZdd8l/mZ dd9lXmZ dd:lmZmZmZ dd;lemZ dd<lmZmZmZmZmZ dd=lmZ dd>lmZmZ dd?lmZmZmZ dd@lmZmZ ddAlmZmZ ddBlmZ ddClmZ ddDlmZ ddElmZ ddFlmZ ddGlmZ ddHlmZ ddIlmZmZmZmZmZmZmZ ddJlmZ ddKlmZmZmZ ddLlmZ ddMl!mZ ddNlmZmZ ddOlmZ ddPlmZ ddQlmZ e%jZeZe)dR\ZZZe)dSdTdU\ZZZZZZedVZedWZdXdY ZdZd[ Zd\d] Zd^d_ Zd`da Zdbdc Zddde Zdfdg Z dhdi Zdjdk Zdldm Zdndo Zdpdq Zdrds Zdtdu Zdvdw Zdxdy Z	dzd{ Z
d|d} Zd~d Zdd Zdd Zedd Zdd Zdd Zedd Zdd Zedd Zdd Zdd Zdd Zdd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Zedd Z edd Z!dd Z"dd Z#edd Z$edd Z%edd Z&dd Z'dd Z(dd Z)dd Z*dd Z+edd Z,edd Z-ddÄ Z.ddń Z/ddǄ Z0ddɄ Z1edd˄ Z2dd̈́ Z3eddτ Z4ddф Z5ddӄ Z6ddՄ Z7ddׄ Z8ded  ded   ded   ded   ded   d Z9ded  ded   ded   ded   ded   ded   d Z:ded  ded   ded   ded   de  d Z;dd Z<dd Z=dd Z>dd Z?dd Z@dd ZAdd  ZBdd ZCedd ZDdd ZEdd ZFd	d
 ZGdd ZHedd ZIdd ZJedd ZKedd ZLdd ZMdd ZNdd ZOdd ZPdd ZQdd  ZRed!d" ZSed#d$ ZTd%d& ZUd'd( ZVed)d* ZWd+d, ZXd-d. ZYed/d0 ZZd1d2 Z[d3d4 Z\ed5d6 Z]ed7d8 Z^ed9d: Z_ed;d< Z`ed=d> Zad?d@ ZbedAedBdC ZcedDdE ZddFdG ZedHdI ZfedJdK ZgdLdM ZhdNdO ZidPdQ ZjdRdS ZkdTdU ZldVdW ZmdXdY ZndZd[ Zoed\d] Zpd^d_ Zqd`da Zredbdc Zseddde Ztdfdg Zuedhdi Zvdjdk Zwdldm Zxedndo Zydpdq Zzdrds Z{dtdu Z|dvdw Z}dxdy Z~dzd{ Zd|d} Zd~d Zdd Zdd Zdd Zedd Zdd Zedd Zedd Zedd Zedd Zdd Zedd Zdd Zdd Zedd Zedd Zdd Zedd Zdd Zedd Zedd Zdd Zedd Zedd Zedd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd ZeddÄ ZdĐdń ZdƐdǄ ZdȐdɄ Zedʐd˄ Zed̐d̈́ Zedΐdτ ZdАdф ZdҐdӄ ZdԐdՄ Zd֐dׄ Zdؐdل Zdڐdۄ Zedܐd݄ Zedސd߄ Zedd Zedd Zeedd Zedd Zeedd Zdd Zdd Zdd Zdd Zdd Zedd Zdd Zdd Zedd Zdd Zdd Zed d Zdd Zedd ZĐdd ZŐdd	 ZƐd
d Zǐdd Zedd Zɐdd Zʐdd Zːdd Z̐dd Z͐dd Zedd Zedd ZАdd Zѐd d! ZҐd"d# ZӐd$d% ZԐd&d' ZՐd(d) Z֐d*d+ Zאd,d- Zؐd.d/ Zed0d1 Zڐd2d3 Zېd4d5 Zܐd6d7 Zݐd8d9 Zސd:d; Zߐd<d= Zd>d? Zed@dA ZedBdC ZdDdE ZedFdG ZdHdI ZdJdK ZedLdM ZedNdO ZedPdQ ZdRdS ZedTdU ZedVdW ZdXdY ZdZd[ Zd\d] Zd^d_ Zd`da Zdbdc Zeddde Zedfdg Zedhdi Zedjdk Zedldm Zdndo Zdpdq Zedrds Zdtdu Zedvdw Zedxdy Zedzd{ Zed|d} Z ed~d Zedd Zdd Zdd Zdd Zeedd Zedd Zedd Zedd Z	dd Z
dd Zdd Zdd Zdd Zdd Zedd Zedd Zedd Zedd Zedd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zedd Zedd Zedd Zdd Z dd Z!dd Z"ddÄ Z#dĐdń Z$dƐdǄ Z%edȐdɄ Z&dʐd˄ Z'd̐d̈́ Z(edΐdτ Z)dАdф Z*dҐdӄ Z+dԐdՄ Z,ed֐dׄ Z-edؐdل Z.dڐdۄ Z/edܐd݄ Z0edސd߄ Z1edd Z2edd Z3dd Z4dd Z5dd Z6dd Z7edd Z8edd Z9dd Z:edd Z;dd Z<dd Z=dd Z>edd Z?eedd Z@dd ZAed d ZBedd ZCedd ZDedd ZEeedd	 ZFeed
d ZGeedd ZHeedd ZIdd ZJedd ZKeedd ZLedd ZMedd ZNdd ZOedd ZPdd ZQed d! ZRd"d# ZSd$d% ZTd&d' ZUed(d) ZVed*d+ ZWd,d- ZXd.d/ ZYed0d1 ZZd2d3 Z[eed4d5 Z\eed6d7 Z]d8d9 Z^d:d; Z_d<d= Z`d>d? Zad@dA ZbdBdC ZcedDdE ZddFdG ZedHdI ZfdJdK ZgdLdM ZhdNdO ZidPdQ ZjedRdS ZkdTdU ZledVdW ZmedXdYdZ Znd[d\ Zoed]d^ Zped_d` Zqedadb Zredcdd Zsdedf Ztedgdh Zudidj Zvdkdl Zwdmdn Zxdodp Zydqdr Zzedsdt Z{edudv Z|dwdx Z}dydz Z~ed{ed|d} Zed~d Zedd Zedd Zdd Zdd Zdd Zedd Zedd Zedd Zd7S (  z Tests from Michael Wester's 1999 paper "Review of CAS mathematical
capabilities".

http://www.math.unm.edu/~wester/cas/book/Wester.pdf
See also http://math.unm.edu/~wester/cas_review.html for detailed output of
each tested system.
    )Qask)refine)product)
EulerGamma)N)
DerivativeFunctionLambdaSubsdiffexpandexpand_func)Muligcd)AlgebraicNumberEIRationalnanoopizoo)EqLt)S)DummySymbolsymbols)rfbinomial	factorial
factorial2)	bernoulli	fibonaccitotient	partition)	conjugateimresign)LambertWexplog)asinhcoshsinhtanh)ceilingfloor)MaxMinsqrt)	Piecewise)
acosacotasinatancoscotcscsecsintan)besselj)
DiracDelta)
elliptic_e
elliptic_f)gamma	polygamma)hyper)assoc_legendre
chebyshevt)polylog)idiff)And)hessian	wronskian)MatMul)continued_fraction_convergentscontinued_fraction_iteratorcontinued_fraction_periodiccontinued_fraction_reduce)	factorint)
primerange)ZZ)legendre_poly)apart)Polyfactorgcd	resultant)limit)O)residue)series)ImageSet)	FiniteSetIntersectionIntervalUnion)combsimp)hyperexpand)	powdenestpowsimp)radsimp)
logcombinesimplify)
sqrtdenest)trigsimp)solveNstirling)	Heaviside)CiSierf)zeta)XFAILslowSKIPtooslowraises
partitions)mpimpc)MatrixGramSchmidteye)BlockMatrixblock_collapse)MatrixSymbol
ZeroMatrix)
Commutator)PolyRing)	FracField)solve_lin_sys)Sum)Product)	integrate)laplace_transforminverse_laplace_transformLaplaceTransformfourier_transformmellin_transformlaplace_correspondencelaplace_initial_conds)rsolve)solvesetsolveset_reallinsolve)dsolve)Equality)islice	takewhile)fps)fourier_series)minimumx y zzi j k l m nTintegerfgc                   C   sB   t ttttttt tttB t tttB t tttttksJ d S Nrd   ijklm r   r   P/var/www/auris/lib/python3.10/site-packages/sympy/utilities/tests/test_wester.pytest_B1v   s
   
r   c                   C   sN   t ttttttt ttt@ t ttt@ ttthttthttthks%J d S r   )rd   r   r   r   r   r   re   r   r   r   r   test_B2{   s
   
r   c                   C   s.   t tttttt t t ttttksJ d S r   r   r   r   r   r   test_B3   s   r   c                   C   s>   t t ttt tt  t ttfttfttfttfksJ d S r   )rd   r   r   r   r   r   r   r   r   test_B4   s   r   c                   C      t ddksJ d S )N2   l         <:.kjFt=VfvaI= )r"   r   r   r   r   test_C1   s   r   c                   C   s8   t tddddddddddd	d	d	d	d	d	d
ksJ d S )Nr   /                        )r   r                              %   )   +   r   )rV   r"   r   r   r   r   test_C2   s   r   c                   C   s   t dt dfdksJ d S )N
   	   )i   i  )r#   r   r   r   r   test_C3      r   c                   C   s   ddksJ d S )Ni
  r   r   r   r   r   test_C4   s   r   c                   C   s   dt ddks	J d S )N{   Z234r   intr   r   r   r   test_C5      r   c                   C   s,   t ddt dd  krdksJ  J d S )NZ677r   Z1BF   i  r   r   r   r   r   test_C6      ,r   c                   C   s   t dddks	J d S )Ni   r   r   )r.   r   r   r   r   test_C7   r   r   c                   C   s,   t dddks
J t dddksJ d S )Nr   r   r      )rX   invertr   r   r   r   test_C8   s   r   c                   C   s   t t ddddksJ d S )N  i  iB  J   r   r   r   r   r   test_C9   r   r   c                  C   s8   d} t ddD ]	}| td|7 } q| tddksJ d S )Nr   r   r   r   i  i	  )rangeR)xnr   r   r   test_C10   s   r   c                   C   s   t ddtdksJ d S )Nr   r   z
0.[142857])r   r   r   r   r   r   test_C11      r   c                   C   s    t ddt dd dksJ d S )Nr   r   r   r   r   r   r   r   r   test_C12       r   c                  C   s@   t dddt dd t dd  } dt dd }| |ksJ d S )Nr   r   r   r   i  r   r   testZgoodr   r   r   test_C13   s   "r   c                   C   s,   t tdtd d dtd ksJ d S )Nr   r   r   r   ro   r7   r   r   r   r   test_C14   r   r   c                  C   sX   t tddtddtddtddtd        } tdd }| |ks*J d S )N   r   r   r   r   r   r   r   r   r   test_C15   s   <r   c                  C   sX   t tddtd  dtd  dtd  } tdtd td }| |ks*J d S )Nr   r   r      r   r   r   r   r   r   r   test_C16   s   0r   c                  C   sD   t tdtd tdtd  } ddtd  }| |ks J d S )Nr   r   r   r   )rl   r7   r   r   r   r   test_C17   s   $r   c                   C   s8   t tdtd tdtd  jdddksJ d S )NTcomplexr   )rn   r7   r   r   r   r   r   test_C18      8r   c                   C   s6   t tddtd  tdd dtd ksJ d S )NZ   "   r   r   r   )rl   rn   r7   r   r   r   r   r   test_C19      6r   c                  C   sT   ddt d  } t| tdd d t d | tdd  }t|tdks(J d S )N   N   r   r   r   r   )r7   r   r   rn   )Zinsider   r   r   r   test_C20   s   ,r   c                   C   s:   t tddtd  tdd tdtd ksJ d S )Nr   r   r   r   r   )rn   r   r7   r   r   r   r   r   test_C21   s    r  c                  C   s   t ddtd  tddtd   ddtd  tddtd    d dtd  d	td d
  } tdd ttdd d  }| |ksLJ d S )Nr   r   r   r   r   r          0   H   r   )rn   r7   r.   r   r   r   r   test_C22   s   6

 r  c                   C   s   dt  d t u s
J d S )Nr   r   )r   r   r   r   r   test_C23     r  c                   C      t d)Nz2**aleph_null == aleph_1NotImplementedErrorr   r   r   r   test_C24     r  c                   C   s   dt d dks
J d S )N        r   r   )r7   r   r   r   r   test_D1  r  r  c                   C   s   t td dksJ d S )Niz3.29683147808856e-434295)strr-   evalfr   r   r   r   test_D2  r   r  c                   C   s&   t ttd djdsJ d S )N   r   l   h	a%)r-   r   r7   r  numaer   r   r   r   test_D3     &r  c                   C   s0   t tdddksJ ttdddksJ d S )Nr   r   r   )r4   r   r3   r   r   r   r   test_D4  s   r  c                   C   r	  )Nz6cubic_spline([1, 2, 4, 5], [1, 4, 2, 3], x)(3) == 27/8r
  r   r   r   r   test_D5   r  r  c                   C   r	  )Nz,translate sum(a[i]*x**i, (i,1,n)) to FORTRANr
  r   r   r   r   test_D6%  r  r  c                   C   r	  )Nz&translate sum(a[i]*x**i, (i,1,n)) to Cr
  r   r   r   r   test_D7*  r  r  c                   C   r	  )Nz.apply Horner's rule to sum(a[i]*x**i, (i,1,5))r
  r   r   r   r   test_D8/  s   r  c                   C   r	  )Nztranslate D8 to FORTRANr
  r   r   r   r   test_D97  r  r  c                   C   r	  )Nztranslate D8 to Cr
  r   r   r   r   test_D10<  r  r  c                   C   r	  )Nz.flops(sum(product(f[i][k], (i,1,k)), (k,1,n)))r
  r   r   r   r   test_D11A     r   c                   C   sN   t ddt t dd d t ddtd  t ddt  t dd	 ks%J d S )
Nr   r   r   r   r   r   )r   r   r   r   r   r   test_D12G     Nr%  c                   C   r	  )Nz:discretize a PDE: diff(f(x,t),t) == diff(diff(f(x,t),x),x)r
  r   r   r   r   test_D13L  r  r'  c                   C   s&   t tdtdt  dt  ksJ d S )Nr   r   r   )r    r   r   r   r   r   test_F1V  r  r(  c                   C   s.   t ttdttd  td  d ksJ d S )Nr   r   r   r   )r   r!   r   r   r   r   r   test_F2Z  s   .r)  c                   C   s8   t dt tt tdt d  tdt ksJ d S Nr   r   )rh   r   r"   r#   r   r   r   r   test_F3^     8r+  c                   C   s@   t dt tt tdt d tdtf tdt ksJ d S r*  )rh   r   r"   r   r   r   r   r   r   test_F4c     @r-  c                   C   sN   t ttdd tt tt tdt ddt   ttd  ks%J d S Nr   r   )rG   r   r   r7   r   r"   r   r   r   r   test_F5h  r&  r0  c                  C   sH   dd t dD } ddidddddidddddig}| |ks"J d S )Nc                 S   s   g | ]}|  qS r   )copy).0pr   r   r   
<listcomp>n      ztest_F6.<locals>.<listcomp>r   r   )r   r   r   )r   r   r~   )ZpartTestZpartDesiredr   r   r   test_F6m  s   &r6  c                   C   r   )Nr   r   )r'   r   r   r   r   test_F7s     r7  c                   C   s   t dddddksJ d S )Nr   r   T)signedirr   r   r   r   r   test_F8w  r   r:  c                   C   r   )Nr   i@  )r&   r   r   r   r   test_F9{  r8  r;  c                   C   s   t tddddgksJ d S )N/B iDB iCB )listrW   r   r   r   r   test_G1  s   r>  c                   C   r	  )Nz$find the primitive root of 191 == 19r
  r   r   r   r   test_G2  r  r?  c                   C   r	  )Nz,(a+b)**p mod p == a**p + b**p mod p; p primer
  r   r   r   r   test_G3  r  r@  c                   C   sX   t td dtddksJ ttdd tttdd tddks*J d S )Nr   r      c                 S   s
   | j dkS )Nr   )qr   r   r   r   <lambda>  s   
 ztest_G15.<locals>.<lambda>r  )	r   r7   r  limit_denominatorr   r=  r   cf_ccf_ir   r   r   r   test_G15  s   $ rH  c                   C   s"   t tttdg dksJ d S )Nr   )
r   r   r   r   i$  r   r   r   r   r   )r=  r   rG  r   r   r   r   r   test_G16     "rI  c                   C   s    t ddddg dgksJ d S )Nr   r   r   r   )r   r   r   r   )cf_pr   r   r   r   test_G17  r   rL  c                   C   sB   t ddddggksJ tdgg tjtdd  ksJ d S )Nr   r   r   )rK  cf_rr   r   Halfr7   r   r   r   r   test_G18  s   *rO  c                  C   sf   t dddd} ttd|  d td|  d  }tt|ddd|  d|  d	|  d
|  gks1J d S )NsTr   positiver   r   r   r   r   r   r   )r   rG  r-   r=  r   )rP  itr   r   r   test_G19  s   $4rT  c                  C   s:   t dddd} td|  gg| t| d d  ksJ d S )NrP  TrQ  r   r   )r   rM  r7   rP  r   r   r   test_G20  s   ,rV  c                  C   s6   t dddd} t| d| d d d|  ggksJ d S )NrP  TrQ  r   r   )r   rK  rU  r   r   r   	test_G20b  s   (rW  c                   C   sL   t ddt  t dtd  ksJ tddt  t dtd  ks$J d S r*  )rn   r   rj   r   r   r   r   test_H1  s   $(rX  c                   C   s$   t ddt  dtd  ksJ d S )Nr   r   )rk   r   r   r   r   r   test_H2     $rY  c                   C   s   dt t d   dksJ d S Nr  r   r   r   r   r   r   test_H3  r   r]  c                  C   sP   t dt d } t| tu sJ | jd dksJ | jd dt d ks&J d S )Nr   r   r   r   r   r   r   )r\   r   typer   args)exprr   r   r   test_H4  s   ra  @   r      r   ~   r   .   r   r   <   Q   r     r   r   r   '   S   4   6   r   F   r      r   [   V   c                   C   s   t tttdks
J d S Nr   )r]   p1p2r   r   r   r   r   test_H5  r  rt  c                   C   s&   t ttt ttt tksJ d S r   )r]   r   rr  rB  rs  r   r   r   r   test_H6  r  ru  c                  C   s   dt  td  td  dt d  td  td   dt d  td	  td
   dt d   d } dt d  td  td  dt d  td  td   dt d	  td  td   dtd  t  }t| |t ttdksnJ d S )Nr  r   r   r   r   r   r   r   r   r   r   r   r   r   rn  r   r   r   r   P   r   r   r   yzr]   rr  rs  r   r   r   test_H7  s   `dr{  c                  C   s<  dt  td  td  dt d  td  td   dt d  td	  td
   dt d   d } dt d  td  td  dt d  td  td   dt d	  td  td   dtd  t  }dt d  td  td  dt d
  td  td   dt d  td  td   }t| | || t tt|ksJ d S )Nr  r   r   r   r   r   r   r   r   r   r   r   r   r   rn  r   r   r   r   rv  r   r   r   r   rw  )rr  rs  rB  r   r   r   test_H8  s   `dT$r|  c                  C   s^   t ddd} d| td   | td   }d| td   d| t   }t||| t ks-J d S )Nr   F)zeror   r   r   r   )r   r   r]   )r   rr  rs  r   r   r   test_H9  s   r~  c                  C   s\   dt d  dt d   t d  t  d } t d dt d   t  d }t| |t dks,J d S )Nr   r   r   r   r   )r   r^   rz  r   r   r   test_H10  s   (r  c                   C   s    t tt tt tdksJ d S Nr   )r^   rr  rB  rs  r   r   r   r   r   test_H11  r   r  c                  C   sD   t d d } t d dt   d }t| | t d t d  ks J d S )Nr   r   )r   rn   )r  Zdenr   r   r   test_H12  s   $r  c                   C   s8   t ttd ttd d  ttd d ksJ d S r/  )rn   r-   r   r   r   r   r   test_H13  r,  r  c                  C   s   t d d } t| }|ddt   dt d   dt d   dt d   d	t d
   dt d   dt d   dt d   dt d   dt d   dt d   dt d   dt d   dt d   d	t d   dt d   dt d   dt d   dt d   t d  ksJ t|t }|ddt   dt d   d t d   dt d   d!t d
   d"t d   d#t d   d$t d   d%t d   d%t d   d$t d   d#t d   d"t d   d!t d   dt d   d t d   dt d   dt d   dt d   ksJ t|ddt  d  ksJ d S )&Nr   rn     r   it  r   i  r   i<  r   ih  r   i. r   i r   i r   i r   r   r   r   r   r   r   r      r   i|  i\  iK  ip iG i` i i1 )r   r   r   r\   )r3  epdepr   r   r   test_H14  s   <















0















"r  c                   C   sF   t tdd ttd td  d D  td td  d ks!J d S )Nc                 S   s   g | ]}t | qS r   rC  )r2  rr   r   r   r4    r5  ztest_H15.<locals>.<listcomp>r   r   r   )rn   r   r   r   r   r   r   r   test_H15     Fr  c                   C   s  t td d td td  td d  td td  td  t d  td td  td  t d  td td  td  td  d  td td	  td
  td  d  td td	  td
  td  d  td td  td  td
  d  ksJ d S )Nd   r   r   r   r   r   r   rn  r   r   r   (      r\   r   r   r   r   r   test_H16  s2   6""r  c                   C   s(   t tttt tt  dksJ d S r  )rn   r\   r   rr  rs  r   r   r   r   test_H17     (r  c                  C   s   t dtd  dtd   dtd   dt  d } dt dt  dt dt   td dt   td dt   }| |ks@J d S )	Nr   r   r   M   r   r     r   )r\   r   r   r   r   r   r   test_H18!  s   4@r  c                  C   s6   t d} t| d t| d d | d ksJ d S )Nar   r   )r   r[   r   r  r   r   r   test_H19)  s   .r  c                   C   r	  )NzXlet a**2==2; (x**3 + (a-2)*x**2 - (2*a+3)*x - 3*a) / (x**2-2) = (x**2 - 2*x - 3) / (x-a)r
  r   r   r   r   test_H20/  r  r  c                   C   r	  )Nzuevaluate (b+c)**4 assuming b**3==2, c**2==3.                               Answer is 2*b + 8*c + 18*b**2 + 12*b*c + 9r
  r   r   r   r   test_H215  r  r  c                   C   s@   t td dtd   d ddtd d td d  ksJ d S )Nr   r   r   r   r   modulusr  r   r   r   r   test_H22;     @r  c                  C   sl   t d t  d } t d t  d t d t d  t d  t d  t d  t d  d  }t| d	d
|ks4J d S )Nr   r   r   r   r   r   r   r   i  r  )r   r\   r   r   r   r   r   test_H23?  s   Dr  c                  C   sf   t tjjdddd} ttd dtd   d | d	t|  td |   td |   t|   ks1J d S )
NT)funcphi)aliasr   r   r   r   	extension)r   r   ZGoldenRatior   r\   r   )r  r   r   r   test_H24E  s   &r  c                  C   s8   t dtd   dtd   d } tt| | ksJ d S )Nr   r   rn  r   rx  ry  r\   r   )er   r   r   test_H25K  s    r  c                  C   sr   t ttdttd   dttd   d } t| ddtt dttd   dttd   d ks7J d S )Nr   r   rn  F)r   )r   rA   r   r=   rx  rB   ry  r\   )r   r   r   r   test_H26P  s   0Br  c                  C   s  dt  td  td  dt d  td  td   dt d  td	  td
   dt d   d } dt d  td  td  dt d  td  td   dt d	  td  td   dtd  t  }dt td  dt d	  td	  td  dt d  td   dt t d  td   dtd    dt d  dt d  td  td   dt d  td	  td
   dt  td  td   d  }tt| | |ksJ d S )Nr  r   r   r   r   r   r   r   r   r   r   r   r   r   rn  r   r   r   r   rv  r   r   r   r  r  )r   r   hr   r   r   test_H27U  s   `dR^r  c                   C   r	  )Nzgexpand ((1 - c**2)**5 * (1 - s**2)**5 * (c**2 + s**2)**10) with c**2 + s**2 = 1. Answer is c**10*s**10.r
  r   r   r   r   test_H28^  r  r  c                   C   sD   t dtd  dt t  dtd   ddtt tt  ks J d S )Nr   r   rc  rn  r   r  )r\   r   rx  r   r   r   r   test_H29d     Dr  c                  C   s|   t td td  tdd} tt tttdd tdd t     tttdd tdd t     }|| ks<J d S )Nr   r  r   r   )r\   r   rx  r7   r   r   )r   answerr   r   r   test_H30i  s   Pr  c                  C   sp   t d dt   d t d dt d   dt   d  } dt d d  dt d   dt d   }t| |ks6J d S )Nr   r   r   r   r   )r   rZ   r  r   r   r   test_H31o  s   4(r  c                   C   r	  )Nzp[A*B*C - (A*B*C)**(-1)]*A*C*B (product                               of a non-commuting product and its inverse)r
  r   r   r   r   test_H32u  r  r  c                  C   sV   t ddd\} }}t| t||t|t||  t|t| |   dks)J d S )NzA, B, CF)commutativer   )r   r   doitr   )ABCr   r   r   test_H33{  s   
r  c                   C   s0   t ttdd tddtd   ksJ d S )Nr   r   r   r   r   )rB   r   r   r7   r   r   r   r   test_I1     0r  c                   C   s&   t dtd d td ksJ d S )Nr   r   r   r   )r7   r=   r   r   r   r   test_I2     &r  c                   C   s8   t tt tdt d t d  dt d ksJ d S )Nr   r   r   r  )r=   r   r   rA   r   r   r   r   test_I3  r   r  c                   C   sL   t ttttt  ttd ttt   ttdt d ks$J d S )Nr   r  r   )r   r=   r   r   rA   r   r   r   r   r   r   test_I4  s   Lr  c                   C   s@   t td d td d  td d  td  t dksJ d S )Nr   r   r   r   r  r   )rA   r   r   r   r   r   r   test_I5  r.  r  c                   C   r	  )NzHassuming -3*pi<x<-5*pi/2, abs(cos(x)) == -cos(x), abs(sin(x)) == -sin(x)r
  r   r   r   r   test_I6  r  r  c                   C   8   t dt t t t td dttd   ksJ d S Nr   r   r=   r   rA   r   r   r   r   test_I7  r,  r  c                   C   s0   t dt t t dt dt  d ksJ d S )Nr   r   r   )r=   r   r   r   r   r   test_I8     0r  c                   C   r  r  r  r   r   r   r   test_I9  s   8r  c                   C   sH   t ttd d ttd  ttd ttd  d  tu s"J d S Nr   r   r   )rp   rB   r   r=   rA   r   r   r   r   r   test_I10     Hr  Zhangsc                   C   sL   t ttd d ttd  ttd ttd  d  tddks$J d S )Nr   r   r   r   )r_   rB   r   r=   rA   r   r   r   r   test_I11  s   Lr  c                  C   sN   t ttd d ttd  ttd ttd  d  t} | tu s%J d S r  )r   rB   r   r=   rA   r   )resr   r   r   test_I12  s   >r  c                   C   s   t dtddksJ d S )Nr   ii  )r$   r   r   r   r   r   test_J1  r   r  c                   C   s<   t tttd ttttd tttd  t ksJ d S Nr   )r   rE   r   rx  rF   r   r   r   r   test_J2     <r  c                   C   r	  )NzDJacobi elliptic functions: diff(dn(u,k), u) == -k**2*sn(u,k)*cn(u,k)r
  r   r   r   r   test_J3  r  r  c                   C   s"   t tdddtt ksJ d S )Nr  r   r   )rG   r   r7   r   r   r   r   r   test_J4  rJ  r  c                   C   sB   t dtddtd tdt d  t ttd ksJ d S )Nr   r   r   r   )rH   r   r.   r7   r   r   r   r   r   r   test_J5  s   Br  c                   C   s    t ddtddsJ d S )Nr   y      ?      ?z0.04157988694396212z0.24739764151330632)mpmathrC   r  r   r   r   r   r   test_J6  r   r  c                   C   s,   t ttddtd dtd  ksJ d S )Nr   r   r   )rn   rC   r   r   r   r   r   r   test_J7  r   r  c                  C   sP   t tddt} ttt tt ttt d  }tt| | dks&J d S Nr   r   r   )	rC   r   ry  rA   r=   r7   r   rn   r   )r3  rB  r   r   r   test_J8  s   $r  c                   C   s$   t dttt dt ksJ d S )Nr   r   )rC   ry  r   r   r   r   r   test_J9  rZ  r  c                  C   s^   t ddd\} }t|| dd|  tt t||  d d  t| |  d d  ks-J d S )Nzmu, nuTr   r   r   r   )r   rJ   r7   r   rG   )munur   r   r   test_J10  s   Nr  c                   C   sH   t tddtt tdd tdtd   dtd  d  ks"J d S )Nr   r   r   r   )rn   rJ   r   r   r7   r   r   r   r   test_J11  r  r  c                   C   s6   t tdtdt tdt  tdt dksJ d S )Ni  r   i  i  r   )rn   rK   r   r   r   r   r   test_J12  r   r  c                  C   s(   t dddd} t| dd|  ksJ d S )Nr  TF)r   negativer  )r   rK   r  r   r   r   test_J13  s   r  c                  C   s<   t tjtjgtddgtd } t| ttt ksJ d S r  )rI   r   rN  r   ry  ri   r;   )r3  r   r   r   test_J14  s    r  c                   C   r	  )NzcF((n+2)/2,-(n-2)/2,R(3,2),sin(z)**2) == sin(n*z)/(n*sin(z)*cos(z)); F(.) is hypergeometric functionr
  r   r   r   r   test_J15  r  r  c                   C   r	  )Nz&diff(zeta(x), x) @ x=0 == -log(2*pi)/2r
  r   r   r   r   test_J16  r  r  c                   C   sv   t ttd d ttd d  tttttd t  tddfdttdd ttttttd ks9J d S )Nr   r   r   r   r   r   )	r   r   r   rD   r   r   r   r   r   r   r   r   r   test_J17  s   vr  c                   C   r	  )Nz define an antisymmetric functionr
  r   r   r   r   test_J18  r  r  c                  C   s^   t ddd\} }t| t|  t| t|  ksJ t| t|  t| t| ks-J d S )Nzz1, z2Tr   )r   r*   r   r)   )Zz1Zz2r   r   r   test_K1  s   &(r  c                   C   s4   t dtd ttdtd d   dksJ d S )Nr   r   r   r   r   )absr7   r   r   r   r   r   test_K2  s   4r  c                  C   sX   t ddd\} }ttd| t|   t|   dt| d t|  | d   ks*J d S )Nza, bTrealr   r   )r   rn   r  r   r7   r  br   r   r   test_K3   s   Hr  c                   C   s:   t ddt  jddt dtttdd  ksJ d S )Nr   r   Tr   r   )r.   r   r   r<   r   r   r   r   r   test_K4&     :r  c                  C   s|   t ddd\} }t| t|  jddtd|  td|  td|   ttd|  td|  td|    ks<J d S )Nzx, yTr  r   r   )r   rB   r   r   rA   r=   r0   r1   r   rx  r   r   r   test_K5*  s   *
&r  c                   C   sx   t tt ttd  t ttt  t tt t t ks J t tt ttd  t ttt  t tks:J d S r  )r7   r   rx  r  ry  r   r   r   r   test_K60  s   @8r  c                  C   sR   t dddd} tt|  ttd  tttt  }t|}|t| ks'J d S )Nrx  TF)r  r  r   )r   r7   r   r  ry  rn   )rx  r`  Zsexprr   r   r   test_K75  s   (r  c                  C   sf   t ddd} ttd|  dt|   dksJ t dddd} ttd|  dt|   dks1J d S )Nry  Tr   r   r   F)r   r  r   rn   r7   ry  r   r   r   test_K8<  s   $(r  c                  C   s4   t ddd} ttd|  dt|   dksJ d S )Nry  TrR  r   r   r  r  r   r   r   test_K9C     (r  c                  C   s4   t ddd} ttd|  dt|   dksJ d S )Nry  T)r  r   r   r  r  r   r   r   test_K10H  r  r  c                   C   "   t ddtdd  dksJ d S )Ni  i;r   r   r   r7   r   r   r   r   r   test_L1Q  rJ  r   c                   C   r  )Nr<  l   ^|E!or   r   r   r  r   r   r   r   test_L2U  rJ  r  c                   C   sT   t dtdd dtdd  d ddtdd dtdd    d dks(J d S )Nr   r   r   r   r   r   )rn   r   r   r   r   r   test_L3Y  s   Tr  c                   C   s8   t ttd ttttd   tt dksJ d S r  )rp   r=   r   rA   r   r   r   r   test_L4]  r   r  c                   C   s6   t ttddt td  ttt dksJ d S )Nr   r   r   r   )r.   rB   r   r   r   r/   r   r   r   r   test_L5a  r   r  c                   C   s@   t ttd td  ttt ttdidksJ d S )Nr   r   r   )r.   rB   r   r   r/   r   subsr   r   r   r   test_L6f  r  r  c                   C   s@   t tdtt d tdt dtt  d  dksJ d S )Nr   r   r   r   )rn   r.   r7   r   r   r   r   r   test_L7j  r.  r  c                   C   st   t dt dtt  d ttdtt d   dtt d ddtt d    dtt  d dks8J d S )Nr   r   r   r   )rn   r   r7   r   r   r   r   test_L8o  s   0"
r  c                  C   s\   t ddd} tdd|   t|  t|  t| t d  td td|    dks,J d S )Nry  Tr   r   r   r   )r   rn   rG   rx   r=   r   r  r   r   r   test_L9u  s   Pr	  c                   C   s2   t tdd t dd t td d dksJ d S r*  )r   r   r   r   r   r   test_M1}  s   2r
  c                  C   sD   t dtd  dtd   dt  d t} tdd | D s J d S )Nr   r  r   !   r   c                 s   s    | ]
}|j d djV  qdS )Tr   N)r   Zis_real)r2  rP  r   r   r   	<genexpr>  s    ztest_M2.<locals>.<genexpr>)r   r   all)solr   r   r   test_M2  s   *r  c                   C   s   t td dtd   dtd   dtd   dt  d ttd	td d	td td
 d
 ttd d  td
 d
 ttd d  td d
 ttd d  td d
 ttd d  ksfJ d S )Nr   r   r   r      r   $   r   gr(?gr(?g<n=e?)r   r   rd   r7   r   r   r   r   r   test_M5  s   r  c                   C   s2   t ttd d tdd tddD ksJ d S )Nr   r   c              	   S   s<   h | ]}t |t td d tt|t td d   qS )r   r   )r=   r   r   r   rA   r2  r   r   r   r   	<setcomp>  s   < ztest_M6.<locals>.<setcomp>r   )setr   r   r   r   r   r   r   test_M6  s   r  c                   C   s  t ttd dtd   dtd   dtd   dtd   d	td
   dtd   dt  d tdtdt ttddtd
   d
  d  dtdtdttd
dtd
     d  dtdt ttddtd
  d
  d  dtdtdttd
dtd
     d  dtdt ttddtd
  d
  d  dtdtdttd
dtd
     d  dtdtdttd
dtd
     d  dtdt ttddtd
   d
  d  hksJ d S )Nr   r   r   r   \   r      r      r      r      re  r   r  )r  rq   r   r7   r   r   r   r   r   test_M7  s&   F
0......0r  c                  C   s   t d} tddd}ttd|  dt|   d | | tjttd| dt|  d td| dt|  d ks>J d S )Nr   ry  Tr   r   r   )	r   r   r   r-   r   Realsrd   r.   r7   )r   ry  r   r   r   test_M8  s
   (8r  c                   C   r	  )Nz6solveset(exp(2-x**2)-exp(-x),x) has complex solutions.r
  r   r   r   r   test_M9     r  c                   C   s&   t ttt ttd gksJ d S )Nr  )rq   r-   r   r,   r   r   r   r   test_M10  r  r!  c                   C   s$   t tt t ttddksJ d S r[  )r   r   rd   r   r   r   r   test_M11  s   $r"  c                   C   s   t td ttd d d  tdt d  tdtd td t tdtd  ttdtd  tttdtd   tttdtd   gksMJ d S )Nr   r   r   r  r   )rq   r   rA   r=   r   r   r.   r7   r   r   r   r   test_M12  s
   0&,r#  c               	   C   sJ   t d} ttttt ttt| | t ttdd  t	j
ks#J d S )Nr   r   r   )r   r   rA   r   r=   rc   r
   r   r   r   Integersr\  r   r   r   test_M13  s   Br%  c                  C   s@   t d} tttd ttt| | t td  tjksJ d S )Nr   r   r   )	r   r   rB   r   rc   r
   r   r   r$  r\  r   r   r   test_M14  s   8r&  c                     s   t d} ttttj  t fddttt	| d|  t
 t
d  tjtt	| d|  t
 t
tdd  tjttt	| d|  t
 t
tdd  tjtt	| d|  t
 t
d  tjfD sdJ d S )Nr   c                 3   s    | ]}  |V  qd S r   )Zdummy_eq)r2  r   gotr   r   r    s    ztest_M15.<locals>.<genexpr>r   r   r   )r   r   rA   r   r   rN  anyrg   rc   r
   r   r$  r   r\  r   r'  r   test_M15  s   "&( r*  c                  C   s<   t d} ttttt ttt| | t tj	ksJ d S )Nr   )
r   r   rA   r   rB   rc   r
   r   r   r$  r\  r   r   r   test_M16  s   4r+  c                   C   s&   t tttt ttdksJ d S r  )r   r;   r   r<   rd   r   r   r   r   test_M17  r  r,  c                   C   s6   t tttt ttttdd d ksJ d S )Nr   r   r   )r   r9   r   r<   rd   r7   r   r   r   r   test_M18  r   r-  c                   C   s*   t td ttdd  tdgksJ d S Nr   r   r   )rq   r   r   r   r   r   r   test_M19  s   *r/  c                   C   s*   t ttd d t d ttksJ d S r*  )r   r7   r   EmptySetr   r   r   r   test_M20  s   *r1  c                   C   s$   t ttt d tdksJ d S r*  )r   r   r7   rd   r   r   r   r   test_M21  rZ  r2  c                   C   s<   t dtt dttdd   d ttddksJ d S )Nr   r   r   r   r   )r   r7   r   r   rd   r   r   r   r   test_M22  r  r3  c                  C   sf   t ddd} t| dtd| d    t ttjtdd   ttddtdd  gks1J d S )Nr   Tr   r   r   r   r  )r   rq   r7   r   r   rN  r   rC  r   r   r   test_M23  s   2r4  c                  C   sN   t dttddt   t} tdttd   d}| d  | ks%J d S Nr   r   r   )rq   r!   r   r   r.   r   )solutionr  r   r   r   test_M24  s   r7  c                  C   sf   t ddd\} }}}t d}t| ||  |||   |d  t||  t||   ks1J d S )Nz:dTr  r   r   )r   rq   r   r.   )r  r  cdr   r   r   r   test_M25  s   Jr:  c                   C   s0   t tttttt dtdgksJ d S )Nr   r   )rq   r7   r.   r   r-   r   r   r   r   test_M26  r  r;  c                  C   sp   t ddd} t ddd}tttt| tdd | d d | |tttdd  tdd gks6J d S )	Nr   Tr  r  r   r   r   r   )	r   rq   r.   r9   r;   r   rA   r=   r-   )r   r  r   r   r   test_M27   s
   *"r<  c                   C   sD   t dt ttd d  dtd   tttdg dks J d S )Nr   r   r   r   )Zassume)gOqg0eg?)r   r   r-   r   r  r   r   r   r   test_M28*  r  r=  c                  C   s4   t d} tt| d d tjdtddksJ d S )Nr   r   r   domainr  r   )r   r   r  r   r  rd   rC  r   r   r   test_M29/     ,r@  c                   C   s4   t tdt d ttd  ttddksJ d S )Nr   r   r  )r   r  r   rd   r   r   r   r   test_M304     4rC  c                   C   sD   t dtt tt d td  tttddtddks J d S )Nr   r   r  r   )r   r  r   r5   rd   r   r   r   r   r   test_M31;  s   DrE  c                   C   s>   t tdtd  ttt td d  ttddksJ d S )Nr   r   r   r  r   r5   r   rd   r   r   r   r   test_M32B  s   >rG  c                   C   s8   t tdtd  ttd d  ttdddksJ d S )Nr   r   r   r  g,rF  r   r   r   r   test_M33I  s   8rH  c                  C   sN   t ddd} tdt |  dt t|   dt  | tddt  ks%J d S )Nry  Tr   r   r   r   )r   r   r   r(   rd   r  r   r   r   test_M34R  s   BrI  c                  C   sL   t ddd\} }td|  d|  t|  dt   || tdks$J d S )Nx yTr  r   r   )r   r   )r   r   r   Zas_real_imagrd   r  r   r   r   test_M35X  s   <rK  c                   C   s4   t ttd tt d tttddksJ d S )Nr   r   r   )r   r   r   rd   r   r   r   r   test_M36]  rD  rL  c                   C   s`   t tt t d dt t dt  d tdt  t d gttttt d dtfks.J d S )Nr   r   r   r   r   )r   r   rx  ry  rd   r   r   r   r   test_M37d  s   BrM  c            8   1   C   s  t d\} }}t| ||gt }td|}|j\1}}}}}	}
}}}}}}}}}}}}}}}}}}}}}} }!}"}#}$}%}&}'}(})}*}+},}-}.}/}0}1}2}3}4}5g | | |  || |   | | |  || |   | | |  || |   | | || |   || |   | | |  || |   | | |  || |   | | |  || |   | | | |  || |   | | |  || |   | | | |  || |   || |   || |   ||	 |   ||	 |   ||0 |  ||0 |   | |1 |  ||1 |   | | |  || |   | |0 |  ||0 |   ||2 |  ||2 |   |d |3 | d  d| | |3 | d   |d |3 | d   || | | |  || |   | |
 |  ||
 |  | | |  || |   | | |  || |  ||1 |  ||1 |   | |2 |  ||2 |   |4 ||4 |   ||4 |  |d |4 | |   |5 ||5 |   ||5 |  |d |5 | |   | | | || |  | | | || |  | | | || |  | | | | |  || |  | | | || |  | ||| |  || |   | |
 |  ||
 |  | | | || |  || | |  || |  | | | |  || |  | | | || |  |  | | || |  | | |  || |  | |	 |  ||	 |  |  |0 | ||0 |  | |1 | ||1 |  | | | || |  | | |  || |  | |0 | ||0 |  |  |2 | ||2 |  |3 ||3 |   ||3 |  |d |3 | |   | | | || |  |  |1 | ||1 |  | |2 | ||2 |  | d |4 |d  d|  | |4 |d   |d |4 |d   |5 | |5 |  | |5 |  | d |5 ||   || |  | | || |  | | | |  || |  |  | | || |  || | |  || |  || |  || |   | | |  || |  |  |
 | ||
 |  |  | | || |  |  | | || |  | |  | | || |  | |  | | || |  |  | | || |  | | |  || |  |  | | || |  | | |  || |  | |	 |  ||	 |  | |0 | ||0 |  |  |1 | ||1 |  |  |0 | ||0 |  | |2 | ||2 |  |3 ||3 |   ||3 |  |d |3 | |   |  | | || |  | |1 | ||1 |  |  |2 | ||2 |  |4 | |4 |  | |4 |  | d |4 ||   | d |5 |d  d|  | |5 |d   |d |5 |d   ||| || | || |! ||$ | | |# | |" |' |0|1 |(|| |+ | |* ||) || |  || |   |& |. d|0 |1|2||3 |  ||3 |   |-|0|2 | |3 |  ||3 |   || | | |  | | || |  |% |1|2 |  |4 | ||4 |  | |  | ||  |  |, |1 |2| |4 | ||4 |  | |5 | ||5 |  |  |5 | ||5 |  | | | ||| ||||| ||" || |# | |0 |1|" |
 ||$ |||% |   ||% |   |0|2 | |3 |  ||3 |   |( |#|+ |	 |$ |* ||) || |& |  ||& |  |. |0d|1 |2| |4 | ||4 |  | |' | ||' |  |- |0 |2||3 |  ||3 |   |  |5 | ||5 |  |, |1|2 |  |4 | ||4 |  | |5 | ||5 |  |||| | | | | |)| | |* | | |) | |
 | | |+ |  ||, |   ||, |   |0|1 | |0 |2||3 |  ||3 |   |!|$|* |#|+ |	 | |" |'| |- |  ||- |  |0 |1| |& | |. |  ||. |  |0|1d|2 | |3 |  ||3 |   |  |4 | ||4 |  | |5 | ||5 |  |%|1 |2| |4 | ||4 |  |  |5 | ||5 |  }6i |5d|4d|3d|2d|1d|0d|-d|,d|*d|)d|(d|'d|%d|$d|"d|!d| di |d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|
d|	d|d|d|d|d|&|| |. |#|+|| | |. ||+i}7t|6||7ksJ d S )Nza, b, czk1:50r   r   r   )r   r   rX   Z	to_domainr   Zgensr   )8r  r  r8  r?  ringZk1Zk2Zk3Zk4Zk5Zk6Zk7Zk8Zk9Zk10Zk11Zk12Zk13Zk14Zk15Zk16Zk17Zk18Zk19Zk20Zk21Zk22Zk23Zk24Zk25Zk26Zk27Zk28Zk29Zk30Zk31Zk32Zk33Zk34Zk35Zk36Zk37Zk38Zk39Zk40Zk41Zk42Zk43Zk44Zk45Zk46Zk47Zk48Zk49systemr6  r   r   r   test_M38i  s  
H>0000					.


H.0>0.0H00>


     !!!!!!!!!""""""""#######$$$
$$$%% %%%%%&&&&&&') 	rP  c                  C   s  t ddd\} }}t| d | d| |  d d| d  | d|d   d d| |d  |d  d g|d|d| d	i|d|d| di|tdt |tddtdt d  | td	tdt   i|tdt |tddtdt d  | td	tdt  i|td t |tddtdt d  | td	tdt   i|td t |tddtdt d  | td	tdt  igksJ d S )
Nr   Tr   r   r   r   r  r   r  )r   rq   r7   r   r   r   rx  ry  r   r   r   test_M39  s   X><@>rR  c                   C   s   t tt tt ksJ d S r   )r   r   r   r   r   r   r   test_N1  r   rS  c                  C   sP   t ddd} t| d |  d dkdu sJ t| d |  d dkdu s&J d S )Nr   Tr  r   r   r   Fr   r   rC  r   r   r   test_N2  s    $rU  c                  C   s8   t ddd} tttd| t| dt| dk sJ d S )Nr   Tr  r  r   )r   r   rN   r   r  rC  r   r   r   test_N3  s   ,rV  c                  C   sF   t ddd\} }td| d  d|d  k| |k|dk@ du s!J d S )NrJ  Tr  r   r   rT  r  r   r   r   test_N4  s   6rW  c                  C   sP   t ddd\} }}t|| d  ||d  k| |k|dk@ |dk@ du s&J d S )Nzx y kTr  r   r   rT  )r   rx  r   r   r   r   test_N5  s   >rX  c                  C   sZ   t ddd\} }}}t|| |  |||  k| |k|dk@ |dk@ |dk@ du s+J d S )Nzx y k nTr  r   rT  )r   rx  r   r   r   r   r   test_N6  s   FrY  c                  C   s:   t ddd\} }t|dk| dk|| d k@ du sJ d S )NrJ  Tr  r   r   rT  r  r   r   r   test_N7  s   *rZ  c                  C   sH   t ddd\} }}tt| |t||@ | |k||k@ || k@ s"J d S )Nr   Tr  )r   r   r   rQ  r   r   r   test_N8  s   r[  c                  C   sH   t d} tt| d dktjdttt dddtdtdks"J d S )	Nr   r   r   r>  r  FTr   )r   r   r  r   r  rg   rf   r   rC  r   r   r   test_N9  s   (
r\  c               	   C   sz   t d} | d | d  | d  | d  | d  }tt|dk tjdttt dd	d	tddd	d	tddd	d	ks;J d S )
Nr   r   r   r   r   r   r   r>  T)r   r   r   r   r  rg   rf   r   )r   r3  r   r   r   test_N10  s   ($r]  c                  C   sF   t d} td| d  dktjdttt dddtdtks!J d S )Nr   r   r   r>  Tr   )r   r   r   r  rg   rf   r   rC  r   r   r   test_N11  s   >r^  c                  C   s4   t d} tt| dk tjdtddddksJ d S )Nr   r   r>  r   r   FT)r   r   r7   r   r  rf   rC  r   r   r   test_N12  rA  r_  c                  C   s,   t d} tt| dk tjdtjksJ d S )Nr   r   r>  )r   r   rA   r   r  rC  r   r   r   test_N13  s   $r`  c                  C   sP   t d} tt| dk | tjdttt td ddttd tddks&J d S )Nr   r   r>  r   T)	r   r   rA   r   r  rg   rf   r   r   rC  r   r   r   test_N14  s   *ra  c                  C   s:   t d\} }ttd|  t|d  d dk| tj d S )Nr tr   r   )r   r   r  r=   r   r  r  tr   r   r   test_N15  s   .re  c                  C   sB   t d\} }t| d t|d d  t|d  dk | tj d S )Nrb  r   r   r   )r   r   r=   rA   r   r  rc  r   r   r   test_N16  s   6rf  c                   C   s6   t tt dktt dk fttftttk ksJ d S r  )r   r   rx  r  r   r   r   r   test_N17  s   6rg  c                  C   s:   t dt ddt f} tt| | jtdksJ d S )Nr   r   r   r   )r   r   r7   r   dotHMr   r   r   test_O1  s   $rl  c                   C   s.   t dt dt dgdgdggksJ d S )N)r   r   r  )r   r   r   r   r   r   )r   crossr   r   r   r   test_O2$  s   rn  c                   C   r	  NzfThe vector module has no way of representing
        vectors symbolically (without respect to a basis)r
  r   r   r   r   test_O3+  r!  rp  c                  C   s   ddl m} m} | d}| }| \}}}| \}}}	||| |	  ||| |	 d   ||d |	d    }
||
 d|d  |d  |	 d| |	d   | || |  d| |d  |	d  ||	  |  kspJ d S )Nr   )
CoordSys3DDelr   r   r   r   )Zsympy.vectorrq  rr  Zbase_vectorsZbase_scalarsrm  r  )rq  rr  r   Zdelopr   r   r   r   rx  ry  Fr   r   r   test_O41  s   8rrt  c                   C   r	  ro  r
  r   r   r   r   test_O5:  r!  ru  c               	   C   s   t g dt g dt g dg} t| t dgdgdggt tddgtd	dgtd
dggt tddgtddgtddgggksFJ d S )N)r   r   r   )r   r   r   )r   r   r   r   r   r   r   r   ?   ii  ia  ii  iY)r   r   r   )Lr   r   r   test_O10C  s"   "





rx  c                   C   s.   t dddd dt ddddgksJ d S )Nr   c                 S   s   ||  S r   r   )r   r   r   r   r   rD  T      ztest_P1.<locals>.<lambda>r  r   r   )r   Zdiagonalr   r   r   r   test_P1S  s   
rz  c                  C   sN   t g dg dg dg} | d | d | t ddgddggks%J d S )N)r   r   r   )r   r   r   )r   r   r   r   r   r   r   )r   Zrow_delZcol_delrj  r   r   r   test_P2X  s   


r{  c               
      s   t g dg dg dg dg} | ddddf }| d	 }| }| dd
d
df  }| d  }t||ggj}| |g||gg tt fdd t  }|t g dg dg dg dg dg dg dgkskJ d S )N)r   r   r   r   )rc  r   r   r  )r   r  r  r   )r   *   r   ,   r   r   r   r   ))r   r   r   )r   r   r   r   ))r   r   )r   r   c                      s   t  S r   )r   r   rowsr   r   rD  n  ry  ztest_P3.<locals>.<lambda>)r   r   r   )ir$  r   rc  r  )iiir   r   r}  )r   r   r   r   r  r  )rc  r   r   r  r  r$  )r   r  r  r   r  )r   r|  r   r}  ir  )r   r   Tr}   
ValueError)r  A11A12ZA21ZA221ZA222A22r  r   r~  r   test_P3`  s0   
r  c                   C   r	  )Nz*Block matrix diagonalization not supportedr
  r   r   r   r   test_P4z  r  r  c                  C   s8   t ddgddgg} | d t ddgddggksJ d S )Nr   r   r   r   r   r   r   r   rj  r   r   r   test_P5  s   r  c                  C   sd   t ttttgtt ttgg} | tdt tt tt gtttt ggks0J d S r  )r   r=   r   rA   r   rj  r   r   r   test_P6  s   r  c                  C   s   t ttggtt g dg dg t g dg dg  } | t ttd  tdt d   tdt d	  td
t d   tdt d  tdt d   ggksQJ d S )N)r   r   r   )r   r   r   )r   r   )r#  r   r  r   r   r   r   r   r   r   r   r   r   r   )r   r   rx  ry  rj  r   r   r   test_P7  s   
<r  c                  C   s6   t ddt gdt dgg} | jtjddksJ d S )Nr   r   r  r   )ordr   )r   r   normr   Infinityrj  r   r   r   test_P8  s   
r  c                  C   s   t ddd\} }}t| ||  d| d| gd| || |  d|  gd| d|  || |  gg}t|d| d |d  |d  t| t| t|  ksRJ d S )Na b cT)Znonzeror   Zfror   )r   r   r\   r  r  r  r  r8  rk  r   r   r   test_P9  s   Fr  c                  C   s^   t dddt  gtddt  dgg} | jt dtddt  gddt  dggks-J d S )Nr   r   r   r   r   r   )r   r   r   ri  rj  r   r   r   test_P10  s   r  c                   C   sP   t ttgdtt gg dtd d  t tdgdt tt gg ks&J d S Nr   r   r  )r   r   rx  invr   r   r   r   test_P11  s   
r  c                  C   sh   t ttgdtt ggd} tt| }t|| | ddt|t tt t gdtggddks2J d S )Nr   ZADJF)evaluater  )r   r   rx  r  r]   tuplerQ   )rk  r8  r   r   r   test_P11_workaround  s   r  c                  C   s~   t dtt} t dtt}t dtt}t| |gttt|gg}t|jt| jd| j | |j gttt|jggks=J d S )Nr  r  r  r  )r   r   r   r   r   r   )r  r  r  r  r   r   r   test_P12  s   "r  c                  C   s   t dtd td gtd td dt  d td dt  d gtd td d dtd  dt  d gg} |  \}}}t|t g dtd dd	gtd td dggksXJ t|t dtd td gd	d
td gd	d	td ggksvJ d S )Nr   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   ZLUdecompositionrn   )rk  rw  U_r   r   r   test_P13  s   ,(r  c                  C   sX   t g dg dg dg dg} |  \}}|t g dg dg dg dgks*J d S )	N)r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   )r   r   r  r   r   )r   r   r   r   r  )r   r   r   r   r   )r   r   r   r   r   )r   Zrref)rk  r   r  r   r   r   test_P14  s   
r  c                  C   s.   t g dg dg dg} |  dksJ d S )N)r  r   r   r   )r   r   r   r   )r   r   r   rB  r   )r   rankrj  r   r   r   test_P15  s
   r  c                  C   s@   t dtd dgdtd dtd gg} |  dksJ d S )Nr   r   r   r  r   r   )r   r7   r  rj  r   r   r   test_P16  s   r  c                  C   st   t ddd} ttd|  td|  gddt| d   t|  ddt| d   t|  gg}| dks8J d S )Nrd  Tr  r   r   )r   r   rA   r=   r  )rd  rk  r   r   r   test_P17  s   6r  c                  C   sZ   t g dg dg dg} |  t dgdgdgdggt dgdgdgdgggks+J d S )	N)r   r   r   r   )r   r   r   r   )r  r   r   r   r   r   r   r  )r   Z	nullspacerj  r   r   r   test_P18  s   r  c               	   C   sF  t d} tg d| tttg| d td td td g| d td td td gg}| | d td  t | d td  t  | d t td   | d t td   | d td  t  | d t td   | d td  t  | d td  t  | d t td   | d t td   | d td  t  | d t td   | td  td   | td  td   | td  td   | td  td   | td  td   | td  td   td td  t  td t td   td td  t  td t td   ttd  td   ttd  td   ks!J d S )Nw)r   r   r   r   r   r   )r   r   r   rx  ry  det)r  rk  r   r   r   test_P19  s^   
Tr  c                   C   r	  )Nz'Matrix minimal polynomial not supportedr
  r   r   r   r   test_P20  r  r  c                  C   sP   t g dg dg dg} | t td dtd   dt  d ks&J d S )N)r   r  rB  )r   r   r   )r   r  r"  r   r   r   r   )r   Zcharpolyr   Zas_exprrj  r   r   r   test_P21  s
   6r  c                  C   s2   d} dt  t|  }| t  d | iksJ d S )Nr  r   )r   r   	eigenvals)r9  rk  r   r   r   test_P22!  s   r  c                  C   sb   t g dg dg dg dg dg} |  tddtddtd	dtd
dtddiks/J d S )N)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   1r   23zsqrt(3) + 2z-sqrt(3) + 2r   r  r   rj  r   r   r   test_P23'  s   r  c                  C   s   t g dg dg dg dg dg dg dg dg} |  td	d
tdd
tdd
tddtdd
tdd
tdd
iks@J d S )Nc     @  r#  r   r    q   r  r  r#  r  r  r  r  =   1   r   rk  r  r  r  r  r   r}  ;   r  r#  r  r  r        r  r  r  r  r}  r  r  r  r  r  r#  r   r  r  r  c   qr   r  rk  r  r  r  r  r  0r   z10*sqrt(10405)z100*sqrt(26) + 510Z1000r   z-100*sqrt(26) + 510z-10*sqrt(10405)Z1020r  rj  r   r   r   test_P246  s$   r  c                  C   s   t tg dg dg dg dg dg dg dg dg} t| jd	d
}tg d}t||D ]\}}t|| dk s?J q1d S )Nr  r  r  r  r  r  r  r  T)Zmultiple)gMcdr  gyP9?     @@r  gx5F27ߏ@g     @gMcd@g-q=)r   r   sortedr  zipr  )ZMFZev_1Zev_2r   rx  r   r   r   test_P25I  s    
	r  c                  C   s   t d\} }}}}t| | | | |  ddddg	g dg dg dg dg dg dg d	g d
g	}|jddtddtddiksFJ d S )Nza0 a1 a2 a3 a4r   )	r   r   r   r   r   r   r   r   r   )	r   r   r   r   r   r   r   r   r   )	r   r   r   r   r   r   r   r   r   )	r   r   r   r   r   r   r   r   r   )	r   r   r   r   r   r  r  r   r   )	r   r   r   r   r   r   r   r   r   )	r   r   r   r   r   r   r   r  r  )	r   r   r   r   r   r   r   r   r   F)Zerror_when_incompletez-1/2 - sqrt(3)*I/2r   z-1/2 + sqrt(3)*I/2)r   r   r  r   )Za0Za1Za2a3Za4rk  r   r   r   test_P26\  s    
	r  c                  C   s   t d} t| ddddgg ddd| ddgddd| dgg dg}| | dtg dtg dtg dgfd	t d	tdd	t d
 ddd	ggfd	t d	tdd	t d
 ddd	ggfgks_J d S )Nr  r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   Z
eigenvectsr   )r  rk  r   r   r   test_P27l  s(   


r  c                   C   r	  NzQGeneralized eigenvectors not supported https://github.com/sympy/sympy/issues/5293r
  r   r   r   r   test_P28  r  r  c                   C   r	  r  r
  r   r   r   r   test_P29  r  r  c                  C   sd   t g dg dg dg dg dg} |  \}}|t g dg dg dg d	g d
gks0J d S )N)r   r   r   r   r  )r   r   r   r   r  )r   r   r  r   r   )r   r  r   r   r   )r   r  r   r  r   )r  r   r   r   r   )r   r   r   r   r   r  )r   r   r   r   r   r  )r   Zjordan_form)rk  r  Jr   r   r   test_P30  s   
r  c                   C   r	  )Nz!Smith normal form not implementedr
  r   r   r   r   test_P31  r  r  c                  C   sd   t ddgddgg} t| t t ttd t td gttd ttd ggks0J d S )Nr   r   r   )r   r-   rewriter=   rn   r   rA   rj  r   r   r   test_P32  s   *r  c                  C   sf  t d\} }tg ddddd|  gg ddd|  d| d  dgg}t|| t tdd	| d
t||   |   d| |  dt||    dt||   |  d|   gdd
t||   d d|  t||   d|   dt||   gddt||   |  d|   d	t||   d
 t||  |  gddt||   d|  t||   t||  ggksJ d S )Nzw t)r   r   r   r   r   r   )r   r   r   r   r   r   r   r  r   r   r  )r   r   r-   r  r=   r   rA   )r  rd  rk  r   r   r   test_P33  s   R>>.r  c                  C   s  t ddd\} }}t| dddddgd| ddddgdd|dddgddd|ddgdddd|dgddddd|gg}t|tt| t| ddddgdt| ddddgddt|dddgdddt|t|t| d gddddt|t|gdddddt|ggksJ d S )Nr  Tr  r   r   r   )r   r   rA   r=   r  r   r   r   test_P34  s    r  c                  C   s:   t d tg dg dg dg } t| tdksJ d S )Nr   )r   r   r   )r   r   r   )r   r   r   r   )r   r   rA   r   rj  r   r   r   test_P35  s
   r  c                  C   s8   t ddgddgg} t| t ddgddggksJ d S )Nr   r   r   r   r   r   )r   r7   rj  r   r   r   test_P36  s   r  c                  C   sN   t g dg dg dg} | tj t dtdddgg dg dgks%J d S )N)r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   rN  r   rj  r   r   r   test_P37  s   r  c                  C   sF   t g dg dg dg} tt | tj  J 1 sw   Y  d S )Nr  )r   r   r   )r   r}   AssertionErrorr   rN  rj  r   r   r   test_P38  s   

r  c                   C   r	  )zQ
    M=Matrix([
        [1, 1],
        [2, 2],
        [3, 3]])
    M.SVD()
    z,Singular value decomposition not implementedr
  r   r   r   r   test_P39  s   	r  c                  C   st   t ddd\} }t| t| | t| g}|t| |gtt||  t| gt|| t| ggks8J d S )Nrb  Tr  )r   r   r=   rA   Zjacobian)r  rd  rk  r   r   r   test_P40  s
   &r  c                  C   st   t ddd\} }t| d t| | |ftdt| d|  t| gd|  t| | d  t| ggks8J d S )Nrb  Tr  r   )r   rO   rA   r   r=   rc  r   r   r   test_P41  s   4 r  c                   C   s&   t ttttgt dksJ d S rq  )rP   r=   r   rA   rn   r   r   r   r   test_P42
  r  r  c                  C   sx   dd } t ddd\}}t|t| |t| g}| |||gtt|| t| gt||t| ggks:J d S )Nc                    s   t  fdd|D jS )Nc                    s   g | ]}  |jqS r   )r   r  r2  vrj  r   r   r4        z3test_P43.<locals>.__my_jacobian.<locals>.<listcomp>)r   r  )rk  Yr   rj  r   __my_jacobian  r  ztest_P43.<locals>.__my_jacobianrb  Tr  )r   r   r=   rA   )r  r  rd  rk  r   r   r   test_P43  s   "r  c                  C   s|   dd } t ddd\}}| |d t| ||ftdt| d| t| gd| t| |d  t| ggks<J d S )Nc                    s,   t fdd|D  t  fdd|D S )Nc                    s   g | ]}t  |qS r   )r   r  r   r   r   r4    s    z2test_P44.<locals>.__my_hessian.<locals>.<listcomp>c                    s   g | ]} j |qS r   )r  r   r  )Vr   r   r4    r  r  )r   r  r   )r  r   r   __my_hessian  s   ztest_P44.<locals>.__my_hessianrb  Tr  r   )r   rA   r   r=   )r  r  rd  r   r   r   test_P44  s    r  c                  C   s.   dd } | t tttgt dksJ d S )Nc                    s(   t  fddtdt D }| S )Nc                    s   g | ]}t  jt|qS r   )r   r  r   r   r  r  r   r   r4  #  s    z4test_P45.<locals>.__my_wronskian.<locals>.<listcomp>r   )r   r   lenr  )r  r  rk  r   r  r   __my_wronskian"  s    z test_P45.<locals>.__my_wronskianr   )r=   r   rA   rn   )r  r   r   r   test_P45!  s   &r  c                  C   sp   t dddd\} }}td|d}t|| df t||df |d|d f|  d | d|d f}|  td)	Nzi j nTrQ  xnr   r   r   zUnknown result)r   r   r   r  r  )r   r   r   r  Smr   r   r   test_R1*  s
   @r  c            	      C   s   t d\} }t dddd\}}td|d}td|d}t||df | ||df   | d	 |d|d f}t|| }t||}t||f| |ftjd
 d S )Nzm bzi nTrQ  r  r   ynr   r   r>  )r   r   r   r   r   r   r  )	r   r  r   r   r  r   r   f1f2r   r   r   test_R24  s   4

r  c                  C   sn   t dddd\} }d| td|  |d  }t||dtf}| }| }|d|  td|  |  ks5J d S )Nn kTrQ  r  r   r   )r   r!   r   r   r  rh   )r   r   skr  r  T2r   r   r   test_R3A  s   "r  c                   C   r	  )NzIndefinite sum not supportedr
  r   r   r   r   test_R4M  s   r  c                  C   s   t dddd\} }}}}d| t| | | | t|| ||  t||  ||   }t||dtf}| }|t| | | t| t| t|  ksOJ d S )Nz	a b c n kTrQ  r  r   )r   r!   r   r   r  r"   )r  r  r8  r   r   r  r  r  r   r   r   test_R5c  s   4r	  c                  C   sx   t dddd\} }td| d d}t||df ||d df  |d| d f}| |d  || d df  ks:J d S )	Nr  TrQ  gnr   r   r   )r   r   )r   r   r   r  )r   r   r
  r  r   r   r   test_R6m  s   ,*r  c                  C   sR   t dddd\} }t|d |d| f }| | d | d d  d ks'J d S )Nr  TrQ  r   r   r   r   )r   r   r  r\   )r   r   r  r   r   r   test_R7t  s   (r  c                  C   s`   t dddd\} }t|d t| | |d| f}| }| | | d  d| d   ks.J d S Nr  TrQ  r   r   )r   r   r!   r  rh   r   r   r  r  r   r   r   test_R8y  s   (r  c                  C   s`   t dddd\} }tt| |d | |d| d f}|  d| d  d | d  ks.J d S Nr  TrQ  r   r   )r   r   r!   r  rn   )r   r   r  r   r   r   test_R9  s   ",r  c                  C   s   t dddd\} }}}tt| |t|||  |d|f}| }| t}|t||  t|t||  |   ks>J |t||  |tksLJ |t}|t||  |ks\J d S )Nzn m r kTrQ  r   )r   r   r!   r  rh   r  r"   )r   r   r  r   r  r  r  ZT3r   r   r   test_R10  s   $,
r  c                  C   sT   t dddd\} }t| |t| }t||d| f}| }|td|  ks(J d S )Nr  TrQ  r   r   )r   r!   r%   r   r  )r   r   r  r  r  r   r   r   test_R11  s
   r  c                  C   sR   t dddd\} }tt|d |d| f}| }|t| t| d  ks'J d S )Nr  TrQ  r   r   r   )r   r   r%   r  r  r   r   r   test_R12  s    r  c                  C   sz   t dddd\} }tt|t |d| f}| }| ttd d ttd|  d  d dttd    ks;J d S r  )r   r   rA   r   r  rn   r>   r=   r  r   r   r   test_R13  s   Hr  c                  C   sb   t dddd\} }ttd| d t |d| f}| }| t| t d tt ks/J d S r  )r   r   rA   r   r  rn   r  r   r   r   test_R14  s    (r  c                  C   sX   t dddd\} }tt| | ||dt| d f}| }| t| d ks*J d S )Nr  TrQ  r   r   r   )r   r   r!   r4   r  rn   r%   r  r   r   r   test_R15  s   "r  c                  C   sV   t dddd} td| d  d| d   | dtf}| tdtd d  ks)J d S )Nr   TrQ  r   r   r   r   )r   r   r   r  rx   r   )r   r  r   r   r   test_R16  s   $$r  c                  C   sJ   t dddd} tttd| d  d| d   | dtfd dk s#J d S )	Nr   TrQ  r   r   r   g3@V瞯<)r   r  floatr   r   r   r   r   r   test_R17  s   (r  c                  C   sd   t dddd} tdd|  | d   | dtf}| }| tdd  d td d  ks0J d S )Nr   TrQ  r   r   r   )r   r   r   r  rn   r.   r   r   r  r  r   r   r   test_R18  s    .r  c                  C   sx   t dddd} tdd|  d d|  d  d|  d   | dtf}| }| td d tdt d	  ks:J d S )
Nr   TrQ  r   r   r   r   r   r   )r   r   r   r  rn   r.   r7   r   r  r   r   r   test_R19  s   4.r  c                  C   st   t dddd\} }tt| d| |dtf}| }| d| d  tt|  d  d d| d  d  ks8J d S )Nr  TrQ  r   r   r   r   )r   r   r!   r   r  rn   r=   r   r  r   r   r   test_R20  s   @r   c                  C   s^   t dddd} tdt| | d  t| t| d    | dtf}| }| dks-J d S )Nr   TrQ  r   )r   r   r7   r   r  rn   r  r   r   r   test_R21  s   4r!  c                  C   s   t dddd\} }ttt| t|d t| d|    tt |  tt | |   | d| tf|dtf}| }|dttd td  dtd   dt t  d  ksYJ d S )	Nr  TrQ  r   r   r  r   r   )r   r   r"   r   rx  r   r  r7   r  r   r   r   test_R23  s   &
@r"  c                  C   sR   t dddd\} }tt|d| d  |d| f| dtf}| td ks'J d S )Nzm kTrQ  r   r   )r   r   r   r   r  r   )r   r   r  r   r   r   test_R24  s   (r#  c                  C   sR   t dddd} tt| d | ddf}|  dtd td  d ks'J d S )	Nr   TrQ  r   r   r   i  i  )r   r   rG   r  rn   r7   r   )r   Prr   r   r   test_S1  s   ,r%  c                  C   s6   t dddd\} }t||d| f t| ksJ d S Nr  TrQ  r   )r   r   r  r"   r   r   r   r   r   test_S2	  s   $r(  c                  C   sJ   t dddd\} }tt| |d| f  t| | d  d  ks#J d S r  )r   r   r   r  rn   r'  r   r   r   test_S3  s   8r)  c                  C   sB   t dddd\} }tdd|  |d| d f  | ksJ d S r&  )r   r   r  rn   r'  r   r   r   test_S4  s   0r*  c                  C   sd   t dddd\} }td| d d|  |d| f  t| tj ttt| d   ks0J d S r  )	r   r   r  Z	gammasimprG   r   rN  r7   r   r'  r   r   r   test_S5  s   & r+  c                  C   sr   t dddd\} }ttd dt t|t |    d |d| d f  td|   d td d  ks7J d S r  )r   r   r   r=   r   r  rn   r'  r   r   r   test_S6  s   :r,  c                  C   sT   t dddd} t| d d | d d  | dtf}| }| tddks(J d S )Nr   TrQ  r   r   r   )r   r   r   r  rn   r   r   r$  r  r   r   r   test_S7&  s   $r.  c                  C   sN   t dddd} tddd|  d   | dtf}| }| dt ks%J d S )Nr   TrQ  r   r   )r   r   r   r  rn   r   r-  r   r   r   test_S8.  s    r/  c                  C   sV   t dddd} tdd| d  d|  d   | dtf}| }| tdks)J d S )Nr   TrQ  r   r  r   )r   r   r   r  rn   r7   r-  r   r   r   test_S97  s   (r0  c                  C   s^   t dddd} t| | d  d t | | d  d t  | dtf}| }| dks-J d S )Nr   TrQ  r   r   r  )r   r   r   r   r  rn   r-  r   r   r   test_S10A  s   4r1  c                   C   sJ   t ddt  t tttksJ t dtt td  tdtjks#J d S r5  )r_   r   r   r   r=   r   r   rN  r   r   r   r   test_T1J  s    *r2  c                   C   s,   t dt dt  dt  ttdksJ d S )Nr   r   r   )r_   r   r   r   r   r   r   test_T2O  r   r3  c                   C   s,   t tttttt  ttdksJ d S rq  )r_   r.   r   rA   r   r   r   r   r   test_T3S  r   r4  c                   C   sZ   t tttt  tt tdtd  td    tt t tttd ks+J d S )Nr   r   r   )r_   r-   r   r   r   r   r   r   test_T4W  s   4r5  c                   C   sr   t ttt tttt td  d  tttd dttdtd  tt    tttddks7J d S )Nr   r   r   )r_   r   r.   r-   r   r   r   r   r   r   test_T5\  s   2r6  c                   C   s0   t dt ttdt   tttdksJ d S Nr   r  )r_   r   r"   r   r-   r   r   r   r   test_T6a  r  r8  c                   C   s(   t dt ttd dt   tt d S rq  )r_   r   rG   r   r   r   r   r   test_T7e  r  r9  c                  C   sJ   t ddd\} }tt||  t| t|  t|  |tdks#J d S )Nza zTr  r   )r   r_   rG   r-   r.   r   )r  ry  r   r   r   test_T8i  s   :r:  c                  C   s<   t ddd\} }ttd|fd| | |tt| ksJ d S )Nzz kTr  r   )r   )r   r_   rI   r   r-   )ry  r   r   r   r   test_T9n  s   ,r;  c                   C   sD   t ttdtd   tdtdt dtt  tdtfks J d S r7  )r_   rx   r   r   r4   r   r   r   r   r   test_T10v  s   Dr<  c                  C   sN   t dddd\} }t| t ttdt|  |d| f  | tttks%J d S r&  )r   r_   r   r   r   rG   r'  r   r   r   test_T11{  s   <r=  c                  C   sT   t ddd\} }t| tt|d  |d| f dt| d    | ddks(J d S )Nx tTr  r   r   r   )r   r_   r   r-   )r   rd  r   r   r   test_T12  s   0r?  c                  C   sL   t ddd} t| t|  | dddt| t|  | dddgdd	gks$J d S )
Nr   Tr  r   -dir+r  r   )r   r_   r  rC  r   r   r   test_T13  s   rD  c                  C   s6   t ddd} ttt|  | dddtd ksJ d S )Nr   Tr  r   rC  rA  r   )r   r_   r<   r.   r   rC  r   r   r   test_T14  s   *rE  c                  C   s*   t ddd} tt| | t| ksJ d S )Nr   Tr  )r   r   r  r+   rC  r   r   r   test_U1  s   rF  c                  C   sR   t ttt tdk fttdkf} t| tttdtdk fdtdkfks'J d S )Nr   r  r   r
   r   r8   r   r  r   r   r   test_U2  s   "0rH  c                  C   sl   t tttd d tdkftd tdkf} t tt| tt}|tdtd  ks,J |ddks4J d S r.  rG  )r   r  r   r   r   test_U3  s   ,rI  c                  C   sD   t dddd} t ddd}t||  || }|tt| ks J d S )Nr   TrQ  r   r  )r   r   r  r"   )r   r   r9  r   r   r   test_U4  s   rJ  c                  C   s   t d} ttt| t| tt| | df ttt| t| dftt| | d   }tt| | d|ks<J | |ksDJ d S )Nrd  r   )r   r   r   r   r   r  )rd  Zansr   r   r   test_U5  s   &*rK  c                  C   sj   t d} tttt| tttf}|tttttttt t| tt| tt  ks3J d S )Nr  )r	   r   r   rx  r   r   r   r   )r  r  r   r   r   test_U6  s
   2rL  c                  C   s"   t ddd\} }tt| | d S )Nzp tTr  )r   r   r   )r3  rd  r   r   r   test_U7  s   rM  c                  C   sb   t ddd\} }t| | |  }t|| || | t| |  d | t| |  d  ks/J d S )NrJ  Tr  r   )r   r=   rM   rA   )r   rx  eqr   r   r   test_U8  s   BrO  c                  C   s   t ddd\} }tt| || tt| || }|t| |t| d |d  }|  }|| | ttt| | | | d |d   d ksJJ d S )NrJ  Tr  r   )	r   r   r   r  r   r  r\   r   r   )r   rx  Zsus2Zs3r   r   r   test_U9  s
   
 ":	rQ  c                   C   s:   t td d td d td   tdtddksJ d S )Nr   r   r   r   r  r  )ra   ry  r   r   r   r   r   test_U10  s   :rR  c                   C   s   t r   r
  r   r   r   r   test_U11  s   rS  c                   C   r	  )Nz0External diff of differential form not supportedr
  r   r   r   r   test_U12  s   rT  c                   C   s8   t td t d tddtdd  d d ksJ d S )Nr   r   r  r   r   r   )r   r   r   r   r   r   r   test_U13  r   rU  c                   C   r	  )Nz$minimize(), maximize() not supportedr
  r   r   r   r   test_U14	  r   rV  c                   C   r	  )NzRminimize() not supported and also solve does not support multivariate inequalitiesr
  r   r   r   r   test_U15
	  r  rW  c                   C   r	  )Nz[minimize() not supported in SymPy and also solve does not support multivariate inequalitiesr
  r   r   r   r   test_U16	  r  rX  c                   C   r	  )Nz;Linear programming, symbolic simplex not supported in SymPyr
  r   r   r   r   test_U17	  r  rY  c                  C   sJ   t ddd} tt| | t| d  d | dkf| d d dfks#J d S )Nr   Tr  r   r   )r   r   r  r8   rC  r   r   r   test_V1	  s   >rZ  c                   C   sR   t tt tdk fttdkftttd  d tdk ftd d dfks'J d S )Nr   r   T)r   r8   r   r   r   r   r   test_V2!	  s    &r[  c                   C   s6   t dtd d  t  dtd d  ksJ d S )Nr   r   r   )r   r   r   rn   r   r   r   r   test_V3&	     6r\  c                   C   s:   t dt tddt   ttdt td ksJ d S )Nr   r   r   )r   r   r7   r/   r.   r   r   r   r   test_V4*	  r  r^  c                   C   sj   t dt d d dt d tdd  t ddt  dtd   ddt d tdd   ks3J d S )	Nr   r   r   r   r   irv  -   )r   r   r   rn   r   r   r   r   test_V5.	  s   .0r`  c                   C   s|   t ddttt  dtt t    ttdtdttt  td tdttt  td   dt  ks<J d S )Nr   r   r   r   rn  )r   r-   r   r   r7   r.   r   r   r   r   test_V65	  s
   06ra  c                  C   sb   t ttd ttd  } |  ttdd ttd dtt   dtt d  ks/J d S )Nr   r   r  r   )r   r1   r   r0   rn   r   r2   r1r   r   r   test_V7<	  s   Frd  c                   C   r	  )Nz'Integrate with assumption not supportedr
  r   r   r   r   
test_V8_V9A	  s   re  c                   C   sJ   t dddtt  dtt   ttdttd  d d ks#J d S )Nr   r   r   r   )r   r=   r   rA   r.   rB   r   r   r   r   test_V10R	  s   Jrf  c                  C   sp   t dddtt  dtt   t} t| }t|ddtttd d ttd d  tdd ks6J d S )Nr   r   r   T)forcer   r   )	r   r=   r   rA   r\   rm   r.   rB   r   rc  r2r   r   r   test_V11V	  s
   &
,rj  c                  C   sF   t dddtt  dtt   t} | dttd d  ks!J d S )Nr   r   r   r   r  r   )r   r=   r   rA   rB   rb  r   r   r   test_V12]	  s   & rk  c                  C   sj   t dddtt  dtt   t} |  dtd ttddttd  d  d  d ks3J d S )Nr   r   r   r   r   r   )r   r=   r   rA   rn   r7   r<   rB   rb  r   r   r   test_V13b	  s   &Drl  c                  C   sr   t tttd td  t} |  ttttd td   tttt   tttt   dt  ks7J d S r  )r   r.   r  r   rx  rn   rb  r   r   r   test_V14j	  s    rm  c                  C   sR   t tttt  t} t| tt td td  ttt   d  dks'J d S Nr   r   )r   r   r:   rx  rn   rb  r   r   r   test_V15s	  s   <ro  c                   C   s^   t tdt tdt  ttdt tdt  d tdt tdt  d  ks-J d S )Nr   r   r   r   r   )r   r=   r   ru   rA   rv   r   r   r   r   test_V16x	  s   ^rp  c                  C   s   t tttttt tttttt  ttd ttd   t} t| tttt tttt  d  dks?J d S rn  )r   r   r   r   r   rn   rb  r   r   r   test_V17}	  s   8rq  c                   C   s,   t dtt  ttd td fdksJ d S )Nr   r   )r   r   rx  r   r   r   r   test_W1	  s   ,rr  c                   C   s0   t dtt d  ttd td ftu sJ d S r/  )r   r   rx  r   r   r   r   r   test_W2	  s   0rs  c                   C   s2   t ttdt  d tddftddksJ d S Nr   r   r   r   r   r   r7   r   r   r   r   r   r   test_W3	  s   2rv  c                   C   sB   t ttdt  d tddfdtd d tdd ksJ d S )Nr   r   r   r   r   ru  r   r   r   r   test_W4	     Brw  c                   C   sB   t ttdt  d tddfdtd d tdd ksJ d S )Nr   r   r   r   r   r   ru  r   r   r   r   test_W5	  rx  ry  c                   C   sH   t tddtdt   d tttdd t d ftdks"J d S )Nr   r  r   )r   r7   r=   r   r   r   r   r   r   r   test_W6	  s   Hrz  c                  C   sT   t ddd} ttttd | d   tt tf}| tt|   |  ks(J d S )Nr  Tr  r   )r   r   r=   r   r   rn   r   r-   )r  rc  r   r   r   test_W7	  s   &"r{  c                   C   r	  )Nz1Integrate with assumption 0 < a < 1 not supportedr
  r   r   r   r   test_W8	  s   r|  c                  C   s   t dtd  dt td  td  td   tt tf} |  }|dt ttd d d ttdd d   ks>J d S )	Nr   r   r   r   r   r   r   g      ?)r   r   r   r  r   r7   rh  r   r   r   test_W9	  s   :>r}  c                  C   sl   t tdt td  td   tt tf} |  }|dt tdd d  tttdd  d ks4J d S )Nr   r   r   r   g      ?)r   r   r   r  r   r7   r?   r   rh  r   r   r   test_W10	  s   *:r~  c                   C   s@   t tdtd  dtd   tddftdtd  ksJ d S r  )r   r7   r   r   r   r   r   r   test_W11	  s   &r  c                  C   s   t ddd} t ddd}ttt|  td  d| t   tt tf}| tt| t|d |   | tdd  ks?J d S )Nr3  Tr  rB  r  r   r   )	r   r   r   r-   r   rn   r7   r   r   )r3  rB  rc  r   r   r   test_W12	  s   0:r  c                  C   sH   t dtt ddt   ttdt  tddf} | dt ks"J d S )Nr   r   r   )r   r.   r   r   rb  r   r   r   test_W13	  s   4r  c                   C   s6   t ttt tdt t  tt tfdksJ d S rn  )r   rA   r   r-   r   r   r   r   r   r   test_W14	  r]  r  c                   C   s:   t ttttdt t  tddftddksJ d S )Nr   r   r   r   )r   r.   rG   r   r=   r   r   r   r   r   r   test_W15	  s   :r  c                   C   s>   t dt d tdt tdt tddftddksJ d S )Nr   r   r   r  r  #   )r   r   rY   r   r   r   r   r   test_W16	  s
    r  c                  C   s`   t ddd\} }tt|  t td|t  tdtfd|t| d |d  d   ks.J d S )Na bTr  r   r   r   )r   r   r-   r   rC   r   r7   r  r   r   r   test_W17	  s   r  c                   C   s2   t tdtt d tdtfddt  ksJ d S rt  )r   rC   r   r   r   r   r   r   r   test_W18
  s   2r  c                   C   sB   t tttddtdt   tdtftdd d ksJ d S )Nr   r   r   r   )r   ru   r   rC   r7   r   r=   r   r   r   r   test_W19
  rx  r  c                   C   s   t td tddtd   tddftd  d tdd tdd  td  d dtd  tdd  d	 td d
  ksBJ d S )Nr   r   r   r   r  r   l   r   gUUUUUU'@r   )r   r   rL   r   r   rx   r.   r   r   r   r   test_W20
  s
   $"4r  c                	   C   s>   t tttd tddtd   tddfd dk sJ d S )Nr   r   r   r   g5?r  )r  r   r   r   rL   r   r   r   r   test_W21
  s
   *r  c                  C   s   t ddd\} }tttdttdktdkfd}t|| t|  | d|ftd|dk fttd| ttd| dfksAJ d S )Nzt uTr  r   r   )r   Tr   )	r   r
   r   r8   rN   r   r=   rA   r6   )rd  urP  r   r   r   test_W22
  s   "
 r  c                  C   sf   t ddd\} }ttttd td   t| |ftt tf}|t t |  t|  ks1J d S Nr  Tr  r   )r   r   r   rx  r   collectr   cancel)r  r  rc  r   r   r   test_W23#
  s   .(r  c                  C   s^   t ddd\} }ttttd td   tt tft| |f}|tt|  |  ks-J d S r  )r   r   r   rx  r   r  r   )r  r  ri  r   r   r   	test_W23b*
  s   . r  c                  C   sd   t ddd\} }ttt| d |d  | ddf|ddf}|tdtd d   dks0J d S )NrJ  Tr  r   r   r   r   )r   r   r7   r/   rn   )r   rx  rc  r   r   r   test_W241
  s   ,(r  c                  C   s   t ddd\} }}tt| t| tdt| d t|d  t|d    |dtd f}t||dtd f}|t|  d   dksGJ d S )Nza x yTr  r   r   r   )r   r   rA   r7   r   rn   )r  r   rx  i1i2r   r   r   test_W25;
  s   : r  c                  C   sJ   t ddd\} }ttt|| d  |ddf| ddftdd	ks#J d S )
NrJ  Tr  r   r   r  r   re  r   )r   r   r  r   r  r   r   r   test_W26F
  s   r  c               
   C   sn   t d\} }}tttdtd|dt|   t|   ftd|dt|    ftd| f| | | d ks5J d S )Nr  r   r   r   )r   r   ry  r   rx  )r  r  r8  r   r   r   test_W27L
  s   &r  c                  C   s   t ddd\} }tdtd| | d   | dddd	| d
  d|d
   d| d  d|d    | d d|d    d t| d  ksFJ d S )Nv cTr  r   r   r   r   Zx0r   r   r   r   r   r   r   rb   r7   r`   )r  r8  r   r   r   test_X1S
  s   "Rr  c                  C   sv   t ddd\} }tdtd| | d   | ddd}d|d  j| ddd| d  |d  d t| d  ks9J d S )	Nr  Tr  r   r   r   r   r  r  )r  r8  s1r   r   r   test_X2Y
  s   $Br  c                  C   sl   t t tt   } tt }|ttd d  dtd  d  ttd  ks.J | |ks4J d S )Nr   r   r   r   r   )rA   r   rb   r=   rB   r`   )r  rP  r   r   r   test_X3_
  s   4r  c                  C   sf   t ttt  } | td  d td d  ttd  ks!J t tttt  | ks1J d S )Nr   r   r      )r.   rA   r   rb   r`   )r  r   r   r   test_X4f
  s   .$r  c                  C   sb   t d} tddd\}}}}ttt|t tt|t  t| |t tdtf t|dd d S )Nr  za b c dTr  r   r   r  )	r	   r   rb   r   r   r   r   r   rx  )r  r  r  r8  r9  r   r   r   test_X5l
  s
   6
r  c                  C   s|   t dddd\} }tt| | t t| t t|t   tdddtd |  | d ||  d   ttd  ks<J d S )Nr  F)r  Zscalarr   r   r  r   )r   rb   r-   r   r`   r  r   r   r   test_X6
  s   2,r  c                   C   st   t dtttd   tddtd ddt   tdd td d  td d	  td
 d  ttd  ks8J d S )Nr   r   r   r   r   r   i  r   i v  r   i u )rb   r   r-   r   r`   r   r   r   r   test_X7
  s   .



r  c               	   C   s   t ddd} ttt| | td d dddt| ttdd   | ttdd  tdd d	  | ttdd  td
d d  t| ttdd  d | ttdd f ksZJ d S )Nr   Tr  r   r   r   r  r   r   r      )r   rb   r7   r@   r   r   r`   rC  r   r   r   test_X8
  s   8(r  c                   C   st   t tt tddddttt  td ttd  d  td ttd  d  ttd ttd   ks8J d S )Nr   r   r  r   r   r   r   )rb   r   r.   r`   r   r   r   r   test_X9
  s
   8r  c                  C   sp   t d\} }ttt| tt| |  | dddtt|t|  | t| t|  t| d  ks6J d S Nzz wr   r   r  r   rb   r.   r1   r0   r`   ry  r  r   r   r   test_X10
  s   &2r  c                  C   sl   t d\} }ttt| t| |  | dddtt|t|  | t| t|  t| d  ks4J d S r  r  r  r   r   r   test_X11
  s   "2r  c                  C   s   t ddd\} }}tt||  t| |  |ddd|d |  t| d| d|  |d  d  t|d d   ks>J d S )Nza b xTr  r   r   r  )r   rb   r.   r-   r`   )r  r  r   r   r   r   test_X12
  s   $>r  c                   C   sF   t tdtd  d ttddtdt tdt ttf ks!J d S )Nr   r   r  )rb   r7   r   r   r`   r   r   r   r   test_X13
  r  r  c                   C   s\   t dddt   tdt t tttkdddtttt  tdt ttf ks,J d S )Nr   r   r\  )rb   r   r!   r   r   r7   r   r`   r   r   r   r   test_X14
  s
   
$r  z*https://github.com/sympy/sympy/issues/7164c                  C   s   t ddd\} }tt| | || tf}t|| tddd| d  d| d	   d
| d   d
|   t| d | tf ks>J d S )Nr>  Tr  r   r  r   r   r   r   r   r   )r   r   r-   r   rb   r`   )r   rd  e1r   r   r   test_X15
  s
   <r  c                   C   sx   t ttt tt ddddtt d d  ttd td t  td td   ttd   td  tt ks:J d S )Nr   r   r  r   r   r   )rb   r=   r   rx  r`   r   r   r   r   test_X16
  s   ,>r  c                   C   sh   t tttt tdt ddt d   tdt  tdt   ttdt   tdtfks2J d S )Nr  r   r   )	r   r.   rA   r   r   r   r$   r"   r   r   r   r   r   test_X17
  s   Jr  c                  C   sf   t d} ttt tt tdtj|   ttdd|  t	  t|   t
|  | dtfks1J d S )Nr   r   r   r   r   )r   r   r-   r   rA   r   r   rN  r   r   r"   r   r  r   r   r   test_X18
  s   >r  c                   C   r	  )NzTSolve using series not supported. Inverse Taylor series expansion also not supportedr
  r   r   r   r   test_X19  s   r  c                   C   r	  )Nz'Symbolic Pade approximant not supportedr
  r   r   r   r   test_X20  s   r  c                  C   s   t ddd} t dddd}ttt|  | f}|jjdksJ |jj|jjd ddks.J |jj|jjd |d|  t d|  | t	|t t |   ksRJ d	S )
z
    Test whether `fourier_series` of x periodical on the [-p, p] interval equals
    `- (2 p / pi) sum( (-1)^n / n sin(n pi x / p), n = 1..infinity )`.
    r3  Tr  r   )rR  r   r   r   r  N)
r   r   r   ZanZformulaZbnr  	variablesr   rA   )r3  r   rP  r   r   r   test_X21"  s    *r  c                   C   r	  )NzFourier series not supportedr
  r   r   r   r   test_X224  s   r  c                  C   sb   t ddd} t ddd}t d}tt|d |  | |\}}}|||d |d d   ks/J d S )	Nrd  Tr  r  r  rP  r   r   )r   r   r=   rd  r  rP  rs  r  r   r   r   test_Y1U  s
   $r  c                  C   s`   t ddd} t ddd}t d}t||d |d d   || dd	}|t| |d  ks.J d S )
Nrd  Tr  r  r  rP  r   r   rn   )r   r   r=   )rd  r  rP  r   r   r   r   test_Y2]  s
   $r  c                  C   sn   t ddd} t ddd}t d}tt||  t||   | |dd\}}}|||d d	|d    ks5J d S )
Nrd  Tr  r  r  rP  r  r   r   )r   r   r1   r0   r  r   r   r   test_Y3e  s
   *$r  c                  C   s^   t ddd} t d}ttdt|  | |dd\}}}|d| tdt| |  ks-J d S )	Nrd  Tr  rP  r   r  r   r  )r   r   rw   r7   r-   )rd  rP  rs  r  r   r   r   test_Y4m  s   "(r  c                  C   s  t ddd} t d}td}td}ttt|| | d||  dt| d	 t| d    | |dd
||i}| |d ||  ||d  || tt|| | | d dt|  |  dtd|  |  }|dkspJ t	|||d }t
|| |d	dgi}||d td|  dt|  d td|  ||d d	   ksJ t||| }|t| d	 t| d }|ddt| d	   t| d	  dt| d  d t| d   t| t|   ksJ d S )Nrd  Tr  rP  rx  r  r   r   r   )Znocondsr   r   )r   r	   r   r   r   rt   r   r   r-   rq   r   r   r  r=   )rd  rP  rx  r  rs  DZYfZyfr   r   r   
test_Y5_Y6t  s<   >H r  c               	   C   s   t ddd} t ddd}t d}tddtd	t t| t|   tdtf  | |\}}}|dtd	t t| t |  | tdtf d|  ksLJ d S )
Nrd  Tr  r  r  rP  r   r   r  )r   r   r   r   rt   r   r-   )rd  r  rP  rs  r  r   r   r   test_Y7  s   
Br  c                   C   s   t dttttksJ d S rq  )r   r   ry  rD   r   r   r   r   test_Y8  s   r  c                   C   sF   t tdtd  ttttttd  td  d  d ks!J d S )Nr  r   r   r   )r   r-   r   ry  r7   r   r   r   r   r   test_Y9  s   $r  c                   C   sp   t tttdtt  tt dtd  td  d dtd  td  dtd  td   d  ks6J d S )	Nr  r#  r   r  r   r   r  rg  )r   r  r   r-   ry  r  r   r   r   r   r   test_Y10  s   "Br  z*https://github.com/sympy/sympy/issues/7181c                  C   sB   t d\} }tdd|   | |\}}}|ttt|  ksJ d S )Nx sr   )r   r   r   r>   r   rP  rs  r  r   r   r   test_Y11  s   r  c                  C   sd   t d\} }ttd| | d  | |\}}}|d|d   t|d  t| d d  ks0J d S )Nr  r   r   r   )r   r   rC   rG   r  r   r   r   test_Y12  s    8r  c                   C   r	  Nzz-transform not supportedr
  r   r   r   r   test_Y13  r!  r  c                   C   r	  r  r
  r   r   r   r   test_Y14  r!  r  c                  C   sp   t d} t| td d| td   | t d | t| dd| dti td ttd   d ks6J d S )Nr  r   r   r   )r	   r   r   r   rn   r  r   r   r   test_Z1  s   .r  c                  C   sf   t d} t| td| td  d| td    | t| dd| ddidt  dt  ks1J d S )Nr  r   r   r   r   r   r   )r	   r   r   r  r   r   r   test_Z2  s   Br  c                  C   s   t d} tdd tdd  t tdd tdd   tdd tdd  t tdd tdd    }t| t| td | td   | t| dd| ddi}||ks\J d S )Nr  r   r   r   r   )r	   r   r7   r   r   )r  expectedr  r   r   r   test_Z3  s   22<r  c               	   C   s  t d} td}t| td| |td   |td   d|t   | td  |d|td    d|td    | td   d  | t| dd| ddd|  |d  d|  i}||td  |td  d|  d  td |d   d|  t |d d |d    dksJ d S )Nr  r8  r   r   r   r   )r	   r   r   r   )r  r8  rP  r   r   r   test_Z4  s(   >.0$r  c                  C   s   t d\} }ttttddtt  tdt  }t|tt}tt|j}|t|tdt  | td  tdt   ksAJ ttt	|tt}t
|d|df}|t| ||  ||| }|t tdt  d tdt d  ks|J td)NzC1 C2r   r   r   r   z1ODE solving with initial conditions not supported)r   r   r   r   rA   r   r
   rhsr=   r   rq   r  r  )ZC1ZC2rN  r  Zf0r  Z
const_dictresultr   r   r   test_Z5  s   (4 .r  c                  C   s   t ddd} t d}tt| | ddt|   td|   }t|| |\}}}||d tt| | | dtt| | |  d|d d   ksIJ d S )Nrd  Tr  rP  r   r   )r   r   r   rA   r   r   )rd  rP  rN  rs  r  r   r   r   test_Z6  s   (r  (  __doc__Zsympy.assumptions.askr   r   Zsympy.assumptions.refiner   Zsympy.concrete.productsr   Z
sympy.corer   Zsympy.core.evalfr   Zsympy.core.functionr   r	   r
   r   r   r   r   Zsympy.core.mulr   Zsympy.core.intfuncr   Zsympy.core.numbersr   r   r   r   r   r   r   r   Zsympy.core.relationalr   r   Zsympy.core.singletonr   Zsympy.core.symbolr   r   r   Z(sympy.functions.combinatorial.factorialsr    r!   r"   r#   Z%sympy.functions.combinatorial.numbersr$   r%   r&   r'   Z$sympy.functions.elementary.complexesr(   r)   r*   r+   Z&sympy.functions.elementary.exponentialr,   r-   r.   Z%sympy.functions.elementary.hyperbolicr/   r0   r1   r2   Z#sympy.functions.elementary.integersr3   r4   Z(sympy.functions.elementary.miscellaneousr5   r6   r7   Z$sympy.functions.elementary.piecewiser8   Z(sympy.functions.elementary.trigonometricr9   r:   r;   r<   r=   r>   r?   r@   rA   rB   Zsympy.functions.special.besselrC   Z'sympy.functions.special.delta_functionsrD   Z*sympy.functions.special.elliptic_integralsrE   rF   Z'sympy.functions.special.gamma_functionsrG   rH   Zsympy.functions.special.hyperrI   Z#sympy.functions.special.polynomialsrJ   rK   Z&sympy.functions.special.zeta_functionsrL   Zsympy.geometry.utilrM   Zsympy.logic.boolalgrN   Zsympy.matrices.denserO   rP   Z!sympy.matrices.expressions.matmulrQ   Z sympy.ntheory.continued_fractionrR   rF  rS   rG  rT   rK  rU   rM  Zsympy.ntheory.factor_rV   Zsympy.ntheory.generaterW   Zsympy.polys.domains.integerringrX   Zsympy.polys.orthopolysrY   Zsympy.polys.partfracrZ   Zsympy.polys.polytoolsr[   r\   r]   r^   Zsympy.series.limitsr_   Zsympy.series.orderr`   Zsympy.series.residuesra   Zsympy.series.seriesrb   Zsympy.sets.fancysetsrc   Zsympy.sets.setsrd   re   rf   rg   Zsympy.simplify.combsimprh   Zsympy.simplify.hyperexpandri   Zsympy.simplify.powsimprj   rk   Zsympy.simplify.radsimprl   Zsympy.simplify.simplifyrm   rn   Zsympy.simplify.sqrtdenestro   Zsympy.simplify.trigsimprp   Zsympy.solvers.solversrq   r  rs   rt   Z'sympy.functions.special.error_functionsru   rv   rw   rx   Zsympy.testing.pytestry   rz   r{   r|   r}   Zsympy.utilities.iterablesr   r   r   Zsympy.matricesr   r   r   Z&sympy.matrices.expressions.blockmatrixr   r   Zsympy.matrices.expressionsr   r   Zsympy.physics.quantumr   Zsympy.polys.ringsr   Zsympy.polys.fieldsr   Zsympy.polys.solversr   Zsympy.concreter   r   Zsympy.integralsr   Zsympy.integrals.transformsr   r   r   r   r   r   r   Zsympy.solvers.recurrr   Zsympy.solvers.solvesetr   r   r   Zsympy.solvers.oder   r   	itertoolsr   r   Zsympy.series.formalr   Zsympy.series.fourierr   Zsympy.calculus.utilr   r0  r   r   rx  ry  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r%  r'  r(  r)  r+  r-  r0  r6  r7  r:  r;  r>  r?  r@  rH  rI  rL  rO  rT  rV  rW  rX  rY  r]  ra  rr  rs  rB  rt  ru  r{  r|  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r!  r"  r#  r%  r&  r*  r+  r,  r-  r/  r1  r2  r3  r4  r7  r:  r;  r<  r=  r@  rC  rE  rG  rH  rI  rK  rL  rM  rP  rR  rS  rU  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r_  r`  ra  re  rf  rg  rl  rn  rp  rt  ru  rx  rz  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r!  r"  r#  r%  r(  r)  r*  r+  r,  r.  r/  r0  r1  r2  r3  r4  r5  r6  r8  r9  r:  r;  r<  r=  r?  rD  rE  rF  rH  rI  rJ  rK  rL  rM  rO  rQ  rR  rS  rT  rU  rV  rW  rX  rY  rZ  r[  r\  r^  r`  ra  rd  re  rf  rj  rk  rl  rm  ro  rp  rq  rr  rs  rv  rw  ry  rz  r{  r|  r}  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   r   <module>   s   $(0$























	














BN>





				


?			

			
			
		
	
			
 !
