
    (ph	                         S r SSKrSSKJr   SSKrS rS rS r	S r
S rS	rS
rS r\S:X  a  \" 5         gg! \ a     N-f = f)z
Precompute coefficients of Temme's asymptotic expansion for gammainc.

This takes about 8 hours to run on a 2.3 GHz Macbook Pro with 4GB ram.

Sources:
[1] NIST, "Digital Library of Mathematical Functions",
    https://dlmf.nist.gov/

    N)lagrange_inversionc                 >   [         R                  " S5      S-  /n[        SU 5       Hr  nUS   U-  n[        S[        U5      5       H  nX1U   X*    -  US-   -  -  nM     X1S   S[         R                  " S5      US-   -  -   -  -  nUR                  U5        Mt     U$ )za_k from DLMF 5.11.6      r   )mpsqrtrangelenmpfappend)nakakjs        Y/var/www/html/venv/lib/python3.13/site-packages/scipy/special/_precompute/gammainc_asy.py	compute_ar      s    	AA1a[rU1Wq#a&!AA$qu*a!e$$B "
dAq	1q5))**	  H    c                     [        SU -  5      n[        U 5       Vs/ s H:  n[        R                  " S5      [        R                  " SU5      -  USU-     -  PM<     nnU$ s  snf )zg_k from DLMF 5.11.3/5.11.5r   g      ?)r   r
   r   r	   rf)r   r   r   gs       r   	compute_gr       sU    !A#A27(;(QBEE#qM	!!AaC&	((A;H 	<s   AA!c                     U S:  a3  [         R                  " SU [         R                  " U S-   5      -
  -  5      $ U S:  a4  [         R                  " SU [         R                  " U S-   5      -
  -  5      * $ g)z6Function from DLMF 8.12.1 shifted to be centered at 0.r   r   r   )r   r	   log)lams    r   etar   '   s`    
Qwwwq#sQw/011	q3a01222r   c                 V    [         R                  " [        SU S-
  5      n[        U5      $ )zalpha_n from DLMF 8.12.13r   r   )r   taylorr   r   )r   coeffss     r   compute_alphar!   1   s#    YYsAq1u%Ff%%r   c           	          USU -  -   n[         R                  " S5      * S-  /n[        US-   5      n[        SU5       H  nUR	                  US-   XES-      -  5        M!     U/n[        U 5      n[        SU 5       Hd  n/ n	[        USU-  -
  5       H9  nU	R	                  SU-  Xx   -  US   U   -  US-   XhS-
     US-      -  -   5        M;     UR	                  U	5        Mf     [        U 5       H  nXh   SU Xh'   M     U$ )zd_{k, n} from DLMF 8.12.12r   r      r   r   N)r   r   r!   r
   r   r   )
KNMd0alphar   dr   r   dks
             r   	compute_dr+   7   s   	AaCA66!9*Q,B!a% E1a[
		1q5%!*$% 	A!A1a[q1Q3wAIIrAgadl1Q47*a!eQsVAaC[-@@A  		 
 1XtBQx Hr   z/* This file was automatically generated by _precomp/gammainc.py.
 * Do not edit it manually!
 */

#ifndef IGAM_H
#define IGAM_H

#define K {}
#define N {}

static const double d[K][N] =
{{z
#endif
c                  Z   [        [        5        Sn Sn[        R                  " S5         [	        X5      nS S S 5        [
        R                  R                  [
        R                  R                  [        5      SSS5      n[        US-   S5       nUR                  [        R                  X5      5        [        W5       H  u  pVU Vs/ s H  n[        R                  " USS	S	S
9PM     nnUR                  S5        UR                  SR                  U5      5        XPS-
  :  a  UR                  S5        Mx  UR                  S5        M     UR                  [         5        S S S 5        [
        R"                  " US-   U5        g ! , (       d  f       GNV= fs  snf ! , (       d  f       N@= f)N   2   z..cepheszigam.hz.neww   r   )	min_fixed	max_fixed{z, r   z},
z}};
)print__doc__r   workdpsr+   ospathjoindirname__file__openwriteheaderformat	enumeratenstrfooterrename)r$   r%   r)   fnfr   rowxs           r   mainrI   ^   s$   	'N
A
A	BaO 
	bggooh/x	JB	b6k3	1	a#$lFAEHIS2771bA;SCIGGCLGGDIIcN#q5y  # 	
 
  IIb6k2 
 J 
 	s*   F9F	!F*A8F
FF
F*__main__)r6   r8   scipy.special._precompute.utilsr   mpmathr   ImportErrorr   r   r   r!   r+   r?   rC   rI   __name__ r   r   <module>rP      su   	 
 >	
	&(  * zF G  		s   7 A A 