o
    EbF                     @   sR   d Z zddlZW n	 ey   Y nw dd Zdd Zdd Zed	kr'e  dS dS )
z-Precompute series coefficients for log-Gamma.    Nc                 C   sH   t d dd td| d D }W d    |S 1 sw   Y  |S )Nd   c                 S   s.   g | ]}t d | d | d | d   qS )      )mpmathZ	bernoulli).0n r   D/usr/lib/python3/dist-packages/scipy/special/_precompute/loggamma.py
<listcomp>   s    &z#stirling_series.<locals>.<listcomp>r   )r   workdpsrange)Ncoeffsr   r   r	   stirling_series	   s   
r   c                 C   sr   g }t d( |t j  td| d D ]}|d| t | |  qW d    |S 1 s2w   Y  |S )Nr   r   r   )r   r   appendZeulerr   Zzeta)r   r   r   r   r   r	   taylor_series_at_1   s   
r   c                  C   s   t t t   dd tdd d d D } dd tdd d d D }t d t d t d	|  t   t d
 t d t d	| t   d S )Nc                 S      g | ]}t j|d dddqS    r   )Z	min_fixedZ	max_fixedr   Znstrr   xr   r   r	   r
          zmain.<locals>.<listcomp>   r   c                 S   r   r   r   r   r   r   r	   r
      r      zStirling series coefficientsz----------------------------
zTaylor series coefficientsz--------------------------)print__doc__r   r   join)Zstirling_coeffsZtaylor_coeffsr   r   r	   main   s    
r    __main__)r   r   ImportErrorr   r   r    __name__r   r   r   r	   <module>   s    	
