a
    lhr                    @   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   O/var/www/auris/lib/python3.9/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sJJ 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   s   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s4J 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   s    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   s    r   c                   C   s*   t ddt dd  kr dks&n J d S )NZ677r   Z1BF   i  r   r   r   r   r   test_C6   s    r   c                   C   s   t dddksJ d S )Ni   r   r   )r.   r   r   r   r   test_C7   s    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   s    r   c                  C   s8   d} t ddD ]}| td|7 } q| tddks4J 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   s    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   s    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   s    r   c                  C   sX   t tddtddtddtddtd        } tdd }| |ksTJ 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sTJ 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s4J d S )NTcomplexr   )rn   r7   r   r   r   r   r   test_C18   s    r   c                   C   s6   t tddtd  tdd dtd ks2J d S )NZ   "   r   r   r   )rl   rn   r7   r   r   r   r   r   test_C19   s    r   c                  C   sT   ddt d  } t| tdd d t d | tdd  }t|tdksPJ 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s6J 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sJ 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  s    r   c                   C   s   t dd S )Nz2**aleph_null == aleph_1NotImplementedErrorr   r   r   r   test_C24  s    r  c                   C   s   dt d dksJ d S )N        r   r   )r7   r   r   r   r   test_D1  s    r  c                   C   s   t td dksJ d S )Niz3.29683147808856e-434295)strr-   evalfr   r   r   r   test_D2  s    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  s    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   s   t dd S )Nz6cubic_spline([1, 2, 4, 5], [1, 4, 2, 3], x)(3) == 27/8r   r   r   r   r   test_D5   s    r  c                   C   s   t dd S )Nz,translate sum(a[i]*x**i, (i,1,n)) to FORTRANr   r   r   r   r   test_D6%  s    r  c                   C   s   t dd S )Nz&translate sum(a[i]*x**i, (i,1,n)) to Cr   r   r   r   r   test_D7*  s    r  c                   C   s   t dd S )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   s   t dd S )Nztranslate D8 to FORTRANr   r   r   r   r   test_D97  s    r  c                   C   s   t dd S )Nztranslate D8 to Cr   r   r   r   r   test_D10<  s    r  c                   C   s   t dd S )Nz.flops(sum(product(f[i][k], (i,1,k)), (k,1,n)))r   r   r   r   r   test_D11A  s    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sJJ d S )
Nr   r   r   r   r   r   )r   r   r   r   r   r   test_D12G  s    r  c                   C   s   t dd S )Nz:discretize a PDE: diff(f(x,t),t) == diff(diff(f(x,t),x),x)r   r   r   r   r   test_D13L  s    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  s    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s4J d S Nr   r   )rh   r   r"   r#   r   r   r   r   test_F3^  s    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  s    r  c                   C   sN   t ttdd tt tt tdt ddt   ttd  ksJJ d S Nr   r   )rG   r   r   r7   r   r"   r   r   r   r   test_F5h  s    r   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sDJ 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    &r&  c                   C   s   t ddksJ d S )Nr   r   )r'   r   r   r   r   test_F7s  s    r'  c                   C   s   t dddddksJ d S )Nr   r   T)signedirr   r   r   r   r   test_F8w  s    r)  c                   C   s   t ddksJ d S )Nr   i@  )r&   r   r   r   r   test_F9{  s    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   s   t dd S )Nz$find the primitive root of 191 == 19r   r   r   r   r   test_G2  s    r.  c                   C   s   t dd S )Nz,(a+b)**p mod p == a**p + b**p mod p; p primer   r   r   r   r   test_G3  s    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sTJ d S )Nr   r      c                 S   s
   | j dkS )Nr   )qr   r   r   r   <lambda>  r%  ztest_G15.<locals>.<lambda>r  )	r   r7   r  Zlimit_denominatorr   r,  r   cf_ccf_ir   r   r   r   test_G15  s    $ r6  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   r5  r   r   r   r   r   test_G16  s    r7  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  s    r9  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   )r8  cf_rr   r   Halfr7   r   r   r   r   test_G18  s    r<  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sbJ d S )NsTr   positiver   r   r   r   r   r   r   )r   r5  r-   r,  r   )r=  itr   r   r   test_G19  s    $rA  c                  C   s:   t dddd} td|  gg| t| d d  ks6J d S )Nr=  Tr>  r   r   )r   r:  r7   r=  r   r   r   test_G20  s    rC  c                  C   s6   t dddd} t| d| d d d|  ggks2J d S )Nr=  Tr>  r   r   )r   r8  rB  r   r   r   	test_G20b  s    rD  c                   C   sL   t ddt  t dtd  ks$J tddt  t dtd  ksHJ d S r  )rn   r   rj   r   r   r   r   test_H1  s    $rE  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  s    rF  c                   C   s   dt t d   dksJ d S Nr  r   r   r   r   r   r   test_H3  s    rI  c                  C   sP   t dt d } t| tu s J | jd dks2J | jd dt d ksLJ d S )Nr   r   r   r   r   r   r   )r\   r   typer   args)exprr   r   r   test_H4  s    rM  @   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  s    r`  c                   C   s&   t ttt ttt tks"J d S r   )r]   r   r^  r1  r_  r   r   r   r   test_H6  s    ra  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sJ d S )Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   rZ  r   r   r   r   P   r   r   r   yzr]   r^  r_  r   r   r   test_H7  s    `drg  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s:J d S )Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   rZ  r   r   r   r   rb  r   r   r   r   rc  )r^  r_  r1  r   r   r   test_H8  s    `dTrh  c                  C   s^   t ddd} d| td   | td   }d| td   d| t   }t||| t ksZJ d S )Nr   F)Zzeror   r   r   r   )r   r   r]   )r   r^  r_  r   r   r   test_H9  s    ri  c                  C   s\   dt d  dt d   t d  t  d } t d dt d   t  d }t| |t dksXJ d S )Nr   r   r   r   r   )r   r^   rf  r   r   r   test_H10  s    (rj  c                   C   s    t tt tt tdksJ d S Nr   )r^   r^  r1  r_  r   r   r   r   r   test_H11  s    rl  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    rm  c                   C   s8   t ttd ttd d  ttd d ks4J d S r  )rn   r-   r   r   r   r   r   test_H13  s    rn  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s
J 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sJ t|ddt  d  ks J d S )&Nr   rZ     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\   )r#  epdepr   r   r   test_H14  s    <














0














rs  c                   C   sF   t tdd ttd td  d D  td td  d ksBJ d S )Nc                 S   s   g | ]}t | qS r   r2  )r"  rr   r   r   r$    r%  ztest_H15.<locals>.<listcomp>r   r   r   )rn   r   r   r   r   r   r   r   test_H15  s    ru  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sJ d S )Nd   r   r   r   r   r   r   rZ  r   r   r   (      r\   r   r   r   r   r   test_H16  s2    6""rz  c                   C   s(   t tttt tt  dks$J d S rk  )rn   r\   r   r^  r_  r   r   r   r   test_H17  s    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sJ d S )	Nr   r   r   M   r   rp     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s2J d S )Nar   r   )r   r[   r   r  r   r   r   test_H19)  s    r  c                   C   s   t dd S )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/  s    r  c                   C   s   t dd S )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  s    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   modulusry  r   r   r   r   test_H22;  s    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shJ 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sbJ 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s4J d S )Nr   r   rZ  r   rd  re  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snJ d S )Nr   r   rZ  F)r   )r   rA   r   r=   rd  rB   re  r\   )r   r   r   r   test_H26P  s    0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   rZ  r   r   r   r   rb  r   r   r   rw  r  )r   r   hr   r   r   test_H27U  s    `dR^r  c                   C   s   t dd S )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^  s    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   rO  rZ  r   r  )r\   r   rd  r   r   r   r   test_H29d  s    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sxJ d S )Nr   r  r   r   )r\   r   rd  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slJ d S )Nr   r   r   r   r   )r   rZ   r  r   r   r   test_H31o  s    4(r  c                   C   s   t dd S )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  s    r  c                  C   sV   t ddd\} }}t| t||t|t||  t|t| |   dksRJ 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  s    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  s    r  c                   C   s8   t tt tdt d t d  dt d ks4J d S )Nr   r   r   r  )r=   r   r   rA   r   r   r   r   test_I3  s    r  c                   C   sL   t ttttt  ttd ttt   ttdt d ksHJ d S )Nr   r  r   )r   r=   r   r   rA   r   r   r   r   r   r   test_I4  s    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   rx  r   )rA   r   r   r   r   r   r   test_I5  s    r  c                   C   s   t dd S )NzHassuming -3*pi<x<-5*pi/2, abs(cos(x)) == -cos(x), abs(sin(x)) == -sin(x)r   r   r   r   r   test_I6  s    r  c                   C   s8   t dt t t t td dttd   ks4J d S Nr   r   r=   r   rA   r   r   r   r   test_I7  s    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  s    r  c                   C   s8   t dt t t t td dttd   ks4J d S r  r  r   r   r   r   test_I9  s    r  c                   C   sH   t ttd d ttd  ttd ttd  d  tu sDJ d S Nr   r   r   )rp   rB   r   r=   rA   r   r   r   r   r   test_I10  s    r  Zhangsc                   C   sL   t ttd d ttd  ttd ttd  d  tddksHJ d S )Nr   r   r   r   )r_   rB   r   r=   rA   r   r   r   r   test_I11  s    r  c                  C   sN   t ttd d ttd  ttd ttd  d  t} | tu sJJ 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  s    r  c                   C   s<   t tttd ttttd tttd  t ks8J d S Nr   )r   rE   r   rd  rF   r   r   r   r   test_J2  s    r  c                   C   s   t dd S )NzDJacobi elliptic functions: diff(dn(u,k), u) == -k**2*sn(u,k)*cn(u,k)r   r   r   r   r   test_J3  s    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  s    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    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  s    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  s    r  c                  C   sP   t tddt} ttt tt ttt d  }tt| | dksLJ d S Nr   r   r   )	rC   r   re  rA   r=   r7   r   rn   r   )r#  r1  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   re  r   r   r   r   r   test_J9  s    r  c                  C   s^   t ddd\} }t|| dd|  tt t||  d d  t| |  d d  ksZJ d S )Nzmu, nuTr   r   r   r   )r   rJ   r7   r   rG   )munur   r   r   test_J10  s    r  c                   C   sH   t tddtt tdd tdtd   dtd  d  ksDJ d S )Nr   r   r   r   )rn   rJ   r   r   r7   r   r   r   r   test_J11  s    r  c                   C   s6   t tdtdt tdt  tdt dks2J d S )Ni  r   i  i  r   )rn   rK   r   r   r   r   r   test_J12  s    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s8J d S r  )rI   r   r;  r   re  ri   r;   )r#  r   r   r   test_J14  s     r  c                   C   s   t dd S )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  s    r  c                   C   s   t dd S )Nz&diff(zeta(x), x) @ x=0 == -log(2*pi)/2r   r   r   r   r   test_J16  s    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srJ d S )Nr   r   r   r   r   r   )	r   r   r   rD   r   r   r   r   r   r   r   r   r   test_J17  s    r  c                   C   s   t dd S )Nz define an antisymmetric functionr   r   r   r   r   test_J18  s    r  c                  C   s^   t ddd\} }t| t|  t| t|  ks6J t| t|  t| t| ksZJ 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s0J d S )Nr   r   r   r   r   )absr7   r   r   r   r   r   test_K2  s    r  c                  C   sX   t ddd\} }ttd| t|   t|   dt| d t|  | d   ksTJ d S )Nza, bTrealr   r   )r   rn   r  r   r7   r  br   r   r   test_K3   s    r  c                   C   s:   t ddt  jddt dtttdd  ks6J d S )Nr   r   Tr   r   )r.   r   r   r<   r   r   r   r   r   test_K4&  s    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sxJ d S )Nzx, yTr  r   r   )r   rB   r   r   rA   r=   r0   r1   r   rd  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stJ d S r  )r7   r   rd  r  re  r   r   r   r   test_K60  s    @r  c                  C   sR   t dddd} tt|  ttd  tttt  }t|}|t| ksNJ d S )Nrd  TF)r  r  r   )r   r7   r   r  re  rn   )rd  rL  Zsexprr   r   r   test_K75  s    (r  c                  C   sf   t ddd} ttd|  dt|   dks0J t dddd} ttd|  dt|   dksbJ d S )Nre  Tr   r   r   F)r   r  r   rn   r7   re  r   r   r   test_K8<  s    $r  c                  C   s4   t ddd} ttd|  dt|   dks0J d S )Nre  Tr?  r   r   r  r  r   r   r   test_K9C  s    r  c                  C   s4   t ddd} ttd|  dt|   dks0J d S )Nre  T)r  r   r   r  r  r   r   r   test_K10H  s    r  c                   C   s"   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  s    r  c                   C   s"   t ddtdd  dksJ d S )Nr+  l   ^|E!or   r   r   r  r   r   r   r   test_L2U  s    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sPJ d S )Nr   r   r   r   r   r   )rn   r   r   r   r   r   test_L3Y  s    r  c                   C   s8   t ttd ttttd   tt dks4J d S r  )rp   r=   r   rA   r   r   r   r   test_L4]  s    r  c                   C   s6   t ttddt td  ttt dks2J d S )Nr   r   r   r   )r.   rB   r   r   r   r/   r   r   r   r   test_L5a  s    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  s    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  s    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spJ 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sXJ d S )Nre  Tr   r   r   r   )r   rn   rG   rx   r=   r   r  r   r   r   test_L9u  s    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    r  c                  C   sD   t dtd  dtd   dt  d t} tdd | D s@J d S )Nr   rp  r   !   r   c                 s   s   | ]}|j d djV  qdS )Tr   N)r   Zis_real)r"  r=  r   r   r   	<genexpr>  r%  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sJ 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 | ]4}t |t td d tt|t td d   qS )r   r   )r=   r   r   r   rA   r"  r   r   r   r   	<setcomp>  r%  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      rQ  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   re  Tr   r   r   )	r   r   r   r-   r   Realsrd   r.   r7   )r   re  r   r   r   test_M8  s
    (8r  c                   C   s   t dd S )Nz6solveset(exp(2-x**2)-exp(-x),x) has complex solutions.r   r   r   r   r   test_M9  s    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  s    r  c                   C   s$   t tt t ttddks J d S rG  )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sJ 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sFJ d S )Nr   r   r   )r   r   rA   r   r=   rc   r
   r   r   r   IntegersrH  r   r   r   test_M13  s    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  rH  r   r   r   test_M14  s    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 sJ d S )Nr   c                 3   s   | ]}  |V  qd S r   )Zdummy_eq)r"  r   gotr   r   r    r%  ztest_M15.<locals>.<genexpr>r   r   r   )r   r   rA   r   r   r;  anyrg   rc   r
   r   r  r   rH  r   r  r   test_M15  s    "&( r  c                  C   s<   t d} ttttt ttt| | t tj	ks8J d S )Nr   )
r   r   rA   r   rB   rc   r
   r   r   r  rH  r   r   r   test_M16  s    r  c                   C   s&   t tttt ttdks"J d S rk  )r   r;   r   r<   rd   r   r   r   r   test_M17  s    r	  c                   C   s6   t tttt ttttdd d ks2J d S )Nr   r   r   )r   r9   r   r<   rd   r7   r   r   r   r   test_M18  s    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    r  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  s    r  c                   C   s<   t dtt dttdd   d ttddks8J d S )Nr   r   r   r   r   )r   r7   r   r   rd   r   r   r   r   test_M22  s    r  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sbJ d S )Nr   Tr   r   r   r   r  )r   rq   r7   r   r   r;  r   r2  r   r   r   test_M23  s    2r  c                  C   sN   t dttddt   t} tdttd   d}| d  | ksJJ d S Nr   r   r   )rq   r!   r   r   r.   r   )solutionr  r   r   r   test_M24  s    r  c                  C   sf   t ddd\} }}}t d}t| ||  |||   |d  t||  t||   ksbJ d S )Nz:dTr  r   r   )r   rq   r   r.   )r  r  cdr   r   r   r   test_M25  s    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  s    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slJ 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*  s    r  c                  C   s4   t d} tt| d d tjdtddks0J d S )Nr   r   r   domainr  r   )r   r   r  r   r  rd   r2  r   r   r   test_M29/  s    r  c                   C   s4   t tdt d ttd  ttddks0J d S )Nr   r   r  )r   r  r   rd   r   r   r   r   test_M304  s    r  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    r   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    r"  c                   C   s8   t tdtd  ttd d  ttdddks4J d S )Nr   r   r   r  g,r!  r   r   r   r   test_M33I  s    r#  c                  C   sN   t ddd} tdt |  dt t|   dt  | tddt  ksJJ d S )Nre  Tr   r   r   r   )r   r   r   r(   rd   r  r   r   r   test_M34R  s    r$  c                  C   sL   t ddd\} }td|  d|  t|  dt   || tdksHJ d S )Nx yTr  r   r   )r   r   )r   r   r   Zas_real_imagrd   r  r   r   r   test_M35X  s    r&  c                   C   s4   t ttd tt d tttddks0J d S )Nr   r   r   )r   r   r   rd   r   r   r   r   test_M36]  s    r'  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   rd  re  rd   r   r   r   r   test_M37d  s    Br(  c            8      C   s  t d\} }}t| ||gt }td|}|j\1}}}}}	}
}}}}}}}}}}}}}}}}}}}}}} }!}"}#}$}%}&}'}(})}*}+},}-}.}/}0}1}2}3}4}5| | |  || |   | | |  || |   | | |  || |   | | || |   || |   | | |  || |   | | |  || |   | | |  || |   | | | |  || |   | | |  || |   | | | |  || |   || |   || |   ||	 |   ||	 |   ||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 |   |( |#|+ |	 |$ |* ||) || |& |  ||& |  |. |0d|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|1d|2 | |3 |  ||3 |   |  |4 | ||4 |  | |5 | ||5 |  |%|1 |2| |4 | ||4 |  |  |5 | ||5 |  g}6|5d|4d|3d|2d|1d|0d|-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|d|d|d|d|d|
d|	d|d|d|d|d|&|| |. |#|+|| | |. ||+i.}7t|6||7ksJ d S )Nza, b, czk1:50r   r   r   )r   r   rX   Z	to_domainr   Zgensr   )8r  r  r  r  Z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systemr  r   r   r   test_M38i  st    
hdd^Z`^\R^z\^N|h\^HL.<@HL8@:>NB28JHL*      	r*  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   rd  re  r   r   r   test_M39  s    X><@>r,  c                   C   s   t tt tt ksJ d S r   )r   r   r   r   r   r   r   test_N1  s    r-  c                  C   sP   t ddd} t| d |  d dkdu s,J t| d |  d dkdu sLJ d S )Nr   Tr  r   r   r   Fr   r   r2  r   r   r   test_N2  s     r/  c                  C   s8   t ddd} tttd| t| dt| dk s4J d S )Nr   Tr  r  r   )r   r   rN   r   r  r2  r   r   r   test_N3  s    r0  c                  C   sF   t ddd\} }td| d  d|d  k| |k|dk@ du sBJ d S )Nr%  Tr  r   r   r.  r  r   r   r   test_N4  s    r1  c                  C   sP   t ddd\} }}t|| d  ||d  k| |k|dk@ |dk@ du sLJ d S )Nzx y kTr  r   r   r.  )r   rd  r   r   r   r   test_N5  s    r2  c                  C   sZ   t ddd\} }}}t|| |  |||  k| |k|dk@ |dk@ |dk@ du sVJ d S )Nzx y k nTr  r   r.  )r   rd  r   r   r   r   r   test_N6  s    r3  c                  C   s:   t ddd\} }t|dk| dk|| d k@ du s6J d S )Nr%  Tr  r   r   r.  r  r   r   r   test_N7  s    r4  c                  C   sH   t ddd\} }}tt| |t||@ | |k||k@ || k@ sDJ d S )Nr   Tr  )r   r   r   r+  r   r   r   test_N8  s    r5  c                  C   sH   t d} tt| d dktjdttt dddtdtdksDJ d S )	Nr   r   r   r  r  FTr   )r   r   r  r   r  rg   rf   r   r2  r   r   r   test_N9  s    (
r6  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svJ d S )
Nr   r   r   r   r   r   r   r  T)r   r   r   r   r  rg   rf   r   )r   r#  r   r   r   test_N10  s    ($r7  c                  C   sF   t d} td| d  dktjdttt dddtdtksBJ d S )Nr   r   r   r  Tr   )r   r   r   r  rg   rf   r   r2  r   r   r   test_N11  s    r8  c                  C   s4   t d} tt| dk tjdtddddks0J d S )Nr   r   r  r   r   FT)r   r   r7   r   r  rf   r2  r   r   r   test_N12  s    r9  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  r2  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sLJ d S )Nr   r   r  r   T)	r   r   rA   r   r  rg   rf   r   r   r2  r   r   r   test_N14  s    *r;  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  rt  tr   r   r   test_N15  s    r?  c                  C   sB   t d\} }t| d t|d d  t|d  dk | tj d S )Nr<  r   r   r   )r   r   r=   rA   r   r  r=  r   r   r   test_N16  s    r@  c                   C   s6   t tt dktt dk fttftttk ks2J d S rk  )r   r   rd  r  r   r   r   r   test_N17  s    rA  c                  C   s:   t dt ddt f} tt| | jtdks6J d S )Nr   r   r   r   )r   r   r7   r   dotHMr   r   r   test_O1  s    rF  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    rH  c                   C   s   t dd S NzfThe vector module has no way of representing
        vectors symbolically (without respect to a basis)r   r   r   r   r   test_O3+  s    rJ  c                  C   s   ddl m} m} | d}| }| \}}}| \}}}	||| |	  ||| |	 d   ||d |	d    }
||
 d|d  |d  |	 d| |	d   | || |  d| |d  |	d  ||	  |  ksJ d S )Nr   )
CoordSys3DDelr   r   r   r   )Zsympy.vectorrK  rL  Zbase_vectorsZbase_scalarsrG  r  )rK  rL  r   Zdelopr   r   r   r   rd  re  Fr   r   r   test_O41  s    8rN  c                   C   s   t dd S rI  r   r   r   r   r   test_O5:  s    rO  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sJ 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"    "





rR  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   r3  T  r%  ztest_P1.<locals>.<lambda>r  r   r   )r   Zdiagonalr   r   r   r   test_P1S  s    
rS  c                  C   sN   t g dg dg dg} | d | d | t ddgddggksJJ d S )N)r   r   r   )r   r   r   )r   r   r   r   r   r   r   )r   Zrow_delZcol_delrD  r   r   r   test_P2X  s    


rT  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sJ d S )N)r   r   r   r   )rO  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   r3  n  r%  ztest_P3.<locals>.<lambda>)r   r   r   )ir  r   rO  r   )iiir   r   rV  )r   r   r   r   rZ  r\  )rO  r   r   r   r[  r  )r   r   r  r   rZ  )r   rU  r   rV  irY  )r   r   Tr}   
ValueError)r  A11A12ZA21ZA221ZA222A22r  r   rW  r   test_P3`  s0    
rc  c                   C   s   t dd S )Nz*Block matrix diagonalization not supportedr   r   r   r   r   test_P4z  s    rd  c                  C   s8   t ddgddgg} | d t ddgddggks4J d S )Nr   r   r   r   r   r   r   r   rD  r   r   r   test_P5  s    rf  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s`J d S r  )r   r=   r   rA   r   rD  r   r   r   test_P6  s    rg  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sJ d S )N)r   r   r   )r   r   r   )r   r   )r  r   rY  r   r   r   r   r   r   r   r   r   r   r   )r   r   rd  re  rD  r   r   r   test_P7  s    
<ri  c                  C   s6   t ddt gdt dgg} | jtjddks2J d S )Nr   r   r  r   )ordr   )r   r   normr   InfinityrD  r   r   r   test_P8  s    
rm  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sJ d S )Na b cT)Znonzeror   Zfror   )r   r   r\   rk  r  r  r  r  rE  r   r   r   test_P9  s    rp  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sZJ d S )Nr   r   r   r   r   r   )r   r   r   rC  rD  r   r   r   test_P10  s    rq  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sLJ d S Nr   r   r  )r   r   rd  invr   r   r   r   test_P11  s    
rt  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sdJ d S )Nr   ZADJF)evaluater  )r   r   rd  rs  r]   tuplerQ   )rE  r  r   r   r   test_P11_workaround  s    rw  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szJ d S )Nr`  ra  rb  r  )r   r   r   r   r   r   )r`  ra  rb  r  r   r   r   test_P12  s    "rx  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sJ t|t dtd td gd	d
td gd	d	td ggksJ d S )Nr   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   ZLUdecompositionrn   )rE  rQ  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sTJ 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)rE  r   rz  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   r  r   )r   rankrD  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}  rD  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spJ d S )Nr>  Tr  r   r   )r   r   rA   r=   r}  )r>  rE  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sVJ d S )	N)r   r   r   r   )r   r   r   r   )r  r   r   r   r   r   r   r  )r   Z	nullspacerD  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sBJ d S )Nw)r   r   r   r   r   r   )r   r   r   rd  re  det)r  rE  r   r   r   test_P19  s^    
Tr  c                   C   s   t dd S )Nz'Matrix minimal polynomial not supportedr   r   r   r   r   test_P20  s    r  c                  C   sP   t g dg dg dg} | t td dtd   dt  d ksLJ d S )N)r   r  r  )r   r   r   )r   r  r  r   r   r   r   )r   Zcharpolyr   Zas_exprrD  r   r   r   test_P21  s
    r  c                  C   s2   d} dt  t|  }| t  d | iks.J d S )Nrv  r   )r   r   	eigenvals)r  rE  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   rD  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sJ d S )Nc     @  r  r   r    q   r  r]  r  r  r  r  r  =   1   r   rW  r  r  r  r  r   rV  ;   r\  r  r  r  r        r  r  r]  r  rV  r  r  r  r  r  r  r   r  r  r  c   qr   r  rW  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  rD  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 sbJ qbd S )Nr  r  r  r  r  r  r  r  T)multiple)gMcdr  gyP9?     @@r  gx5F27ߏ@g     @gMcd@g-q=)r   r   sortedr  zipr  )ZMFZev_1Zev_2r   rd  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sJ 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a4rE  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sJ 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  rE  r   r   r   test_P27l  s(    


r  c                   C   s   t dd S NzQGeneralized eigenvectors not supported https://github.com/sympy/sympy/issues/5293r   r   r   r   r   test_P28  s    r  c                   C   s   t dd S r  r   r   r   r   r   test_P29  s    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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   r  )r   Zjordan_form)rE  rz  Jr   r   r   test_P30  s    
r  c                   C   s   t dd S )Nz!Smith normal form not implementedr   r   r   r   r   test_P31  s    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s`J d S )Nr   r   r   )r   r-   rewriter=   rn   r   rA   rD  r   r   r   test_P32  s    *r  c                  C   sh  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sdJ 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  r>  rE  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sJ d S )Nrn  Tr  r   r   r   )r   r   rA   r=   ro  r   r   r   test_P34  s     r  c                  C   s:   t d tg dg dg dg } t| tdks6J d S )Nr   )r   r   r   )r   r   r   )r   r   r   r   )r   r   rA   r   rD  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s4J d S )Nr   r   r   r   r   r   )r   r7   rD  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sJJ d S )N)r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r;  r   rD  r   r   r   test_P37  s    r  c                  C   sX   t g dg dg dg} tt" | tj  d s6J W d    n1 sJ0    Y  d S )Nr  )r   r   r   )r   r}   AssertionErrorr   r;  rD  r   r   r   test_P38  s    

r  c                   C   s   t ddS )zQ
    M=Matrix([
        [1, 1],
        [2, 2],
        [3, 3]])
    M.SVD()
    z,Singular value decomposition not implementedNr   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spJ d S )Nr<  Tr  )r   r   r=   rA   Zjacobian)rt  r>  rE  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spJ d S )Nr<  Tr  r   )r   rO   rA   r   r=   r=  r   r   r   test_P41  s    4 r  c                   C   s&   t ttttgt dks"J d S r]  )rP   r=   r   rA   rn   r   r   r   r   test_P42
  s    r  c                  C   sx   dd } t ddd\}}t|t| |t| g}| |||gtt|| t| gt||t| ggkstJ d S )Nc                    s   t  fdd|D jS )Nc                    s   g | ]}  |jqS r   )r   r^  r"  vrD  r   r   r$    r%  z3test_P43.<locals>.__my_jacobian.<locals>.<listcomp>)r   r^  )rE  Yr   rD  r   __my_jacobian  s    ztest_P43.<locals>.__my_jacobianr<  Tr  )r   r   r=   rA   )r  rt  r>  rE  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sxJ 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   r$    r%  z2test_P44.<locals>.__my_hessian.<locals>.<listcomp>c                    s   g | ]} j |qS r   )r^  r   r  )Vr   r   r$    r%  re  )r   r  r   )r  r   r   __my_hessian  s    ztest_P44.<locals>.__my_hessianr<  Tr  r   )r   rA   r   r=   )r  rt  r>  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   r$  #  r%  z4test_P45.<locals>.__my_wronskian.<locals>.<listcomp>r   )r   r   lenr  )r  r  rE  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   st   t dddd\} }}td|d}t|| df t||df |d|d f|  d | d|d f}|  tdd S )	Nzi j nTr>  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 nTr>  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sjJ d S )Nn kTr>  r  r   r   )r   r!   r   r   r  rh   )r   r   skr  r^  T2r   r   r   test_R3A  s    r  c                   C   s   t dd S )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sJ d S )Nz	a b c n kTr>  r  r   )r   r!   r   r   r  r"   )r  r  r  r   r   r  r  r^  r   r   r   test_R5c  s    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stJ d S )	Nr  Tr>  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sNJ d S )Nr  Tr>  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  Tr>  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  Tr>  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sJ |t}|t||  |ksJ d S )Nzn m r kTr>  r   )r   r   r!   r  rh   r  r"   )r   r   rt  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sPJ d S )Nr  Tr>  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sNJ d S )Nr  Tr>  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svJ d S r  )r   r   rA   r   r  rn   r>   r=   r  r   r   r   test_R13  s    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sTJ d S )Nr  Tr>  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sRJ d S )Nr   Tr>  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 sFJ d S )	Nr   Tr>  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s`J d S )Nr   Tr>  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stJ d S )
Nr   Tr>  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spJ d S )Nr  Tr>  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sZJ d S )Nr   Tr>  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sJ d S )	Nr  Tr>  r   r   r  r   r   )r   r   r"   r   rd  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sNJ d S )Nzm kTr>  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sNJ d S )	Nr   Tr>  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s2J d S Nr  Tr>  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sFJ d S r  )r   r   r   r  rn   r   r   r   r   test_S3  s    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    r  c                  C   sd   t dddd\} }td| d d|  |d| f  t| tj ttt| d   ks`J d S r  )	r   r   r  Z	gammasimprG   r   r;  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snJ 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sPJ d S )Nr   Tr>  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sJJ d S )Nr   Tr>  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sRJ d S )Nr   Tr>  r   r  r   )r   r   r   r  rn   r7   r  r   r   r   test_S97  s    (r	  c                  C   s^   t dddd} t| | d  d t | | d  d t  | dtf}| }| dksZJ d S )Nr   Tr>  r   r   r  )r   r   r   r   r  rn   r  r   r   r   test_S10A  s    4r
  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sFJ d S r  )r_   r   r   r   r=   r   r   r;  r   r   r   r   test_T1J  s     r  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  s    r  c                   C   s,   t tttttt  ttdks(J d S r]  )r_   r.   r   rA   r   r   r   r   r   test_T3S  s    r  c                   C   sZ   t tttt  tt tdtd  td    tt t tttd ksVJ d S )Nr   r   r   )r_   r-   r   r   r   r   r   r   test_T4W  s    4r  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snJ d S )Nr   r   r   )r_   r   r.   r-   r   r   r   r   r   r   test_T5\  s    2r  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  s    r  c                   C   s(   t dt ttd dt   tt d S r]  )r_   r   rG   r   r   r   r   r   test_T7e  s    r  c                  C   sJ   t ddd\} }tt||  t| t|  t|  |tdksFJ d S )Nza zTr  r   )r   r_   rG   r-   r.   r   )r  re  r   r   r   test_T8i  s    r  c                  C   s<   t ddd\} }ttd|fd| | |tt| ks8J d S )Nzz kTr  r   )r   )r   r_   rI   r   r-   )re  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 r  )r_   rx   r   r   r4   r   r   r   r   r   test_T10v  s    r  c                  C   sN   t dddd\} }t| t ttdt|  |d| f  | tttksJJ 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sPJ d S )Nx tTr  r   r   r   )r   r_   r   r-   )r   r>  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sHJ d S )
Nr   Tr  r   -dir+r  r   )r   r_   r  r2  r   r   r   test_T13  s    r  c                  C   s6   t ddd} ttt|  | dddtd ks2J d S )Nr   Tr  r   r  r  r   )r   r_   r<   r.   r   r2  r   r   r   test_T14  s    r  c                  C   s*   t ddd} tt| | t| ks&J d S )Nr   Tr  )r   r   r  r+   r2  r   r   r   test_U1  s    r  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sNJ d S )Nr   r  r   r
   r   r8   r   r  r   r   r   test_U2  s    "r!  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sXJ |ddkshJ d S r  r   )r   r  r   r   r   test_U3  s    ,r"  c                  C   sD   t dddd} t ddd}t||  || }|tt| ks@J d S )Nr   Tr>  r   r  )r   r   r  r"   )r   r   r  r   r   r   test_U4  s    r#  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sxJ | |ksJ d S )Nr>  r   )r   r   r   r   r   r  )r>  Zansr   r   r   test_U5  s    &*r$  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sfJ d S )Nr  )r	   r   r   rd  r   r   r   r   )r  r^  r   r   r   test_U6  s
    2r%  c                  C   s"   t ddd\} }tt| | d S )Nzp tTr  )r   r   r   )r#  r>  r   r   r   test_U7  s    r&  c                  C   sb   t ddd\} }t| | |  }t|| || | t| |  d | t| |  d  ks^J d S )Nr%  Tr  r   )r   r=   rM   rA   )r   rd  eqr   r   r   test_U8  s    r(  c                  C   s   t ddd\} }tt| || tt| || }|t| |t| d |d  }|  }|| | ttt| | | | d |d   d ksJ d S )Nr%  Tr  r   )	r   r   r   r  r   r  r\   r   r   )r   rd  Zsus2Zs3r   r   r   test_U9  s
    
 "	r*  c                   C   s:   t td d td d td   tdtddks6J d S )Nr   r   r   r   r  rh  )ra   re  r   r   r   r   r   test_U10  s    r+  c                   C   s   t d S r   r   r   r   r   r   test_U11  s    r,  c                   C   s   t dd S )Nz0External diff of differential form not supportedr   r   r   r   r   test_U12  s    r-  c                   C   s8   t td t d tddtdd  d d ks4J d S )Nr   r   r  r   r   r   )r   r   r   r   r   r   r   test_U13  s    r.  c                   C   s   t dd S )Nz$minimize(), maximize() not supportedr   r   r   r   r   test_U14	  s    r/  c                   C   s   t dd S )NzRminimize() not supported and also solve does not support multivariate inequalitiesr   r   r   r   r   test_U15
	  s    r0  c                   C   s   t dd S )Nz[minimize() not supported in SymPy and also solve does not support multivariate inequalitiesr   r   r   r   r   test_U16	  s    r1  c                   C   s   t dd S )Nz;Linear programming, symbolic simplex not supported in SymPyr   r   r   r   r   test_U17	  s    r2  c                  C   sJ   t ddd} tt| | t| d  d | dkf| d d dfksFJ d S )Nr   Tr  r   r   )r   r   r  r8   r2  r   r   r   test_V1	  s    r3  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sNJ d S )Nr   r   T)r   r8   r   r   r   r   r   test_V2!	  s     &r4  c                   C   s6   t dtd d  t  dtd d  ks2J d S )Nr   r   r   )r   r   r   rn   r   r   r   r   test_V3&	  s    r5  c                   C   s:   t dt tddt   ttdt td ks6J d S )Nr   r   r   )r   r   r7   r/   r.   r   r   r   r   test_V4*	  s    r6  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sfJ d S )	Nr   r   r   r   r   irb  -   )r   r   r   rn   r   r   r   r   test_V5.	  s    .0r8  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sxJ d S )Nr   r   r   r   rZ  )r   r-   r   r   r7   r.   r   r   r   r   test_V65	  s
    06r9  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    r<  c                   C   s   t dd S )Nz'Integrate with assumption not supportedr   r   r   r   r   
test_V8_V9A	  s    r=  c                   C   sJ   t dddtt  dtt   ttdttd  d d ksFJ d S )Nr   r   r   r   )r   r=   r   rA   r.   rB   r   r   r   r   test_V10R	  s    r>  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slJ d S )Nr   r   r   T)forcer   r   )	r   r=   r   rA   r\   rm   r.   rB   r   r;  r2r   r   r   test_V11V	  s
    &
,rB  c                  C   sF   t dddtt  dtt   t} | dttd d  ksBJ d S )Nr   r   r   r   r  r   )r   r=   r   rA   rB   r:  r   r   r   test_V12]	  s    &rC  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sfJ d S )Nr   r   r   r   r   r   )r   r=   r   rA   rn   r7   r<   rB   r:  r   r   r   test_V13b	  s    &rD  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snJ d S r  )r   r.   r  r   rd  rn   r:  r   r   r   test_V14j	  s     rE  c                  C   sR   t tttt  t} t| tt td td  ttt   d  dksNJ d S Nr   r   )r   r   r:   rd  rn   r:  r   r   r   test_V15s	  s    rG  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sZJ d S )Nr   r   r   r   r   )r   r=   r   ru   rA   rv   r   r   r   r   test_V16x	  s    rH  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 rF  )r   r   r   r   r   rn   r:  r   r   r   test_V17}	  s    rI  c                   C   s,   t dtt  ttd td fdks(J d S )Nr   r   )r   r   rd  r   r   r   r   test_W1	  s    rJ  c                   C   s0   t dtt d  ttd td ftu s,J d S r  )r   r   rd  r   r   r   r   r   test_W2	  s    rK  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    rN  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   rM  r   r   r   r   test_W4	  s    rO  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   rM  r   r   r   r   test_W5	  s    rP  c                   C   sH   t tddtdt   d tttdd t d ftdksDJ d S )Nr   r  r   )r   r7   r=   r   r   r   r   r   r   r   test_W6	  s    rQ  c                  C   sT   t ddd} ttttd | d   tt tf}| tt|   |  ksPJ d S )Nr  Tr  r   )r   r   r=   r   r   rn   r   r-   )r  r;  r   r   r   test_W7	  s    &rR  c                   C   s   t dd S )Nz1Integrate with assumption 0 < a < 1 not supportedr   r   r   r   r   test_W8	  s    rS  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   r@  r   r   r   test_W9	  s    :rT  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shJ d S )Nr   r   r   r   g      ?)r   r   r   r  r   r7   r?   r   r@  r   r   r   test_W10	  s    *rU  c                   C   s@   t tdtd  dtd   tddftdtd  ks<J d S rr  )r   r7   r   r   r   r   r   r   test_W11	  s    &rV  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 )Nr#  Tr  r1  r  r   r   )	r   r   r   r-   r   rn   r7   r   r   )r#  r1  r;  r   r   r   test_W12	  s    0rW  c                  C   sH   t dtt ddt   ttdt  tddf} | dt ksDJ d S )Nr   r   r   )r   r.   r   r   r:  r   r   r   test_W13	  s    4rX  c                   C   s6   t ttt tdt t  tt tfdks2J d S rF  )r   rA   r   r-   r   r   r   r   r   r   test_W14	  s    rY  c                   C   s:   t ttttdt t  tddftddks6J d S )Nr   r   r   r   )r   r.   rG   r   r=   r   r   r   r   r   r   test_W15	  s    rZ  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 rL  )r   rC   r   r   r   r   r   r   r   test_W18
  s    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
  s    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sJ 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rb  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
    *rc  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sJ d S )Nzt uTr  r   r   )r   Tr   )	r   r
   r   r8   rN   r   r=   rA   r6   )r>  ur=  r   r   r   test_W22
  s    "
 re  c                  C   sf   t ddd\} }ttttd td   t| |ftt tf}|t t |  t|  ksbJ d S Nr]  Tr  r   )r   r   r   rd  r   collectr   cancel)r  r  r;  r   r   r   test_W23#
  s    .ri  c                  C   s^   t ddd\} }ttttd td   tt tft| |f}|tt|  |  ksZJ d S rf  )r   r   r   rd  r   rg  r   )r  r  rA  r   r   r   	test_W23b*
  s    .rj  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s`J d S )Nr%  Tr  r   r   r   r   )r   r   r7   r/   rn   )r   rd  r;  r   r   r   test_W241
  s    ,rk  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sJ d S )Nza x yTr  r   r   r   )r   r   rA   r7   r   rn   )r  r   rd  i1i2r   r   r   test_W25;
  s    :rn  c                  C   sJ   t ddd\} }ttt|| d  |ddf| ddftdd	ksFJ d S )
Nr%  Tr  r   r   r  r   rQ  r   )r   r   r  r   r  r   r   r   test_W26F
  s    ro  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sjJ d S )Nrn  r   r   r   )r   r   re  r   rd  )r  r  r  r   r   r   test_W27L
  s    &rp  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sJ d S )Nv cTr  r   r   r   r   Zx0r   r   r   r   r   r   r   rb   r7   r`   )r  r  r   r   r   test_X1S
  s    "Rrt  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srJ d S )	Nrq  Tr  r   r   r   r   rr  rs  )r  r  s1r   r   r   test_X2Y
  s    $rv  c                  C   sl   t t tt   } tt }|ttd d  dtd  d  ttd  ks\J | |kshJ d S )Nr   r   r   r   r   )rA   r   rb   r=   rB   r`   )ru  r)  r   r   r   test_X3_
  s    4rw  c                  C   sf   t ttt  } | td  d td d  ttd  ksBJ t tttt  | ksbJ d S )Nr   r   r      )r.   rA   r   rb   r`   )ru  r   r   r   test_X4f
  s    .ry  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   rr  )	r	   r   rb   r   r   r   r   r   rd  )r  r  r  r  r  r   r   r   test_X5l
  s
    6rz  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sxJ d S )Nr]  F)r  Zscalarr   r   rr  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spJ 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sJ d S )Nr   Tr  r   r   r   rr  r   r   r      )r   rb   r7   r@   r   r   r`   r2  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spJ d S )Nr   r   rr  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slJ d S Nzz wr   r   rr  r   rb   r.   r1   r0   r`   re  r  r   r   r   test_X10
  s    &2r  c                  C   sl   t d\} }ttt| t| |  | dddtt|t|  | t| t|  t| d  kshJ d S r  r  r  r   r   r   test_X11
  s    "2r  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   rr  )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sBJ d S )Nr   r   rr  )rb   r7   r   r   r`   r   r   r   r   test_X13
  s    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sXJ d S )Nr   r   rH  )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   rr  r   r   r   r   r   r   )r   r   r-   r   rb   r`   )r   r>  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stJ d S )Nr   r   rr  r   r   r   )rb   r=   r   rd  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sdJ d S )Nr  r   r   )	r   r.   rA   r   r   r   r$   r"   r   r   r   r   r   test_X17
  s    Jr  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sbJ d S )Nr   r   r   r   r   )r   r   r-   r   rA   r   r   r;  r   r   r"   r   r  r   r   r   test_X18
  s    >r  c                   C   s   t dd S )NzTSolve using series not supported. Inverse Taylor series expansion also not supportedr   r   r   r   r   test_X19  s    r  c                   C   s   t dd S )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sJ 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 )`.
    r#  Tr  r   )r?  r   r   r   r  N)
r   r   r   ZanZformulaZbnr  	variablesr   rA   )r#  r   r=  r   r   r   test_X21"  s     *r  c                   C   s   t dd S )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 )	Nr>  Tr  r  r  r=  r   r   )r   r   r=   r>  r  r=  rM  rz  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 )
Nr>  Tr  r  r  r=  r   r   rn   )r   r   r=   )r>  r  r=  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sjJ d S )
Nr>  Tr  r  r  r=  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sZJ d S )	Nr>  Tr  r=  r   r  r   r  )r   r   rw   r7   r-   )r>  r=  rM  rz  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sJ t	|||d }t
|| |d	dgi}||d td|  dt|  d td|  ||d d	   ksPJ t||| }|t| d	 t| d }|ddt| d	   t| d	  dt| d  d t| d   t| t|   ksJ d S )Nr>  Tr  r=  rd  r  r   r   r   )Znocondsr   r   )r   r	   r   r   r   rt   r   r   r-   rq   r   r   rg  r=   )r>  r=  rd  r  rM  DZYfZyfr   r   r   
test_Y5_Y6t  s<    >J 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sJ d S )
Nr>  Tr  r  r  r=  r   r   r  )r   r   r   r   rt   r   r-   )r>  r  r=  rM  rz  r   r   r   test_Y7  s    
r  c                   C   s   t dttttksJ d S r]  )r   r   re  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sBJ d S )Nrh  r   r   r   )r   r-   r   re  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slJ d S )	Nr  r  r   rp  r   r   r   rS  )r   r  r   r-   re  rh  r   r   r   r   r   test_Y10  s    "Br  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   r=  rM  rz  r   r   r   test_Y11  s    r  c                  C   sd   t d\} }ttd| | d  | |\}}}|d|d   t|d  t| d d  ks`J d S )Nr  r   r   r   )r   r   rC   rG   r  r   r   r   test_Y12  s     r  c                   C   s   t dd S Nzz-transform not supportedr   r   r   r   r   test_Y13  s    r  c                   C   s   t dd S r  r   r   r   r   r   test_Y14  s    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slJ d S )Nrt  r   r   r   )r	   r   r   r   rn   rt  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sbJ d S )Nrt  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sJ d S )Nrt  r   r   r   r   )r	   r   r7   r   r   )rt  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sJ d S )Nrt  r  r   r   r   r   )r	   r   r   r   )rt  r  r=  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sJ ttt	|tt}t
|d|df}|t| ||  ||| }|t tdt  d tdt d  ksJ tdd S )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C2r'  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sJ d S )Nr>  Tr  r=  r   r   )r   r   r   rA   r   r   )r>  r=  r'  rM  rz  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   r4  rS   r5  rT   r8  rU   r:  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   r  r   r   rd  re  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r&  r'  r)  r*  r-  r.  r/  r6  r7  r9  r<  rA  rC  rD  rE  rF  rI  rM  r^  r_  r1  r`  ra  rg  rh  ri  rj  rl  rm  rn  rs  ru  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   r  r  r  r  r	  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  r7  r8  r9  r:  r;  r?  r@  rA  rF  rH  rJ  rN  rO  rR  rS  rT  rc  rd  rf  rg  ri  rm  rp  rq  rt  rw  rx  r{  r|  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  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>  rB  rC  rD  rE  rG  rH  rI  rJ  rK  rN  rO  rP  rQ  rR  rS  rT  rU  rV  rW  rX  rY  rZ  r\  r^  r_  r`  rb  rc  re  ri  rj  rk  rn  ro  rp  rt  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   <module>   s  $(0$






















	















BN>





				


?			

			
			
		
	
			
 !
