U
    HvfF                     @   sP   d Z zddlZW n ek
r$   Y nX dd Zdd Zdd Zed	krLe  dS )
z-Precompute series coefficients for log-Gamma.    Nc              	   C   s2   t d dd td| d D }W 5 Q R X |S )Nd   c                 S   s.   g | ]&}t d | d | d | d   qS )      )mpmathZ	bernoulli).0n r   F/tmp/pip-unpacked-wheel-96ln3f52/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   s\   g }t dD |t j  td| d D ] }|d| t | |  q,W 5 Q R X |S )Nr   r   r   )r   r   appendZeulerr   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   s   g | ]}t j|d dddqS    r   )Z	min_fixedZ	max_fixedr   Znstrr   xr   r   r	   r
      s   zmain.<locals>.<listcomp>   r   c                 S   s   g | ]}t j|d dddqS r   r   r   r   r   r	   r
      s      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   	