%mathpiper,def="Zeta"

/////////////////////////////////////////////////
/// Riemann's Zeta function
/////////////////////////////////////////////////
/// Serge Winitzki

/// identities for exact values of Zeta

10 # Zeta(1) <-- Infinity;
10 # Zeta(0) <-- -1/2;	// let's save time
10 # Zeta(3)_InNumericMode() <-- Zeta3();	// special case
10 # Zeta(n_IsEven)_(n>0) <-- Pi^n*(2^(n-1)/n! *Abs(Bernoulli(n)));
10 # Zeta(n_IsInteger)_(n<0) <-- -Bernoulli(-n+1)/(-n+1);
11 # Zeta(n_IsInfinity) <-- 1;

/// compute numeric value
20 # Zeta(s_IsConstant)_(InNumericMode()) <-- Internal'ZetaNum(N(Eval(s)));

%/mathpiper



%mathpiper_docs,name="Zeta",categories="User Functions;Special Functions"
*CMD Zeta --- Riemann's Zeta function

*STD
*CALL
	Zeta(x)

*PARMS

{x} -- expression

{number} -- expression that can be evaluated to a number

*DESC

{Zeta(x)} is an interface to Riemann's Zeta function $zeta(s)$. It returns exact values on integer and half-integer arguments. {N(Zeta(x)} takes a numeric parameter and always returns a floating-point number in the current precision.

*E.G.

In> Precision(30)
Result: True;
In> Zeta(1)
Result: Infinity;
In> Zeta(1.3)
Result: Zeta(1.3);
In> N(Zeta(1.3))
Result: 3.93194921180954422697490751058798;
In> Zeta(2)
Result: Pi^2/6;
In> N(Zeta(2));
Result: 1.64493406684822643647241516664602;

*SEE !, N
%/mathpiper_docs