a
    Qe                     @   sh   d Z ddlZz"ddlZddlmZ edZW n ey@   Y n0 dd ZdZdd	 Z	e
d
krde	  dS )zPrecompute the polynomials for the asymptotic expansion of the
generalized exponential integral.

Sources
-------
[1] NIST, Digital Library of Mathematical Functions,
    https://dlmf.nist.gov/8.20#ii

    N)Polyxc                 C   s^   t dtg}t| D ]D}|t dd| t  t||  t ttd  ||     q|S )N      )r   r   rangeappenddiff)KAk r   V/var/www/sunrise/env/lib/python3.9/site-packages/scipy/special/_precompute/expn_asy.py
generate_A   s    Br   ze/* This file was automatically generated by _precompute/expn_asy.py.
 * Do not edit it manually!
 */
c                  C   s  t t tjddd} d}t|}t| d d}|t |dt	| d t
|D ]2\}}d	d
d | D  |d| d q\d	dd t|d D  |d d	dd |D  |d W d    n1 s0    Y  t| d |  d S )Nz..Zcepheszexpn.h   z.newwz#define nA 
z, c                 S   s   g | ]}t |d qS )   )strZevalf).0r   r   r   r   
<listcomp>,       zmain.<locals>.<listcomp>zstatic const double Az[] = {tmp};
c                 S   s   g | ]}d | qS )r
   r   )r   r   r   r   r   r   .   r   r   z$static const double *A[] = {{tmp}};
c                 S   s   g | ]}t | qS r   )r   Zdegree)r   Akr   r   r   r   0   r   z$static const int Adegs[] = {{tmp}};
)print__doc__ospathjoinr   openwriteWARNINGlen	enumerateZcoeffsr   rename)fnr	   r
   fr   r   r   r   r   main"   s    

(r%   __main__)r   r   Zsympyr   symbolsr   ImportErrorr   r   r%   __name__r   r   r   r   <module>   s   	