46 if (is_exactly_a<numeric>(
x)) {
48 return lgamma(ex_to<numeric>(
x));
49 }
catch (
const dunno &e) { }
69 throw (
pole_error(
"lgamma_eval(): logarithmic pole",0));
71 if (!ex_to<numeric>(
x).is_rational())
72 return lgamma(ex_to<numeric>(
x));
105 numeric m = -ex_to<numeric>(arg_pt);
120 if (is_exactly_a<numeric>(
x) &&
124 return conjugate_function(
lgamma(
x)).hold();
133 latex_name(
"\\log \\Gamma"));
142 if (is_exactly_a<numeric>(
x)) {
144 return tgamma(ex_to<numeric>(
x));
145 }
catch (
const dunno &e) { }
161 const numeric two_x = (*_num2_p)*ex_to<numeric>(
x);
167 throw (
pole_error(
"tgamma_eval(): simple pole",1));
184 if (!ex_to<numeric>(
x).is_rational())
185 return tgamma(ex_to<numeric>(
x));
218 const numeric m = -ex_to<numeric>(arg_pt);
238 latex_name(
"\\Gamma"));
247 if (is_exactly_a<numeric>(
x) && is_exactly_a<numeric>(y)) {
250 }
catch (
const dunno &e) { }
253 return beta(
x,y).hold();
267 const numeric &nx = ex_to<numeric>(
x);
268 const numeric &ny = ex_to<numeric>(y);
270 ny.is_real() && ny.is_integer()) {
275 throw (
pole_error(
"beta_eval(): simple pole",1));
277 if (ny.is_negative()) {
281 throw (
pole_error(
"beta_eval(): simple pole",1));
291 return evalf(beta(
x, y).hold());
294 return beta(
x,y).hold();
308 retval = (
psi(y)-
psi(
x+y))*beta(
x,y);
326 const symbol &s = ex_to<symbol>(rel.
lhs());
327 ex arg1_ser, arg2_ser, arg1arg2_ser;
333 arg1_ser =
tgamma(arg1+s);
338 arg2_ser =
tgamma(arg2+s);
343 arg1arg2_ser =
tgamma(arg2+arg1+s);
345 arg1arg2_ser =
tgamma(arg2+arg1);
347 return (arg1_ser*arg2_ser/arg1arg2_ser).series(rel,
order,
options).expand();
355 latex_name(
"\\mathrm{B}").
365 if (is_exactly_a<numeric>(
x)) {
367 return psi(ex_to<numeric>(
x));
368 }
catch (
const dunno &e) { }
379 const numeric &nx = ex_to<numeric>(
x);
390 throw (
pole_error(
"psi_eval(): simple pole",1));
395 if (nx.is_positive()) {
444 const numeric m = -ex_to<numeric>(arg_pt);
466 if (is_exactly_a<numeric>(
n) && is_exactly_a<numeric>(
x)) {
468 return psi(ex_to<numeric>(
n),ex_to<numeric>(
x));
469 }
catch (
const dunno &e) { }
487 const numeric &nn = ex_to<numeric>(
n);
488 const numeric &nx = ex_to<numeric>(
x);
489 if (nx.is_integer()) {
494 if (nx.is_positive()) {
515 if (nx.is_positive()) {
516 const numeric m = nx - (*_num1_2_p);
544 if (deriv_param==0) {
546 throw(std::logic_error(
"cannot diff psi(n,x) with respect to n"));
571 const numeric m = -ex_to<numeric>(arg_pt);
static ex lgamma_evalf(const ex &x)
const numeric exp(const numeric &x)
Exponential function.
Exception class thrown by classes which provide their own series expansion to signal that ordinary Ta...
bool is_negative() const
True if object is not complex and less than zero.
Interface to GiNaC's symbolic exponentiation (basis^exponent).
static ex psi2_series(const ex &n, const ex &arg, const relational &rel, int order, unsigned options)
static ex tgamma_evalf(const ex &x)
Interface to GiNaC's symbolic objects.
static ex tgamma_eval(const ex &x)
Evaluation of tgamma(x), the true Gamma function.
Interface to GiNaC's symmetry definitions.
ex subs(const exmap &m, unsigned options=0) const
const basic & hold() const
Stop further evaluation.
static ex psi2_evalf(const ex &n, const ex &x)
static ex beta_series(const ex &arg1, const ex &arg2, const relational &rel, int order, unsigned options)
bool is_equal(const ex &other) const
const numeric doublefactorial(const numeric &n)
The double factorial combinatorial function.
bool is_even() const
True if object is an exact even integer.
Interface to GiNaC's constant types and some special constants.
const numeric * _num1_2_p
static ex tgamma_deriv(const ex &x, unsigned deriv_param)
This class holds a relation consisting of two expressions and a logical relation between them...
const cln::cl_N lgamma(const cln::cl_N &x)
The Gamma function.
static ex lgamma_conjugate(const ex &x)
const cln::cl_N tgamma(const cln::cl_N &x)
function zeta(const T1 &p1)
static ex psi2_eval(const ex &n, const ex &x)
Evaluation of polygamma-function psi(n,x).
function psi(const T1 &p1)
bool is_integer(const numeric &x)
ex evalf(const ex &thisex)
bool info(unsigned inf) const
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
bool is_integer() const
True if object is a non-complex integer.
const constant Euler("Euler", EulerEvalf, "\amma_E", domain::positive)
Euler's constant.
bool is_positive() const
True if object is not complex and greater than zero.
REGISTER_FUNCTION(conjugate_function, eval_func(conjugate_eval). evalf_func(conjugate_evalf). expl_derivative_func(conjugate_expl_derivative). info_func(conjugate_info). print_func< print_latex >(conjugate_print_latex). conjugate_func(conjugate_conjugate). real_part_func(conjugate_real_part). imag_part_func(conjugate_imag_part). set_name("conjugate","conjugate"))
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
static ex tgamma_series(const ex &arg, const relational &rel, int order, unsigned options)
static ex psi1_series(const ex &arg, const relational &rel, int order, unsigned options)
const numeric log(const numeric &x)
Natural logarithm.
static ex psi1_eval(const ex &x)
Evaluation of digamma-function psi(x).
static ex lgamma_eval(const ex &x)
Evaluation of lgamma(x), the natural logarithm of the Gamma function.
const numeric abs(const numeric &x)
Absolute value.
Interface to GiNaC's overloaded operators.
bool is_real() const
True if object is a real integer, rational or float (but not complex).
const numeric sqrt(const numeric &x)
Numeric square root.
static ex lgamma_series(const ex &arg, const relational &rel, int order, unsigned options)
static ex psi2_deriv(const ex &n, const ex &x, unsigned deriv_param)
const numeric pow(const numeric &x, const numeric &y)
Exception class thrown when a singularity is encountered.
static ex psi1_evalf(const ex &x)
static ex tgamma_conjugate(const ex &x)
Lightweight wrapper for GiNaC's symbolic objects.
This class holds a two-component object, a basis and and exponent representing exponentiation.
const constant Pi("Pi", PiEvalf, "\i", domain::positive)
Pi.
Exception class thrown by functions to signal unimplemented functionality so the expression may just ...
Interface to GiNaC's initially known functions.
Interface to class for extended truncated power series.
static ex beta_eval(const ex &x, const ex &y)
static ex lgamma_deriv(const ex &x, unsigned deriv_param)
Interface to relations between expressions.
Makes the interface to the underlying bignum package available.
ex series(const ex &thisex, const ex &r, int order, unsigned options=0)
const numeric factorial(const numeric &n)
Factorial combinatorial function.
const numeric inverse() const
Inverse of a number.
static ex beta_deriv(const ex &x, const ex &y, unsigned deriv_param)
static ex beta_evalf(const ex &x, const ex &y)
bool is_rational(const numeric &x)
bool is_real(const numeric &x)
static unsigned register_new(function_options const &opt)
static ex psi1_deriv(const ex &x, unsigned deriv_param)
bool is_positive(const numeric &x)