403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/scipy/special/_precompute/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/scipy/special/_precompute//expn_asy.py
"""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

"""
import os

try:
    import sympy
    from sympy import Poly
    x = sympy.symbols('x')
except ImportError:
    pass


def generate_A(K):
    A = [Poly(1, x)]
    for k in range(K):
        A.append(Poly(1 - 2*k*x, x)*A[k] + Poly(x*(x + 1))*A[k].diff())
    return A


WARNING = """\
/* This file was automatically generated by _precompute/expn_asy.py.
 * Do not edit it manually!
 */
"""


def main():
    print(__doc__)
    fn = os.path.join('..', 'cephes', 'expn.h')

    K = 12
    A = generate_A(K)
    with open(fn + '.new', 'w') as f:
        f.write(WARNING)
        f.write("#define nA {}\n".format(len(A)))
        for k, Ak in enumerate(A):
            tmp = ', '.join([str(x.evalf(18)) for x in Ak.coeffs()])
            f.write("static const double A{}[] = {{{}}};\n".format(k, tmp))
        tmp = ", ".join(["A{}".format(k) for k in range(K + 1)])
        f.write("static const double *A[] = {{{}}};\n".format(tmp))
        tmp = ", ".join([str(Ak.degree()) for Ak in A])
        f.write("static const int Adegs[] = {{{}}};\n".format(tmp))
    os.rename(fn + '.new', fn)


if __name__ == "__main__":
    main()

Youez - 2016 - github.com/yon3zu
LinuXploit