a
    {dRq                    @   sD  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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.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4m5Z5 ddl6m7Z7m8Z8m9Z9 ddl:m;Z;m<Z<m=Z=m>Z> ddl?m@Z@mAZA ddlBmCZCmDZDmEZE ddlFmGZG ddlHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZR ddlSmTZT ddlUmVZV ddlWmXZXmYZY ddlZm[Z[m\Z\ ddl]m^Z^ ddl_m`Z`maZa ddlbmcZc ddldmeZe ddlfmgZg ddlhmiZimjZj dd lkmlZl dd!lmmnZompZqmrZsmtZu dd"lvmwZwmxZx 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d9lUmZ dd:lmZmZmZ dd;lbmZ dd<lmZmZmZmZmZmZ 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dIlmZmZmZmZmZ 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 Zdhdi 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Ǆ Z/ddɄ Z0edd˄ Z1dd̈́ Z2eddτ Z3ddф Z4ddӄ Z5ddՄ Z6ddׄ Z7ded  ded   ded   ded   ded   d Z8ded  ded   ded   ded   ded   ded   d Z9ded  ded   ded   ded   de  d Z:dd Z;dd Z<dd Z=dd Z>dd Z?dd Z@dd  ZAdd ZBedd ZCdd ZDdd ZEd	d
 ZFdd ZGedd ZHdd ZIedd ZJedd ZKdd ZLdd ZMdd ZNdd ZOdd ZPdd  ZQed!d" ZRed#d$ ZSd%d& ZTd'd( ZUed)d* ZVd+d, ZWd-d. ZXed/d0 ZYd1d2 ZZd3d4 Z[ed5d6 Z\ed7d8 Z]ed9d: Z^ed;d< Z_ed=d> Z`d?d@ ZaedAedBdC ZbedDdE ZcdFdG ZddHdI ZeedJdK ZfdLdM ZgdNdO ZhdPdQ ZidRdS ZjdTdU ZkdVdW ZldXdY ZmdZd[ Zned\d] Zod^d_ Zpd`da Zqedbdc Zreddde Zsdfdg Ztedhdi Zudjdk Zvdldm Zwedndo Zxdpdq Zydrds Zz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} Ze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݄ Z/edސd߄ Z0edd Z1edd Z2dd Z3dd Z4dd Z5dd Z6edd Z7edd Z8dd Z9edd Z:dd Z;dd Z<dd Z=edd Z>eedd Z?dd Z@ed d ZAedd ZBedd ZCedd ZDeedd	 ZEeed
d ZFeedd ZGeedd ZHdd ZIedd ZJeedd ZKedd ZLedd ZMdd ZNedd ZOdd ZPed d! ZQd"d# ZRd$d% ZSd&d' ZTed(d) ZUed*d+ ZVd,d- ZWd.d/ ZXed0d1 ZYd2d3 ZZeed4d5 Z[eed6d7 Z\d8d9 Z]d:d; Z^d<d= Z_d>d? Z`d@dA ZadBdC ZbedDdE ZcdFdG ZddHdI ZedJdK ZfdLdM ZgdNdO ZhdPdQ ZiedRdS ZjdTdU ZkedVdW ZledXdYdZ Zmd[d\ Zned]d^ Zoed_d` Zpedadb Zqedcdd Zrdedf Zsedgdh Ztdidj Zudkdl Zvdmdn Zwdodp Zxdqdr Zyedsdt Zzedudv Z{dwdx Z|dydz Z}ed{ed|d} Z~ed~d Ze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)	AlgebraicNumberEIRationaligcdnanoopizoo)EqLt)S)DummySymbolsymbols)rfbinomial	factorial
factorial2)	bernoulli	fibonacci)	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totient)
primerangenpartitions)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skipON_CI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)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   j/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/sympy/utilities/tests/test_wester.pytest_B1w   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   )rS   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   r4   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   r4   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   r4   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   r4   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   )r4   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   r4   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   r4   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   )r4   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   r4   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   )r1   r   r0   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_D80  s    r  c                   C   s   t dd S )Nztranslate D8 to FORTRANr   r   r   r   r   test_D98  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_D11B  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_D12H  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_D13M  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_F1W  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_F2[  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_F4d  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   )rD   r   r   r4   r   r!   r   r   r   r   test_F5i  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>o      ztest_F6.<locals>.<listcomp>r   r   )r   r   r   )r   r   r   )ZpartTestZpartDesiredr   r   r   test_F6n  s    &r%  c                   C   s   t ddksJ d S )Nr   r   rV   r   r   r   r   test_F7t  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_F8x  s    r(  c                   C   s   t ddksJ d S )Nr   i@  )rT   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 )listrU   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   r4   r  Zlimit_denominatorr   r+  r   cf_ccf_ir   r   r   r   test_G15  s    $ r5  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   r4  r   r   r   r   r   test_G16  s    r6  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    r8  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   )r7  cf_rr   r   Halfr4   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   r4  r*   r+  r   )r<  itr   r   r   test_G19  s    $r@  c                  C   s:   t dddd} td|  gg| t| d d  ks6J d S )Nr<  Tr=  r   r   )r   r9  r4   r<  r   r   r   test_G20  s    rB  c                  C   s6   t dddd} t| d| d d d|  ggks2J d S )Nr<  Tr=  r   r   )r   r7  rA  r   r   r   	test_G20b  s    rC  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    $rD  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    rE  c                   C   s   dt t d   dksJ d S Nr  r   r   r   r   r   r   test_H3  s    rH  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    rL  @   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]  r0  r^  r   r   r   r   test_H6  s    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  }t| |t ttdksJ d S )Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   rY  r   r   r   r   P   r   r   r   yzr]   r]  r^  r   r   r   test_H7  s    `drf  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   rY  r   r   r   r   ra  r   r   r   r   rb  )r]  r^  r0  r   r   r   test_H8  s    `dTrg  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    rh  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^   re  r   r   r   test_H10  s    (ri  c                   C   s    t tt tt tdksJ d S Nr   )r^   r]  r0  r^  r   r   r   r   r   test_H11  s    rk  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    rl  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    rm  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   rY     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














rr  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   r1  )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    rt  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   rY  r   r   r   (      r\   r   r   r   r   r   test_H16  s2    6""ry  c                   C   s(   t tttt tt  dks$J d S rj  )rn   r\   r   r]  r^  r   r   r   r   test_H17  s    rz  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   ro     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_H200  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_H216  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   modulusrx  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_H24F  s    &r  c                  C   s8   t dtd   dtd   d } tt| | ks4J d S )Nr   r   rY  r   rc  rd  r\   r   )er   r   r   test_H25L  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   rY  F)r   )r   r>   r   r:   rc  r?   rd  r\   )r   r   r   r   test_H26Q  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   rY  r   r   r   r   ra  r   r   r   rv  r  )r   r   hr   r   r   test_H27V  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   rN  rY  r   r  )r\   r   rc  r   r   r   r   test_H29e  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   rc  r4   r   r   )r   answerr   r   r   test_H30j  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_H31p  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_H32v  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   )r?   r   r   r4   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   )r4   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   r>   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   r>   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   rw  r   )r>   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   r>   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   r?   r   r:   r>   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_   r?   r   r:   r>   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   r?   r   r:   r>   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   rB   r   rc  rC   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   )rD   r   r4   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   )rE   r   r+   r4   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)mpmathr@   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   r@   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   )	r@   r   rd  r>   r:   r4   r   rn   r   )r"  r0  r   r   r   test_J8  s    $r  c                   C   s$   t dttt dt ks J d S )Nr   r   )r@   rd  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   rG   r4   r   rD   )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   rG   r   r   r4   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   rH   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   rH   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  )rF   r   r:  r   rd  ri   r8   )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   rA   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   )absr4   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   r4   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   r9   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   r?   r   r   r>   r:   r-   r.   r   rc  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  )r4   r   rc  r  rd  r   r   r   r   test_K61  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 )Nrc  TF)r  r  r   )r   r4   r   r  rd  rn   )rc  rK  Zsexprr   r   r   test_K76  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 )Nrd  Tr   r   r   F)r   r  r   rn   r4   rd  r   r   r   test_K8=  s    $r  c                  C   s4   t ddd} ttd|  dt|   dks0J d S )Nrd  Tr>  r   r   r  r  r   r   r   test_K9D  s    r  c                  C   s4   t ddd} ttd|  dt|   dks0J d S )Nrd  T)r  r   r   r  r  r   r   r   test_K10I  s    r  c                   C   s"   t ddtdd  dksJ d S )Ni  i;r   r   r   r4   r   r   r   r   r   test_L1R  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_L2V  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_L3Z  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   r>   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+   r?   r   r   r   r,   r   r   r   r   test_L5b  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+   r?   r   r   r,   r   subsr   r   r   r   test_L6g  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+   r4   r   r   r   r   r   test_L7k  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   r4   r   r   r   r   test_L8p  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 )Nrd  Tr   r   r   r   )r   rn   rD   rx   r:   r   r  r   r   r   test_L9v  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   ro  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   r4   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   r>   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      rP  r   r  )r  rq   r   r4   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   rd  Tr   r   r   )	r   r   r   r*   r   Realsrd   r+   r4   )r   rd  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 rF  )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   r>   r:   r   r   r+   r4   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   r>   r   r:   rc   r
   r   r   r   IntegersrG  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   r?   r   rc   r
   r   r   r   rG  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   r>   r   r   r:  anyrg   rc   r
   r   r   r   rG  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   r>   r   r?   rc   r
   r   r   r   rG  r   r   r   test_M16  s    r  c                   C   s&   t tttt ttdks"J d S rj  )r   r8   r   r9   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   r6   r   r9   rd   r4   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   r4   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   r4   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   r4   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   r4   r   r   r:  r   r1  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   r4   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+   r6   r8   r   r>   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   r1  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   r2   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   r2   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 )Nrd  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   rc  rd  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   r4   r   r   r   rc  rd  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   r1  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   rK   r   r  r1  r   r   r   test_N3  s    r/  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    r0  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   rc  r   r   r   r   test_N5  s    r1  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   rc  r   r   r   r   r   test_N6  s    r2  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    r3  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    r4  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   r1  r   r   r   test_N9  s    (
r5  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    ($r6  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   r1  r   r   r   test_N11  s    r7  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   r4   r   r  rf   r1  r   r   r   test_N12  s    r8  c                  C   s,   t d} tt| dk tjdtjks(J d S )Nr   r   r  )r   r   r>   r   r  r1  r   r   r   test_N13  s    r9  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   r>   r   r  rg   rf   r   r   r1  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  rs  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:   r>   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 rj  )r   r   rc  r  r   r   r   r   test_N17  s    r@  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   r4   r   dotHMr   r   r   test_O1  s    rE  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    rG  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    rI  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.vectorrJ  rK  Zbase_vectorsZbase_scalarsrF  r  )rJ  rK  r   Zdelopr   r   r   r   rc  rd  Fr   r   r   test_O41  s    8rM  c                   C   s   t dd S rH  r   r   r   r   r   test_O5:  s    rN  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"    "





rQ  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   r2  T  r$  ztest_P1.<locals>.<lambda>r  r   r   )r   Zdiagonalr   r   r   r   test_P1S  s    
rR  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_delrC  r   r   r   test_P2X  s    


rS  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   )rN  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   r2  n  r$  ztest_P3.<locals>.<lambda>)r   r   r   )ir  r   rN  r   )iiir   r   rU  )r   r   r   r   rY  r[  )rN  r   r   r   rZ  r  )r   r   r  r   rY  )r   rT  r   rU  irX  )r   r   Tr~   
ValueError)r  A11A12ZA21ZA221ZA222A22r  r   rV  r   test_P3`  s0    
rb  c                   C   s   t dd S )Nz*Block matrix diagonalization not supportedr   r   r   r   r   test_P4z  s    rc  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   rC  r   r   r   test_P5  s    re  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   r>   r   rC  r   r   r   test_P6  s    rf  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   rX  r   r   r   r   r   r   r   r   r   r   r   )r   r   rc  rd  rC  r   r   r   test_P7  s    
<rh  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   InfinityrC  r   r   r   test_P8  s    
rl  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\   rj  r  r~  r  r  rD  r   r   r   test_P9  s    ro  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   rB  rC  r   r   r   test_P10  s    rp  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   rc  invr   r   r   r   test_P11  s    
rs  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   rc  rr  r]   tuplerN   )rD  r  r   r   r   test_P11_workaround  s    rv  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_  r`  ra  r  )r   r   r   r   r   r   )r_  r`  ra  r  r   r   r   test_P12  s    "rw  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   )rD  rP  U_r   r   r   test_P13  s    ,(rz  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)rD  r   ry  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   rankrC  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   r4   r|  rC  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   r>   r:   r|  )r=  rD  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	nullspacerC  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   rc  rd  det)r  rD  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_exprrC  r   r   r   test_P21  s
    r  c                  C   s2   d} dt  t|  }| t  d | iks.J d S )Nru  r   )r   r   	eigenvals)r  rD  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   rC  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   rV  r  r  r  r  r   rU  ;   r[  r  r  r  r        r  r  r\  r  rU  r  r  r  r  r  r  r   r  r  r  c   qr   r  rV  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  rC  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   rc  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a4rD  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~  rD  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)rD  ry  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   r>   rC  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   r>   )r  r=  rD  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 )Nrm  Tr  r   r   r   )r   r   r>   r:   rn  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   r>   r   rC  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   r4   rC  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   rC  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:  rC  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:   r>   Zjacobian)rs  r=  rD  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   rL   r>   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\  )rM   r:   r   r>   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!  vrC  r   r   r#    r$  z3test_P43.<locals>.__my_jacobian.<locals>.<listcomp>)r   r]  )rD  Yr   rC  r   __my_jacobian  s    ztest_P43.<locals>.__my_jacobianr;  Tr  )r   r   r:   r>   )r  rs  r=  rD  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$  rd  )r   r  r   )r  r   r   __my_hessian  s    ztest_P44.<locals>.__my_hessianr;  Tr  r   )r   r>   r   r:   )r  rs  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  rD  r   r  r   __my_wronskian"  s     z test_P45.<locals>.__my_wronskianr   )r:   r   r>   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   rs  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   r>   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   r>   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    r1   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+   r4   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   r4   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   rc  r   r  r4   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   rD   r  rn   r4   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	gammasimprD   r   r:  r4   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   r4   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   r>   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   rD   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_   rD   r*   r+   r   )r~  rd  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_   rF   r   r*   )rd  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   r1   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   rD   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  r1  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_   r9   r+   r   r1  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(   r1  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   r5   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   rc  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:   rJ   r>   )r   rc  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   rc  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  rg  )ra   rd  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    r/  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    r0  c                   C   s   t dd S )Nz;Linear programming, symbolic simplex not supported in SymPyr   r   r   r   r   test_U17	  s    r1  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  r5   r1  r   r   r   test_V1	  s    r2  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   r5   r   r   r   r   r   test_V2!	  s     &r3  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    r4  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   r4   r,   r+   r   r   r   r   test_V4*	  s    r5  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   ira  -   )r   r   r   rn   r   r   r   r   test_V5.	  s    .0r7  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   rY  )r   r*   r   r   r4   r+   r   r   r   r   test_V65	  s
    06r8  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   r.   r   r-   rn   r   r/   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   r>   r+   r?   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   r>   r\   rm   r+   r?   r   r:  r2r   r   r   test_V11V	  s
    &
,rA  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   r>   r?   r9  r   r   r   test_V12]	  s    &rB  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   r>   rn   r4   r9   r?   r9  r   r   r   test_V13b	  s    &rC  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   rc  rn   r9  r   r   r   test_V14j	  s     rD  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   r7   rc  rn   r9  r   r   r   test_V15s	  s    rF  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   r>   rv   r   r   r   r   test_V16x	  s    rG  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 rE  )r   r   r   r   r   rn   r9  r   r   r   test_V17}	  s    rH  c                   C   s,   t dtt  ttd td fdks(J d S )Nr   r   )r   r   rc  r   r   r   r   test_W1	  s    rI  c                   C   s0   t dtt d  ttd td ftu s,J d S r  )r   r   rc  r   r   r   r   r   test_W2	  s    rJ  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   r4   r   r   r   r   r   r   test_W3	  s    rM  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   rL  r   r   r   r   test_W4	  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   r   rL  r   r   r   r   test_W5	  s    rO  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   r4   r:   r   r   r   r   r   r   r   test_W6	  s    rP  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    &rQ  c                   C   s   t dd S )Nz1Integrate with assumption 0 < a < 1 not supportedr   r   r   r   r   test_W8	  s    rR  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   r4   r?  r   r   r   test_W9	  s    :rS  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   r4   r<   r   r?  r   r   r   test_W10	  s    *rT  c                   C   s@   t tdtd  dtd   tddftdtd  ks<J d S rq  )r   r4   r   r   r   r   r   r   test_W11	  s    &rU  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  r0  r  r   r   )	r   r   r   r*   r   rn   r4   r   r   )r"  r0  r:  r   r   r   test_W12	  s    0rV  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   r9  r   r   r   test_W13	  s    4rW  c                   C   s6   t ttt tdt t  tt tfdks2J d S rE  )r   r>   r   r*   r   r   r   r   r   r   test_W14	  s    rX  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+   rD   r   r:   r   r   r   r   r   r   test_W15	  s    rY  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   r@   r   r4   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 rK  )r   r@   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   r@   r4   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   rI   r   r   rx   r+   r   r   r   r   test_W20
  s
    $"4ra  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   rI   r   r   r   r   test_W21
  s
    *rb  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   r5   rK   r   r:   r>   r3   )r=  ur<  r   r   r   test_W22
  s    "
 rd  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   rc  r   collectr   cancel)r~  r  r:  r   r   r   test_W23#
  s    .rh  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 re  )r   r   r   rc  r   rf  r   )r~  r  r@  r   r   r   	test_W23b*
  s    .ri  c                  C   sp   t rtd tddd\} }ttt| d |d  | ddf|ddf}|tdtd d   dkslJ d S )	NToo slow for CI.r$  Tr  r   r   r   r   )r}   r|   r   r   r4   r,   rn   )r   rc  r:  r   r   r   test_W241
  s
    ,rk  c                  C   s   t rtd 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 )Nrj  za x yTr  r   r   r   )r}   r|   r   r   r>   r4   r   rn   )r~  r   rc  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   rP  r   )r   r   r  r   r  r   r   r   test_W26J
  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 )Nrm  r   r   r   )r   r   rd  r   rc  )r~  r  r  r   r   r   test_W27P
  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   r4   r`   )r  r  r   r   r   test_X1W
  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_X2]
  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   )r>   r   rb   r:   r?   r`   )ru  r(  r   r   r   test_X3c
  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+   r>   r   rb   r`   )ru  r   r   r   test_X4j
  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   rc  )r  r~  r  r  r  r   r   r   test_X5p
  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   r4   r=   r   r   r`   r1  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+   r.   r-   r`   rd  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   r4   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   rG  )rb   r   r    r   r   r4   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   rc  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+   r>   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   r>   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   r>   )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_X228  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<  rL  ry  r   r   r   test_Y1Y  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_Y2a  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   r.   r-   r  r   r   r   test_Y3i  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   r4   r*   )r=  r<  rL  ry  r   r   r   test_Y4q  s    "r  c                  C   s   t ddd} t d}td}tt|| | d||  dt| d t| d    | |dd	\}}}||d t|| | | ||d
  t|| | | tt|| | | d
 ddt|  td|  |   j	dd}|d
ksJ d S )Nr=  Tr  r<  rc  r   r   r   r  r   r   F)r  )
r   r	   r   r   rt   r   r   r   r*   rn   )r=  r<  rc  rL  ry  Dr   r   r   
test_Y5_Y6x  s$    $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<  rL  ry  r   r   r   test_Y7  s    
r  c                   C   s   t dttttksJ d S r\  )r   r   rd  rA   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 )Nrg  r   r   r   )r   r*   r   rd  r4   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   ro  r   r   r   rR  )r   r  r   r*   rd  rg  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<  rL  ry  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   r@   rD   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 )Nrs  r   r   r   )r	   r   r   r   rn   rs  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 )Nrs  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 )Nrs  r   r   r   r   )r	   r   r4   r   r   )rs  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 )Nrs  r  r   r   r   r   )r	   r   r   r   )rs  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   r>   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   r>   r   r   )r=  r<  r&  rL  ry  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.numbersr   r   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$   Z$sympy.functions.elementary.complexesr%   r&   r'   r(   Z&sympy.functions.elementary.exponentialr)   r*   r+   Z%sympy.functions.elementary.hyperbolicr,   r-   r.   r/   Z#sympy.functions.elementary.integersr0   r1   Z(sympy.functions.elementary.miscellaneousr2   r3   r4   Z$sympy.functions.elementary.piecewiser5   Z(sympy.functions.elementary.trigonometricr6   r7   r8   r9   r:   r;   r<   r=   r>   r?   Zsympy.functions.special.besselr@   Z'sympy.functions.special.delta_functionsrA   Z*sympy.functions.special.elliptic_integralsrB   rC   Z'sympy.functions.special.gamma_functionsrD   rE   Zsympy.functions.special.hyperrF   Z#sympy.functions.special.polynomialsrG   rH   Z&sympy.functions.special.zeta_functionsrI   Zsympy.geometry.utilrJ   Zsympy.logic.boolalgrK   Zsympy.matrices.denserL   rM   Z!sympy.matrices.expressions.matmulrN   Z sympy.ntheory.continued_fractionrO   r3  rP   r4  rQ   r7  rR   r9  Zsympy.ntheory.factor_rS   rT   Zsympy.ntheory.generaterU   Zsympy.ntheory.partitions_rW   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}   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   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   rc  rd  r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r
  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r%  r&  r(  r)  r,  r-  r.  r5  r6  r8  r;  r@  rB  rC  rD  rE  rH  rL  r]  r^  r0  r_  r`  rf  rg  rh  ri  rk  rl  rm  rr  rt  ry  rz  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  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@  rE  rG  rI  rM  rN  rQ  rR  rS  rb  rc  re  rf  rh  rl  ro  rp  rs  rv  rw  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/  r0  r1  r2  r3  r4  r5  r7  r8  r;  r<  r=  rA  rB  rC  rD  rF  rG  rH  rI  rJ  rM  rN  rO  rP  rQ  rR  rS  rT  rU  rV  rW  rX  rY  r[  r]  r^  r_  ra  rb  rd  rh  ri  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>





				


?			

			
			
		
	
		

 
