o
    Ö­jñ  ã                   @   sl   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w dd„ ZdZdd	„ Z	e
d
kr4e	ƒ  dS dS )zÊPrecompute 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 ]"}| t dd| t  tƒ||  t ttd  ƒ||  ¡   ¡ q
|S )Né   é   )r   r   ÚrangeÚappendÚdiff)ÚKÚAÚk© r   ú_/var/www/html/CropPilot/venv/lib/python3.10/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ƒ�X}| t¡ | dt	|ƒ› d�¡ t
|ƒD ]\}}d	 d
d„ | ¡ D ƒ¡ | d|› d�¡ q.d	 dd„ t|d ƒD ƒ¡ | d¡ d	 dd„ |D ƒ¡ | d¡ W d   ƒ n1 stw   Y  t | d | ¡ d S )Nz..Úcepheszexpn.hé   z.newÚwz#define nA Ú
z, c                 S   s   g | ]	}t | d ¡ƒ‘qS )é   )ÚstrÚevalf)Ú.0r   r   r   r   Ú
<listcomp>,   s    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   .   s    r   z$static const double *A[] = {{tmp}};
c                 S   s   g | ]}t | ¡ ƒ‘qS r   )r   Údegree)r   ÚAkr   r   r   r   0   s    z$static const int Adegs[] = {{tmp}};
)ÚprintÚ__doc__ÚosÚpathÚjoinr   ÚopenÚwriteÚWARNINGÚlenÚ	enumerateÚcoeffsr   Úrename)Úfnr	   r
   Úfr   r   r   r   r   Úmain"   s    

÷
r(   Ú__main__)r   r   Úsympyr   Úsymbolsr   ÚImportErrorr   r!   r(   Ú__name__r   r   r   r   Ú<module>   s    	ÿ
ÿ