
    \h^                        S r SSKJr  SSKJr  SSKJrJrJr  SSK	J
r
  SSKJrJrJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJrJrJrJr  SSKJrJrJrJ r   SSK!J"r"J#r#J$r$  SSK%J&r&J'r'  SSK(J)r)  SSK*J+r+  SSK,J-r-   " S S\5      r. " S S\5      r/ " S S\5      r0 " S S\5      r1 " S S\5      r2 " S S\5      r3\S 5       r4g) z#Riemann zeta and related function.     )Add)cacheit)ArgumentIndexError
expand_mulDefinedFunction)	fuzzy_not)piIInteger)Eq)S)Dummy)sympify)	bernoulli	factorialgenocchiharmonic)re
unpolarifyAbs
polar_lift)log	exp_polarexp)ceilingfloor)sqrt)	Piecewise)Polyc                   :    \ rS rSrSrS rS
S jrS rS rS r	Sr
g	)lerchphi   aB  
Lerch transcendent (Lerch phi function).

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

For $\operatorname{Re}(a) > 0$, $|z| < 1$ and $s \in \mathbb{C}$, the
Lerch transcendent is defined as

.. math :: \Phi(z, s, a) = \sum_{n=0}^\infty \frac{z^n}{(n + a)^s},

where the standard branch of the argument is used for $n + a$,
and by analytic continuation for other values of the parameters.

A commonly used related function is the Lerch zeta function, defined by

.. math:: L(q, s, a) = \Phi(e^{2\pi i q}, s, a).

**Analytic Continuation and Branching Behavior**

It can be shown that

.. math:: \Phi(z, s, a) = z\Phi(z, s, a+1) + a^{-s}.

This provides the analytic continuation to $\operatorname{Re}(a) \le 0$.

Assume now $\operatorname{Re}(a) > 0$. The integral representation

.. math:: \Phi_0(z, s, a) = \int_0^\infty \frac{t^{s-1} e^{-at}}{1 - ze^{-t}}
                            \frac{\mathrm{d}t}{\Gamma(s)}

provides an analytic continuation to $\mathbb{C} - [1, \infty)$.
Finally, for $x \in (1, \infty)$ we find

.. math:: \lim_{\epsilon \to 0^+} \Phi_0(x + i\epsilon, s, a)
         -\lim_{\epsilon \to 0^+} \Phi_0(x - i\epsilon, s, a)
         = \frac{2\pi i \log^{s-1}{x}}{x^a \Gamma(s)},

using the standard branch for both $\log{x}$ and
$\log{\log{x}}$ (a branch of $\log{\log{x}}$ is needed to
evaluate $\log{x}^{s-1}$).
This concludes the analytic continuation. The Lerch transcendent is thus
branched at $z \in \{0, 1, \infty\}$ and
$a \in \mathbb{Z}_{\le 0}$. For fixed $z, a$ outside these
branch points, it is an entire function of $s$.

Examples
========

The Lerch transcendent is a fairly general function, for this reason it does
not automatically evaluate to simpler functions. Use ``expand_func()`` to
achieve this.

If $z=1$, the Lerch transcendent reduces to the Hurwitz zeta function:

>>> from sympy import lerchphi, expand_func
>>> from sympy.abc import z, s, a
>>> expand_func(lerchphi(1, s, a))
zeta(s, a)

More generally, if $z$ is a root of unity, the Lerch transcendent
reduces to a sum of Hurwitz zeta functions:

>>> expand_func(lerchphi(-1, s, a))
zeta(s, a/2)/2**s - zeta(s, a/2 + 1/2)/2**s

If $a=1$, the Lerch transcendent reduces to the polylogarithm:

>>> expand_func(lerchphi(z, s, 1))
polylog(s, z)/z

More generally, if $a$ is rational, the Lerch transcendent reduces
to a sum of polylogarithms:

>>> from sympy import S
>>> expand_func(lerchphi(z, s, S(1)/2))
2**(s - 1)*(polylog(s, sqrt(z))/sqrt(z) -
            polylog(s, sqrt(z)*exp_polar(I*pi))/sqrt(z))
>>> expand_func(lerchphi(z, s, S(3)/2))
-2**s/z + 2**(s - 1)*(polylog(s, sqrt(z))/sqrt(z) -
                      polylog(s, sqrt(z)*exp_polar(I*pi))/sqrt(z))/z

The derivatives with respect to $z$ and $a$ can be computed in
closed form:

>>> lerchphi(z, s, a).diff(z)
(-a*lerchphi(z, s, a) + lerchphi(z, s - 1, a))/z
>>> lerchphi(z, s, a).diff(a)
-s*lerchphi(z, s + 1, a)

See Also
========

polylog, zeta

References
==========

.. [1] Bateman, H.; Erdelyi, A. (1953), Higher Transcendental Functions,
       Vol. I, New York: McGraw-Hill. Section 1.11.
.. [2] https://dlmf.nist.gov/25.14
.. [3] https://en.wikipedia.org/wiki/Lerch_transcendent

c                 t   U R                   u  p#nUS:X  a  [        X45      $ UR                  (       a  US::  a  [        S5      n[	        XT-   U* -  U5      nSSU-
  -  n[
        R                  n[        UR                  5       5       H  n	XU-  -  nXWR                  U5      -  nM     UR                  XR5      $ UR                  (       Ga  [
        R                  n
[
        R                  nUS:  aN  [        U5      nX:X  a  US-  nXL-  nX,* -  n[        [        U5       Vs/ s H  oX-
  -  * XM-   U-  -  PM     sn6 n
ORUS::  aL  [        U* 5      S-   nXL-  nX,-  n[        [        U5       Vs/ s H  oUS-
  U-
  -  XM-
  S-
  U-  -  PM     sn6 n
[        UR                   UR"                  /5      u  p[%        S[&        -  [(        -  U-  5      nUSU-  -  n[+        U5      n/ n[        U5       HX  n[-        X?U-  U-  5      n[/        U[,        5      (       a  UR0                  " S0 UD6nUR3                  UUU-  U-  U-  -  5        MZ     XXS-
  -  -  [        U6 -  -   $ [/        U[4        5      (       a,  UR                   S   [&        [(        -  -  R                  (       d  US[(        [(        * 4;   a  US:X  a  [        SS/5      u  nnO{U[(        :X  a  [        SS/5      u  nnO`U[(        * :X  a  [        SS/5      u  nnODUR                   S   S[&        -  [(        -  -  n[        UR                   UR"                  /5      u  nn[        [        U5       Vs/ s H=  n[5        S[&        -  [(        -  U-  U-  U-  5      UU-  -  [        X=U-   U-  5      -  PM?     sn6 $ [7        X#U5      $ s  snf s  snf s  snf )N   r   t       )argszeta
is_Integerr   r   r   Zeroreversed
all_coeffsdiffsubsis_RationalOner   r   rangepqr   r	   r
   r   polylog
isinstance_eval_expand_funcappendr   r!   )selfhintszsar%   r5   startrescaddmulnkmzetrootup_zetaddargsr6   args                        ^/var/www/auris/envauris/lib/python3.13/site-packages/sympy/functions/special/zeta_functions.pyr9   lerchphi._eval_expand_func   sn   ))a6:<<AFc
Aaer]A&Aq1uIE&&Calln-w**Q- . 88A>!=== &&C%%C1u!H6FA"gE!HEHqZK
2HEFa1"IMd58L8aA	NAEAI>98LMacc133Z=DAAbDF1H%Cqs8D_FG1XAAvd{+a))++4e4Aq&!)D.1!445	 
 QQZW555 a166!9bd#3"@"@A"aRSQSDTBw!Qy1a!Qy1qb"az1ffQi2a(#%%(1"'(,"*Q QrT!VAXaZ\*1a4/QQ	0BB"*, - - a  E F
 M4,s    N+-N0AN5c                     U R                   u  p#nUS:X  a  U* [        X#S-   U5      -  $ US:X  a"  [        X#S-
  U5      U[        X#U5      -  -
  U-  $ [        e)N   r$   )r*   r!   r   )r;   argindexr=   r>   r?   s        rM   fdifflerchphi.fdiff   sb    ))aq=2hqa%+++]QAq)AhqQ.?,??BB$$    c                 V    U R                  5       nUR                  U5      (       a  U$ U $ N)r9   has)r;   targetrA   s      rM   _eval_rewrite_helperlerchphi._eval_rewrite_helper   s'    $$&776??JKrT   c                 ,    U R                  [        5      $ rV   )rY   r+   r;   r=   r>   r?   kwargss        rM   _eval_rewrite_as_zetalerchphi._eval_rewrite_as_zeta   s    ((..rT   c                 ,    U R                  [        5      $ rV   )rY   r7   r\   s        rM   _eval_rewrite_as_polylog!lerchphi._eval_rewrite_as_polylog   s    ((11rT   r)   Nr$   )__name__
__module____qualname____firstlineno____doc__r9   rR   rY   r^   ra   __static_attributes__r)   rT   rM   r!   r!      s#    gR?!B%/2rT   r!   c                   \   ^  \ rS rSrSr\S 5       rS
S jrS rS r	S r
SU 4S jjrS	rU =r$ )r7      aR  
Polylogarithm function.

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

For $|z| < 1$ and $s \in \mathbb{C}$, the polylogarithm is
defined by

.. math:: \operatorname{Li}_s(z) = \sum_{n=1}^\infty \frac{z^n}{n^s},

where the standard branch of the argument is used for $n$. It admits
an analytic continuation which is branched at $z=1$ (notably not on the
sheet of initial definition), $z=0$ and $z=\infty$.

The name polylogarithm comes from the fact that for $s=1$, the
polylogarithm is related to the ordinary logarithm (see examples), and that

.. math:: \operatorname{Li}_{s+1}(z) =
                \int_0^z \frac{\operatorname{Li}_s(t)}{t} \mathrm{d}t.

The polylogarithm is a special case of the Lerch transcendent:

.. math:: \operatorname{Li}_{s}(z) = z \Phi(z, s, 1).

Examples
========

For $z \in \{0, 1, -1\}$, the polylogarithm is automatically expressed
using other functions:

>>> from sympy import polylog
>>> from sympy.abc import s
>>> polylog(s, 0)
0
>>> polylog(s, 1)
zeta(s)
>>> polylog(s, -1)
-dirichlet_eta(s)

If $s$ is a negative integer, $0$ or $1$, the polylogarithm can be
expressed using elementary functions. This can be done using
``expand_func()``:

>>> from sympy import expand_func
>>> from sympy.abc import z
>>> expand_func(polylog(1, z))
-log(1 - z)
>>> expand_func(polylog(0, z))
z/(1 - z)

The derivative with respect to $z$ can be computed in closed form:

>>> polylog(s, z).diff(z)
polylog(s - 1, z)/z

The polylogarithm can be expressed in terms of the lerch transcendent:

>>> from sympy import lerchphi
>>> polylog(s, z).rewrite(lerchphi)
z*lerchphi(z, s, 1)

See Also
========

zeta, lerchphi

c                    UR                   (       ay  U[        R                  L a  [        U5      $ U[        R                  L a  [        U5      * $ U[        R                  L a  [        R                  $ US:X  a  [        5       nX#;   a  X2   $ UR                  (       a  [        R                  $ UR                  [        R                  5      nU(       a  [        U5      $ USL aR  U[        R                  L a  USU-
  -  $ U[        R                  L a  USU-
  S-  -  $ UR                  (       a  USU-
  -  $ UR                  [        [        5      (       a:  U(       d   [        U5      [        R                  :*  S:X  a  U " U[        U5      5      $ g g )Nr&   Fr$   T)	is_numberr   r3   r+   NegativeOnedirichlet_etar-   _dilogtableis_zeroequalsrW   r   r   r   r   )clsr>   r=   
dilogtablezones        rM   evalpolylog.eval%  s,   ;;AEEzAwamm#%a(((affvva(]
?%=(9966M xx7NU]
 AFF{!a%y amm#!a%!|#yy!a%y  55J''Tc!fo$5Nq*Q-(( 6O'rT   c                 Z    U R                   u  p#US:X  a  [        US-
  U5      U-  $ [        e)Nr&   r$   )r*   r7   r   )r;   rQ   r>   r=   s       rM   rR   polylog.fdiffL  s0    yyq=1q5!$Q&&  rT   c                      U[        X!S5      -  $ Nr$   r!   )r;   r>   r=   r]   s       rM   _eval_rewrite_as_lerchphi!polylog._eval_rewrite_as_lerchphiR  s    !"""rT   c                 2   U R                   u  p#US:X  a  [        SU-
  5      * $ UR                  (       aY  US::  aS  [        S5      nUSU-
  -  n[	        U* 5       H  nXER                  U5      -  nM     [        U5      R                  XC5      $ [        X#5      $ )Nr$   r   u)	r*   r   r,   r   r4   r0   r   r1   r7   )r;   r<   r>   r=   r   r@   _s          rM   r9   polylog._eval_expand_funcU  s    yy6AJ;<<AFc
Aq1uIEA2Y**Q- e$))!//q}rT   c                 F    U R                   S   nUR                  (       a  gg )Nr$   T)r*   rq   )r;   r=   s     rM   _eval_is_zeropolylog._eval_is_zeroa  s    IIaL99 rT   c                   > SSK Jn  U R                  u  pgUR                  US5      nU[        R
                  L a-  UR                  US[        U5      R                  (       a  SOSS9nUR                  (       a   UR                  U5      u  pU
R                  (       a  [        X*-  5      nU" X-  U5      nUR                  XX45      R!                  5       nU[        R"                  L a  U$ UnU/n[%        SU5       H  nX-  nUR'                  UUU-  -  5        M      [)        U6 U-   $ [*        [,        U ]?  XX45      $ ! [        [        4 a    U s $ f = f)Nr   )Order-+)dirr&   )sympy.series.orderr   r*   r1   r   NaNlimitr   is_negativerq   leadterm
ValueErrorNotImplementedErroris_positiver   _eval_nseriesremoveOr-   r4   r:   r   superr7   )r;   xrE   logxcdirr   nur=   z0r   r   newnortermr>   rF   	__class__s                    rM   r   polylog._eval_nseriesf  s)   ,		VVAq\;A"T(*>*>3CHB::A qu~!$NOOA$5==?;HFq$AIDHHT!R%Z( ( Aw{"Wd1!CC#  34 s   :D= =EEr)   rc   )r   )rd   re   rf   rg   rh   classmethodrv   rR   r}   r9   r   r   ri   __classcell__r   s   @rM   r7   r7      s?    CJ $) $)L!#

D DrT   r7   c                   t   ^  \ rS rSrSr\SS j5       rSS jrSS jrSS jr	S r
S rSS	 jrU 4S
 jrSrU =r$ )r+   i  a	  
Hurwitz zeta function (or Riemann zeta function).

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

For $\operatorname{Re}(a) > 0$ and $\operatorname{Re}(s) > 1$, this
function is defined as

.. math:: \zeta(s, a) = \sum_{n=0}^\infty \frac{1}{(n + a)^s},

where the standard choice of argument for $n + a$ is used. For fixed
$a$ not a nonpositive integer the Hurwitz zeta function admits a
meromorphic continuation to all of $\mathbb{C}$; it is an unbranched
function with a simple pole at $s = 1$.

The Hurwitz zeta function is a special case of the Lerch transcendent:

.. math:: \zeta(s, a) = \Phi(1, s, a).

This formula defines an analytic continuation for all possible values of
$s$ and $a$ (also $\operatorname{Re}(a) < 0$), see the documentation of
:class:`lerchphi` for a description of the branching behavior.

If no value is passed for $a$ a default value of $a = 1$ is assumed,
yielding the Riemann zeta function.

Examples
========

For $a = 1$ the Hurwitz zeta function reduces to the famous Riemann
zeta function:

.. math:: \zeta(s, 1) = \zeta(s) = \sum_{n=1}^\infty \frac{1}{n^s}.

>>> from sympy import zeta
>>> from sympy.abc import s
>>> zeta(s, 1)
zeta(s)
>>> zeta(s)
zeta(s)

The Riemann zeta function can also be expressed using the Dirichlet eta
function:

>>> from sympy import dirichlet_eta
>>> zeta(s).rewrite(dirichlet_eta)
dirichlet_eta(s)/(1 - 2**(1 - s))

The Riemann zeta function at nonnegative even and negative integer
values is related to the Bernoulli numbers and polynomials:

>>> zeta(2)
pi**2/6
>>> zeta(4)
pi**4/90
>>> zeta(0)
-1/2
>>> zeta(-1)
-1/12
>>> zeta(-4)
0

The specific formulae are:

.. math:: \zeta(2n) = -\frac{(2\pi i)^{2n} B_{2n}}{2(2n)!}
.. math:: \zeta(-n,a) = -\frac{B_{n+1}(a)}{n+1}

No closed-form expressions are known at positive odd integers, but
numerical evaluation is possible:

>>> zeta(3).n()
1.20205690315959

The derivative of $\zeta(s, a)$ with respect to $a$ can be computed:

>>> from sympy.abc import a
>>> zeta(s, a).diff(a)
-s*zeta(s + 1, a)

However the derivative with respect to $s$ has no useful closed form
expression:

>>> zeta(s, a).diff(s)
Derivative(zeta(s, a), s)

The Hurwitz zeta function can be expressed in terms of the Lerch
transcendent, :class:`~.lerchphi`:

>>> from sympy import lerchphi
>>> zeta(s, a).rewrite(lerchphi)
lerchphi(1, s, a)

See Also
========

dirichlet_eta, lerchphi, polylog

References
==========

.. [1] https://dlmf.nist.gov/25.11
.. [2] https://en.wikipedia.org/wiki/Hurwitz_zeta_function

c                    U[         R                  L a  U " U5      $ U[         R                  L d  U[         R                  L a  [         R                  $ U[         R                  L a  [         R                  $ U[         R                  L a  [         R                  $ U[         R                  L a  [         R
                  $ UR                  nUc  [         R                  nU(       a&  UR                  (       a  [        SU-
  U5      US-
  -  $ U[         R                  L aI  U(       aA  UR                  (       a/  S[        -  [        -  U-  * [        U5      -  S[        U5      -  -  $ g g U(       a:  UR                  (       a)  UR                  (       a  U " U5      [        US-
  U5      -
  $ UR                  (       aA  UR                  (       a/  UR                  SL d  UR                  SL a  [         R                  $ g g g )Nr$   r&   F)r   r3   r   ComplexInfinityInfinityr-   r,   is_nonpositiver   is_evenr	   r
   r   r   r   
is_integer)rs   r>   r?   sints       rM   rv   	zeta.eval  s[   :q6M!%%Z1:55L!%%Z$$$!**_55L!**_66M||9AA$$QqS!$!,,!%%Z		2a!|il2a	!nEE "tallq}}q6HQqS!,,,\\a..&!*:*:e*C55L +D /\rT   c                     US:X  ab  UR                   (       aQ  UR                  (       a@  UR                  (       a/  S[        -  [        -  U-  * [        U5      -  S[        U5      -  -  $ [        SU-
  U5      US-
  -  $ )Nr$   r&   )r   is_nonnegativer   r	   r
   r   r   r;   r>   r?   r]   s       rM   _eval_rewrite_as_bernoullizeta._eval_rewrite_as_bernoulli  sa    6allq'7'7AIIrT!VaK<)A,.!IaL.AA1a AaC((rT   c                 ^    US:w  a  U $ U R                   S   n[        U5      SSSU-
  -  -
  -  $ )Nr$   r   r&   )r*   ro   r   s       rM   _eval_rewrite_as_dirichlet_eta#zeta._eval_rewrite_as_dirichlet_eta  s7    6KIIaLQQQZ00rT   c                     [        SX5      $ r{   r|   r   s       rM   r}   zeta._eval_rewrite_as_lerchphi  s    1  rT   c                 L    [        U R                  S   S-
  R                  5      $ )Nr   r$   )r   r*   rq   )r;   s    rM   _eval_is_finitezeta._eval_is_finite  s     $))A,*3344rT   c                    U R                   S   n[        U R                   5      S:  a  U R                   S   O[        R                  nUR                  (       ak  UR
                  (       a  [        U5      [        US-
  U5      -
  $ UR                  (       a.  UR                  SL d  UR                  SL a  [        R                  $ U $ )Nr   r$   F)
r*   lenr   r3   r   r   r+   r   r   r   )r;   r<   r>   r?   s       rM   r9   zeta._eval_expand_func"  s    IIaL		NQ.DIIaLAEE<<}}Aw!A#q!111Q\\U%:$$-uurT   c                     [        U R                  5      S:X  a  U R                  u  p#OU R                  S-   u  p#US:X  a  U* [        US-   U5      -  $ [        e)Nr&   rc   r$   )r   r*   r+   r   )r;   rQ   r>   r?   s       rM   rR   
zeta.fdiff-  sS    tyy>Q99DAq99t#DAq=2d1q5!n$$$$rT   c                 T  > [        U R                  5      S:X  a  U R                  u  pEO U R                  [        R                  4-   u  pE UR	                  U5      u  pgUR                  (       a  UR                  (       d  [
        e[        [        U ]+  XUS9$ ! [
         a    U s $ f = f)Nr&   )r   r   )r   r*   r   r3   r   r   r   r   r   r+   _eval_as_leading_term)	r;   r   r   r   r>   r?   rB   er   s	           rM   r   zeta._eval_as_leading_term7  s    tyy>Q99DAq99x'DA	::a=DA ==%%T46q$6OO # 	K	s   B B'&B'r)   rV   rc   )rd   re   rf   rg   rh   r   rv   r   r   r}   r   r9   rR   r   ri   r   r   s   @rM   r+   r+     sH    hT  4)
1!5	%P PrT   r+   c                   \    \ rS rSrSr\S	S j5       rS
S jr\R                  4S jr
S rSrg)ro   iH  aE  
Dirichlet eta function.

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

For $\operatorname{Re}(s) > 0$ and $0 < x \le 1$, this function is defined as

.. math:: \eta(s, a) = \sum_{n=0}^\infty \frac{(-1)^n}{(n+a)^s}.

It admits a unique analytic continuation to all of $\mathbb{C}$ for any
fixed $a$ not a nonpositive integer. It is an entire, unbranched function.

It can be expressed using the Hurwitz zeta function as

.. math:: \eta(s, a) = \zeta(s,a) - 2^{1-s} \zeta\left(s, \frac{a+1}{2}\right)

and using the generalized Genocchi function as

.. math:: \eta(s, a) = \frac{G(1-s, a)}{2(s-1)}.

In both cases the limiting value of $\log2 - \psi(a) + \psi\left(\frac{a+1}{2}\right)$
is used when $s = 1$.

Examples
========

>>> from sympy import dirichlet_eta, zeta
>>> from sympy.abc import s
>>> dirichlet_eta(s).rewrite(zeta)
Piecewise((log(2), Eq(s, 1)), ((1 - 2**(1 - s))*zeta(s), True))

See Also
========

zeta

References
==========

.. [1] https://en.wikipedia.org/wiki/Dirichlet_eta_function
.. [2] Peter Luschny, "An introduction to the Bernoulli function",
       https://arxiv.org/abs/2009.06743

Nc                    U[         R                  L a  U " U5      $ UcE  US:X  a  [        S5      $ [        U5      nUR	                  [        5      (       d  SSSU-
  -  -
  U-  $ g US:X  a)  SSKJn  [        S5      U" U5      -
  U" US-   S-  5      -   $ [        X5      n[        XS-   S-  5      nUR	                  [        5      (       d)  UR	                  [        5      (       d  USSU-
  -  U-  -
  $ g g )Nr$   r&   r   digamma)r   r3   r   r+   rW   'sympy.functions.special.gamma_functionsr   )rs   r>   r?   r=   r   z1z2s          rM   rv   dirichlet_eta.evalw  s    :q6M9Av1vQA55;;A!H))!VGq6GAJ&!A#q)999!Z!c1Wvvd||BFF4LLAaC2%% %1|rT   c           
      H   SSK Jn  US:X  a8  [        [        S5      [	        US5      4SSSU-
  -  -
  [        U5      -  S45      $ [        [        S5      U" U5      -
  U" US-   S-  5      -   [	        US5      4[        X5      SSU-
  -  [        XS-   S-  5      -  -
  S45      $ )Nr   r   r$   r&   T)r   r   r   r   r   r+   r;   r>   r?   r]   r   s        rM   r^   #dirichlet_eta._eval_rewrite_as_zeta  s    C6c!fbAh/1q1Q3x<472JD1QRR#a&71:-1a0@@"Q(Kaa!A#haA#q)9994@B 	BrT   c                     SSK Jn  [        [        S5      U" U5      -
  U" US-   S-  5      -   [	        US5      4[        SU-
  U5      SUS-
  -  -  S45      $ )Nr   r   r&   r$   T)r   r   r   r   r   r   r   s        rM   _eval_rewrite_as_genocchi'dirichlet_eta._eval_rewrite_as_genocchi  s^    C#a&71:-1a0@@"Q(K!A#q!Q!A#Y/68 	8rT   c                     [        S U R                   5       5      (       a$  U R                  [        5      R	                  U5      $ g )Nc              3   8   #    U  H  oR                   v   M     g 7frV   )rm   ).0is     rM   	<genexpr>,dirichlet_eta._eval_evalf.<locals>.<genexpr>  s     .Iq{{Is   )allr*   rewriter+   _eval_evalf)r;   precs     rM   r   dirichlet_eta._eval_evalf  s6    .DII...<<%11$77 /rT   r)   rV   rc   )rd   re   rf   rg   rh   r   rv   r^   r   r3   r   r   ri   r)   rT   rM   ro   ro   H  s5    ,\ & &$B ./UU 8
8rT   ro   c                   .    \ rS rSrSr\S 5       rS rSrg)
riemann_xii  a  
Riemann Xi function.

Examples
========

The Riemann Xi function is closely related to the Riemann zeta function.
The zeros of Riemann Xi function are precisely the non-trivial zeros
of the zeta function.

>>> from sympy import riemann_xi, zeta
>>> from sympy.abc import s
>>> riemann_xi(s).rewrite(zeta)
s*(s - 1)*gamma(s/2)*zeta(s)/(2*pi**(s/2))

References
==========

.. [1] https://en.wikipedia.org/wiki/Riemann_Xi_function

c                    SSK Jn  [        U5      nU[        R                  [        R
                  4;   a  [        R                  $ [        U[        5      (       d&  XS-
  -  U" US-  5      -  U-  S[        US-  -  -  -  $ g Nr   )gammar$   r&   )	r   r   r+   r   r-   r3   Halfr8   r	   )rs   r>   r   r=   s       rM   rv   riemann_xi.eval  sl    AG66M!T""!e9U1Q3Z')1R!A#Y;77 #rT   c                 l    SSK Jn  XS-
  -  U" US-  5      -  [        U5      -  S[        US-  -  -  -  $ r   )r   r   r+   r	   )r;   r>   r]   r   s       rM   r^    riemann_xi._eval_rewrite_as_zeta  s8    Aa%yqs#DG+QrAaCy[99rT   r)   N)	rd   re   rf   rg   rh   r   rv   r^   ri   r)   rT   rM   r   r     s     . 8 8:rT   r   c                   ,    \ rS rSrSr\SS j5       rSrg)	stieltjesi  a$  
Represents Stieltjes constants, $\gamma_{k}$ that occur in
Laurent Series expansion of the Riemann zeta function.

Examples
========

>>> from sympy import stieltjes
>>> from sympy.abc import n, m
>>> stieltjes(n)
stieltjes(n)

The zero'th stieltjes constant:

>>> stieltjes(0)
EulerGamma
>>> stieltjes(0, 1)
EulerGamma

For generalized stieltjes constants:

>>> stieltjes(n, m)
stieltjes(n, m)

Constants are only defined for integers >= 0:

>>> stieltjes(-1)
zoo

References
==========

.. [1] https://en.wikipedia.org/wiki/Stieltjes_constants

Nc                    Ub`  [        U5      nU[        R                  L a  [        R                  $ UR                  (       a!  UR                  (       a  [        R
                  $ UR                  (       a  U[        R                  L a  [        R                  $ US:  a  [        R
                  $ UR                  (       d  [        R
                  $ U[        R                  L a  US;   a  [        R                  $ UR                  (       a  [        R
                  $ UR                  (       a  US;   a  [        R                  $ UR                  S:X  a  [        R
                  $ g )Nr   r{   F)r   r   r   r,   r   r   	is_Numberr-   
EulerGammais_extended_negativerq   r   )rs   rE   r?   s      rM   rv   stieltjes.eval  s    =
AAEEzuu|| 0 0(((;;AEEzuuQ(((\\(((affi||#!!$$$99i<<<<5 $$$ !rT   r)   rV   )rd   re   rf   rg   rh   r   rv   ri   r)   rT   rM   r   r     s    "H % %rT   r   c                     [         R                  [        S-  S-  [        S5      S-  S-  -
  [	        S5      [        S-  S-  [
        [        -  [        S5      -  -
  [        S5      S-
  * S-  [        S-  * S-  [        [        S5      S-
  S-  5      S-  S-  -   [        S5      S-   * S-  [        S-  * S-  [        [        S5      S-   S-  5      S-  -
  S[        S5      -
  S-  [        S-  S-  [        [        S5      S-
  S-  5      S-  -
  [        S5      S-
  S-  [        S-  S-  [        [        S5      S-
  S-  5      S-  -
  [
        [
        [         R                  -  [        S-  S	-  -
  [
        * [
        * [         R                  -  [        S-  S	-  -
  S[
        -
  [        S-  S
-  [
        [         R                  -  -
  [        [
        -  S-  [        S5      -  -
  S[
        -   [        S-  S
-  [
        [         R                  -  -   [        [
        -  S-  [        S5      -  -   S[
        -
  S-  [        S5      S-  * S-  [        [
        -  [        S5      -  S-  -   S[        S-  -  S-  -   [
        [         R                  -  -
  0$ )Nr&      r(      r$      
   rP   0         `   )r   r   r	   r   r   r
   r   Catalanr)   rT   rM   rp   rp     s    	
Ab3q619Q;&
RU1WqtCF{*
q'A+qBE6"9sDGAIq='91'<Q'>>
q'A+qBE6"9sDGAIq='91'<<	
T!Wa"a%(S$q'!)Q%7%::	a1a"a%(S$q'!)Q%7%::	AaiiK"a%("	
aR		\BE"H$	AAb1QYY;&AaA6	AAb1QYY;&AaA6	
Q	SVQYJqL2a4A;q=01RU72:=!))K rT   N)5rh   sympy.core.addr   sympy.core.cacher   sympy.core.functionr   r   r   sympy.core.logicr   sympy.core.numbersr	   r
   r   sympy.core.relationalr   sympy.core.singletonr   sympy.core.symbolr   sympy.core.sympifyr   %sympy.functions.combinatorial.numbersr   r   r   r   $sympy.functions.elementary.complexesr   r   r   r   &sympy.functions.elementary.exponentialr   r   r   #sympy.functions.elementary.integersr   r   (sympy.functions.elementary.miscellaneousr   $sympy.functions.elementary.piecewiser   sympy.polys.polytoolsr   r!   r7   r+   ro   r   r   rp   r)   rT   rM   <module>r     s    *  $ O O & - - $ " # & Z Z P P F F > 9 : &2 2LeDo eDXzP? zPzP8O P8f$: $:N?% ?%D 	 	rT   