o
    jg;  ã                   @   sn  d dl mZ d dlmZ d dlmZmZmZmZ d dl	m
Z
 d dlmZmZ d dlmZmZmZ d dlmZmZ d dlmZmZ d d	lm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$m%Z% d dl&m'Z' eddd\Z(Z)Z*dd„ Z+dd„ Z,dd„ Z-dd„ Z.dd„ Z/dd„ Z0dd „ Z1d!d"„ Z2d#d$„ Z3d%d&„ Z4d'd(„ Z5d)d*„ Z6d+d,„ Z7d-d.„ Z8e%d/d0„ ƒZ9d1S )2é    )ÚSum)ÚAdd)ÚIÚRationalÚooÚpi)ÚS)ÚSymbolÚsymbols)ÚbinomialÚ	factorialÚsubfactorial)Ú	fibonacciÚharmonic)ÚexpÚlog)Úsqrt)ÚcosÚsin)Úgamma)Ú	limit_seq)Údifference_delta)ÚraisesÚXFAIL)ÚAccumulationBoundszn m kT©Úintegerc                     st   t t d  } | t ‰ t| ƒdt  d ksJ ‚tˆ t dƒtdt  d  ks&J ‚tt‡ fdd„ƒ tt‡ fdd„ƒ d S )Né   é   é   é   c                      s   t ˆ ƒS ©N)Údd© ©Úe2r#   úX/var/www/html/zoom/venv/lib/python3.10/site-packages/sympy/series/tests/test_limitseq.pyÚ<lambda>   s    z'test_difference_delta.<locals>.<lambda>c                      s   t ˆ ttƒS r!   )r"   Únr   r#   r$   r#   r&   r'      ó    )r(   Úkr"   r   Ú
ValueError©Úer#   r$   r&   Útest_difference_delta   s    r.   c                  C   s  t dt tdtfƒ} t| tƒdtd  ksJ ‚t| tdƒtdd„ tdƒD ƒŽ ks*J ‚t dt tddt fƒ} t| tƒtdd„ tdƒD ƒŽ ksHJ ‚tt dt tdtfƒ } t| tƒdt dt tdtfƒ ksgJ ‚t dt tdtftdtfƒ} t| tƒttƒks€J ‚d S )Nr   é   c                 S   ó   g | ]
}d |t  d   ‘qS ©r   ©r(   ©Ú.0Úir#   r#   r&   Ú
<listcomp>"   ó    z.test_difference_delta__Sum.<locals>.<listcomp>é   c                 S   s    g | ]}d |dt   d   ‘qS )r   r8   r2   r3   r#   r#   r&   r6   %   s     )r   r*   r(   r"   r   ÚrangeÚmr   r,   r#   r#   r&   Útest_difference_delta__Sum   s   &$&r;   c                  C   sª   t t t d   } t| t ƒdt  d ksJ ‚t| t dƒdt  d ks#J ‚t tdt tdt fƒ } t| t ƒddt d   ks>J ‚t| t dƒdtdd„ tdƒD ƒŽ  ksSJ ‚d S )	Nr   r   r8   r   é   r/   c                 S   r0   r1   r2   r3   r#   r#   r&   r6   5   r7   z.test_difference_delta__Add.<locals>.<listcomp>)r(   r"   r   r*   r   r9   r,   r#   r#   r&   Útest_difference_delta__Add.   s   .r=   c                  C   sä   dt  } t| t ƒddt   ksJ ‚t| t dƒddt   ksJ ‚ddt   } t| t ƒdddt    ks4J ‚t| t dƒdddt    ksDJ ‚t d } t| t ƒt d d t d  ksYJ ‚t t  } t| t ƒt d t d  t t   kspJ ‚d S )Nr   r8   r   é   éÿ   r   )r(   r"   r,   r#   r#   r&   Útest_difference_delta__Pow8   s    "*r@   c                      sä  t dt tƒtt dt tƒtdtfƒ ‰ tˆ ƒtdƒd ks J ‚tˆ tƒˆ ks)J ‚dtd  dtd   d dtd  dt  d  ‰ tˆ tƒtdƒd ksPJ ‚ttƒtttƒtdtfƒ ttdt ƒd   ‰ tˆ tƒdksqJ ‚ttd tdt t tdtfƒ tdtfƒdt t  ‰ tˆ tƒdks–J ‚tt dt tƒt dt tƒ tdtfƒt dt tƒt dt tƒ  ‰ tˆ tƒtdƒd ksÅJ ‚tttƒd t tddt fƒttƒd  ‰ tˆ tƒtjd ksçJ ‚t	t
‡ fdd	„ƒ d S )
Nr   r   r8   r   r/   i—I i—E c                      s   t ˆ t ƒS r!   )r   r:   r#   r,   r#   r&   r'   ]   r)   z test_limit_seq.<locals>.<lambda>)r   r(   r   r*   r   r   r:   r   ÚOner   r+   r#   r#   r,   r&   Útest_limit_seqH   s    (408&ÿ,rB   c                   C   sb  t dt td  tƒdksJ ‚t dtd  tdt   tƒdks"J ‚t dt dt  td  tƒdks5J ‚t ttt ƒtƒdksBJ ‚t tdt t ƒtƒdksQJ ‚t tjd t tƒdks_J ‚t tddƒt tƒdksmJ ‚t td t tƒdkszJ ‚t t	tƒtd t  tƒdks‹J ‚t td td t  tƒdksœJ ‚t ttd  td t  tƒdks¯J ‚d S )	Néÿÿÿÿr   r   éþÿÿÿr   r8   r/   é   )
r   r(   r   r   r   r   ÚNegativeOner   r   r   r#   r#   r#   r&   Útest_alternating_sign`   s   &&""*rG   c                   C   sÄ   t dt tƒtddƒksJ ‚t ttt ƒtƒtddƒksJ ‚t ttt d ƒd tƒtddƒks2J ‚t ddt  tdt   tƒtddƒksHJ ‚t dt td  ddt   tƒtddƒks`J ‚d S )	NrC   r   r   r   éýÿÿÿr8   rD   r/   )r   r(   r   r   r   r   r#   r#   r#   r&   Útest_accum_boundsn   s
    (,4rI   c                  C   sô   ddl m} m}m} ttd|  | d|fƒt|ƒ |ƒtjks J ‚ttd|  | d|fƒd|  |ƒtj	u s6J ‚tt
d|  | ƒtt
d| |ƒ|d| fƒ | ƒtdƒd ksUJ ‚tt|d td| | |d|fƒ |d| fƒd|  |   | ƒdksxJ ‚d S )Nr   ©ÚxÚyÚzr   r   r8   r   )Ú	sympy.abcrK   rL   rM   r   r   r   r   Ú
EulerGammaÚInfinityr   rJ   r#   r#   r&   Útest_limitseq_sumv   s   ,,,
ÿ,
ÿÿÿrQ   c                   C   s&   t ttƒttƒ tƒtdƒksJ ‚d S )NrC   )r   r   r(   r   r   r#   r#   r#   r&   Útest_issue_9308€   s   &rR   c                  C   s8   t ddd} tt| d ƒt| ƒ | ƒ ¡ tjksJ ‚d S )Nr(   Tr   r   )r	   r   r   Útogetherr   ÚGoldenRatior2   r#   r#   r&   Útest_issue_10382„   s   ,rU   c                   C   s    t tddƒt tƒdksJ ‚d S )NrC   r   r   )r   r   r(   r#   r#   r#   r&   Útest_issue_11672‰   s    rV   c                  C   sV   t ddd\} }tdƒ}tt||  |d|fƒ ¡ || d   |ƒd| d  ks)J ‚d S )Nzk, nT)Úpositiver:   r   )r
   r	   r   r   Údoit)r*   r(   r:   r#   r#   r&   Útest_issue_14196   s   >rY   c                   C   s"   t dt ttƒ tƒdksJ ‚d S )Nr/   r   )r   r(   r   r#   r#   r#   r&   Útest_issue_16735“   s   "rZ   c                   C   s(   t dtttjd  ƒ tƒdksJ ‚d S )Nr   r   r   )r   r   r(   r   rA   r#   r#   r#   r&   Útest_issue_19868—   s   (r[   c                  C   sú  t tƒd tdt tƒ tdtfƒ ttt tƒt tdtfƒ  } t| tƒdks)J ‚tdt tdt tƒ td  tdtfƒtdt t d tdtfƒttdt tƒtdtfƒ  } t| tƒtdƒd ksfJ ‚td tdt td  tdtfƒd  dt tdt t tdtfƒ  } t| tƒdks“J ‚t tƒtdt t tdtfƒ ttdt t tƒ td  tdtfƒ  } t| tƒdksÀJ ‚tdt ttƒ td  tddt fƒtdt td  tdtfƒtttƒtddt fƒ  } t| tƒtdƒd ksûJ ‚d S )Nr8   r   r   rE   r   é   )r   r(   r   r*   r   r   r   r   r,   r#   r#   r&   Útest_limit_seq_fail›   s$   "ÿ(4ÿH&ÿ&2ÿr]   N):Úsympy.concrete.summationsr   Úsympy.core.addr   Úsympy.core.numbersr   r   r   r   Úsympy.core.singletonr   Úsympy.core.symbolr	   r
   Ú(sympy.functions.combinatorial.factorialsr   r   r   Ú%sympy.functions.combinatorial.numbersr   r   Ú&sympy.functions.elementary.exponentialr   r   Ú(sympy.functions.elementary.miscellaneousr   Ú(sympy.functions.elementary.trigonometricr   r   Ú'sympy.functions.special.gamma_functionsr   Úsympy.series.limitseqr   r   r"   Úsympy.testing.pytestr   r   Ú!sympy.calculus.accumulationboundsr   r(   r:   r*   r.   r;   r=   r@   rB   rG   rI   rQ   rR   rU   rV   rY   rZ   r[   r]   r#   r#   r#   r&   Ú<module>   s@    

