+
    i'                     N   R t ^ RIHt ^ RIHtHtHtHtHtH	t	H
t
Ht ^ RIHtHt ^ RIHt ^ RIHt R t]RR l4       tR	 tRR
 ltR tR tR tR t]RR l4       t]RR l4       tR tR t]RR l4       t]RR l4       t R t!]RR l4       t"R t#]RR l4       t$R t%R t&RR lt'R# )z:Efficient functions for generating orthogonal polynomials.)Dummy)dup_muldup_mul_ground
dup_lshiftdup_subdup_adddup_sub_termdup_sub_grounddup_sqr)ZZQQ)
named_poly)publicc           	        V ^8  d   VP                   .# VP                   .W,           V! ^4      ,          VP                   ,           W,
          V! ^4      ,          .rT\        ^V ^,           4       EF  pV! V4      W,           V,           ,          W,           V! ^4      V,          ,           V! ^4      ,
          ,          pW,           V! ^4      V,          ,           VP                   ,
          W,          W",          ,
          ,          V! ^4      V,          ,          pW,           V! ^4      V,          ,           VP                   ,
          W,           V! ^4      V,          ,           V! ^4      ,
          ,          W,           V! ^4      V,          ,           ,          V! ^4      V,          ,          p	W,           VP                   ,
          W&,           VP                   ,
          ,          W,           V! ^4      V,          ,           ,          V,          p
\        WXV4      p\        \        V^V4      W4      p\        WJV4      pT\	        \        WV4      W4      rTEK  	  V# )z/Low-level implementation of Jacobi polynomials.)oneranger   r   r   r   )nabKm2m1idenf0f1f2p0p1p2s   &&&&          v/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/polys/orthopolys.py
dup_jacobir!   	   s   1uweeWQqTzAEE)AC1:61ac]dAEAI!Q1 56ead1fnquu$qs3qtCx@ead1fnquu$1a!A$)>?151Q4PQ6>RVWXYVZ[^V^_eaeemaeaeem,aead1fn=CBA&Jr1a0"8BA&WWRQ/7B  I    Nc           	     .    \        V \        RRW1V3V4      # )a^  Generates the Jacobi polynomial `P_n^{(a,b)}(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
a
    Lower limit of minimal domain for the list of coefficients.
b
    Upper limit of minimal domain for the list of coefficients.
x : optional
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
NzJacobi polynomial)r   r!   )r   r   r   xpolyss   &&&&&r    jacobi_polyr&      s    " aT+>q	5QQr"   c                   V ^8  d   VP                   .# VP                   .V! ^4      V,          VP                  .rC\        ^V ^,           4       F  p\        \	        V^V4      V! ^4      WP                   ,
          ,          V! V4      ,          V! ^4      ,           V4      p\        W2! ^4      WP                   ,
          ,          V! V4      ,          VP                   ,           V4      pT\        WgV4      rCK  	  V# )z3Low-level implementation of Gegenbauer polynomials.r   zeror   r   r   r   )r   r   r   r   r   r   r   r   s   &&&     r    dup_gegenbauerr*   ,   s    1uweeWqtAvqvv&1ac]Jr1a0!A$%%.12E!2LaPB!agqt 3aee ;Q?WRQ'B  Ir"   c                ,    \        V \        RRW!3V4      # )a  Generates the Gegenbauer polynomial `C_n^{(a)}(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
a
    Decides minimal domain for the list of coefficients.
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
NzGegenbauer polynomial)r   r*   )r   r   r$   r%   s   &&&&r    gegenbauer_polyr,   7   s     a/FPUVVr"   c                d    V ^8  d   VP                   .# V ^@8  d   \        W4      # \        W4      # )zDLow-level implementation of Chebyshev polynomials of the first kind.)r   _dup_chebyshevt_rec_dup_chebyshevt_prod)r   r   s   &&r    dup_chebyshevtr0   G   s1    1uw2v"1((%%r"   c                    VP                   .VP                   VP                  .r2\        V ^,
          4       F,  pT\        \	        \        V^V4      V! ^4      V4      W!4      r2K.  	  V# )a  Chebyshev polynomials of the first kind using recurrence.

Explanation
===========

Chebyshev polynomials of the first kind are defined by the recurrence
relation:

.. math::
    T_0(x) &= 1\\
    T_1(x) &= x\\
    T_n(x) &= 2xT_{n-1}(x) - T_{n-2}(x)

This function calculates the Chebyshev polynomial of the first kind using
the above recurrence relation.

Parameters
==========

n : int
    n is a nonnegative integer.
K : domain

r   r)   r   r   r   r   )r   r   r   r   _s   &&   r    r.   r.   P   sX    2 eeWquuaffo1q5\W^Jr1a,@!A$JBRB Ir"   c           
        VP                   VP                  .V! ^4      VP                  VP                   ) .r2\        V 4      R,           F  p\        \	        \        W2V4      V! ^4      V4      VP                   ^V4      pVR8X  d5   T\        \	        \        W14      V! ^4      V4      VP                   V4      r2Kq  \        \	        \        W!4      V! ^4      V4      VP                   V4      Tr2K  	  V# )ar  Chebyshev polynomials of the first kind using recursive products.

Explanation
===========

Computes Chebyshev polynomials of the first kind using

.. math::
    T_{2n}(x) &= 2T_n^2(x) - 1\\
    T_{2n+1}(x) &= 2T_{n+1}(x)T_n(x) - x

This is faster than ``_dup_chebyshevt_rec`` for large ``n``.

Parameters
==========

n : int
    n is a nonnegative integer.
K : domain

:   NN1)r   r)   binr   r   r   r	   r
   )r   r   r   r   r   cs   &&    r    r/   r/   n   s    , eeQVV_qtQVVaeeV4VBZZ(:AaD!DaeeQPQR#I~gbnadA'NPQPUPUWXY#N72>1Q4$KQUUTUVXY  Ir"   c                    V ^8  d   VP                   .# VP                   .V! ^4      VP                  .r2\        ^V ^,           4       F,  pT\        \	        \        V^V4      V! ^4      V4      W!4      r2K.  	  V# )zELow-level implementation of Chebyshev polynomials of the second kind.r2   r   r   r   r   r   s   &&   r    dup_chebyshevur;      sj    1uweeWqtQVVn1ac]W^Jr1a,@!A$JBRB Ir"   c                4    \        V \        \        RV3V4      # )zGenerates the Chebyshev polynomial of the first kind `T_n(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
z&Chebyshev polynomial of the first kind)r   r0   r   r   r$   r%   s   &&&r    chebyshevt_polyr>      s"     a4qdEC Cr"   c                4    \        V \        \        RV3V4      # )zGenerates the Chebyshev polynomial of the second kind `U_n(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
z'Chebyshev polynomial of the second kind)r   r;   r   r=   s   &&&r    chebyshevu_polyr@      s"     a5tUD Dr"   c           	     *   V ^8  d   VP                   .# VP                   .V! ^4      VP                  .r2\        ^V ^,           4       FG  p\        V^V4      p\	        W!! V^,
          4      V4      pT\	        \        WVV4      V! ^4      V4      r2KI  	  V# )z0Low-level implementation of Hermite polynomials.r   r)   r   r   r   r   r   r   r   r   r   r   r   s   &&     r    dup_hermiterD      s    1uweeWqtQVVn1ac]r1a 2q1vq)^GA!$4adA>B  Ir"   c                   V ^8  d   VP                   .# VP                   .VP                   VP                  .r2\        ^V ^,           4       F6  p\        V^V4      p\	        W!! V^,
          4      V4      pT\        WVV4      r2K8  	  V# )z>Low-level implementation of probabilist's Hermite polynomials.rB   rC   s   &&     r    dup_hermite_probrF      sz    1uweeWquuaffo1ac]r1a 2q1vq)WQ1%B  Ir"   c                4    \        V \        \        RV3V4      # )zGenerates the Hermite polynomial `H_n(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
zHermite polynomial)r   rD   r   r=   s   &&&r    hermite_polyrH      s     ab*>eLLr"   c                4    \        V \        \        RV3V4      # )zGenerates the probabilist's Hermite polynomial `He_n(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
z probabilist's Hermite polynomial)r   rF   r   r=   s   &&&r    hermite_prob_polyrJ      s!     a)2.e= =r"   c                R   V ^8  d   VP                   .# VP                   .VP                   VP                  .r2\        ^V ^,           4       FW  p\        \	        V^V4      V! ^V,          ^,
          V4      V4      p\        W!! V^,
          V4      V4      pT\        WVV4      r2KY  	  V# )z1Low-level implementation of Legendre polynomials.r(   rC   s   &&     r    dup_legendrerL      s    1uweeWquuaffo1ac]:b!Q/1Q3q5!a@2q1ay!,WQ1%B  Ir"   c                4    \        V \        \        RV3V4      # )zGenerates the Legendre polynomial `P_n(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
zLegendre polynomial)r   rL   r   r=   s   &&&r    legendre_polyrN      s     ar+@1$NNr"   c           	        VP                   .VP                  .rC\        ^V ^,           4       F  p\        WBP                  ) V! V4      ,          WP                  ,
          V! V4      ,          V! ^4      ,           .V4      p\	        W1VP                  ,
          V! V4      ,          VP                  ,           V4      pT\        WgV4      rCK  	  V# )z1Low-level implementation of Laguerre polynomials.)r)   r   r   r   r   r   )r   alphar   r   r   r   r   r   s   &&&     r    dup_laguerrerQ     s    ffXw1ac]B%%!uUU{AaD&81Q4&?@!D2aeeQqT1AEE91=WQ1%B  Ir"   c                ,    \        V \        RRW3V4      # )a)  Generates the Laguerre polynomial `L_n^{(\alpha)}(x)`.

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
alpha : optional
    Decides minimal domain for the list of coefficients.
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.
NzLaguerre polynomial)r   rQ   )r   r$   rP   r%   s   &&&&r    laguerre_polyrS     s     at-BQJPUVVr"   c                D   V ^8  d   VP                   VP                  .# VP                   .VP                   VP                  .r2\        ^V ^,           4       F:  pT\        \	        \        V^V4      V! ^V,          ^,
          4      V4      W!4      r2K<  	  \        V^V4      # )z%Low-level implementation of fn(n, x).r2   r:   s   &&   r    dup_spherical_bessel_fnrU     s    1uqvveeWquuaffo1ac]W^Jr1a,@!AaCE(ANPRVB b!Qr"   c                    VP                   VP                  .VP                  .r2\        ^V ^,           4       F:  pT\        \	        \        V^V4      V! ^^V,          ,
          4      V4      W!4      r2K<  	  V# )z&Low-level implementation of fn(-n, x).r2   r:   s   &&   r    dup_spherical_bessel_fn_minusrW   (  sa    eeQVV_qvvh1ac]W^Jr1a,@!AacE(ANPRVB Ir"   c           	         Vf   \        R4      pV ^ 8  d   \        M\        p\        \	        V 4      V\
        R\        ^4      V,          3V4      # )a|  
Coefficients for the spherical Bessel functions.

These are only needed in the jn() function.

The coefficients are calculated from:

fn(0, z) = 1/z
fn(1, z) = 1/z**2
fn(n-1, z) + fn(n+1, z) == (2*n+1)/z * fn(n, z)

Parameters
==========

n : int
    Degree of the polynomial.
x : optional
polys : bool, optional
    If True, return a Poly, otherwise (default) return an expression.

Examples
========

>>> from sympy.polys.orthopolys import spherical_bessel_fn as fn
>>> from sympy import Symbol
>>> z = Symbol("z")
>>> fn(1, z)
z**(-2)
>>> fn(2, z)
-1/z + 3/z**3
>>> fn(3, z)
-6/z**2 + 15/z**4
>>> fn(4, z)
1/z - 45/z**3 + 105/z**5

r$    )r   rW   rU   r   absr   r   )r   r$   r%   fs   &&& r    spherical_bessel_fnr\   /  sE    J 	y#J)*Q%4KAc!faR"Q%'U;;r"   )NF)N    F)(__doc__sympy.core.symbolr   sympy.polys.densearithr   r   r   r   r   r   r	   r
   sympy.polys.domainsr   r   sympy.polys.polytoolsr   sympy.utilitiesr   r!   r&   r*   r,   r0   r.   r/   r;   r>   r@   rD   rF   rH   rJ   rL   rN   rQ   rS   rU   rW   r\    r"   r    <module>re      s   @ #I I I & , "  R R$	W &<> C C D D		 M M = =	 O O W W  (<r"   