X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finifcns_gamma.cpp;h=46c8ea9e00e717652b188a0979f18224bc639fa0;hp=0fabbca7157a7bfc5363a203ebbdd4a3fc7fd362;hb=94ead6345f31939c9c9eff70ce88d74cf36a8004;hpb=67edef78ce992a8f6ad704bfac228b8dec6eacd2 diff --git a/ginac/inifcns_gamma.cpp b/ginac/inifcns_gamma.cpp index 0fabbca7..46c8ea9e 100644 --- a/ginac/inifcns_gamma.cpp +++ b/ginac/inifcns_gamma.cpp @@ -110,10 +110,26 @@ static ex lgamma_series(const ex & arg, } +static ex lgamma_conjugate(const ex & x) +{ + // conjugate(lgamma(x))==lgamma(conjugate(x)) unless on the branch cut + // which runs along the negative real axis. + if (x.info(info_flags::positive)) { + return lgamma(x); + } + if (is_exactly_a(x) && + !x.imag_part().is_zero()) { + return lgamma(x.conjugate()); + } + return conjugate_function(lgamma(x)).hold(); +} + + REGISTER_FUNCTION(lgamma, eval_func(lgamma_eval). evalf_func(lgamma_evalf). derivative_func(lgamma_deriv). series_func(lgamma_series). + conjugate_func(lgamma_conjugate). latex_name("\\log \\Gamma")); @@ -207,10 +223,18 @@ static ex tgamma_series(const ex & arg, } +static ex tgamma_conjugate(const ex & x) +{ + // conjugate(tgamma(x))==tgamma(conjugate(x)) + return tgamma(x.conjugate()); +} + + REGISTER_FUNCTION(tgamma, eval_func(tgamma_eval). evalf_func(tgamma_evalf). derivative_func(tgamma_deriv). series_func(tgamma_series). + conjugate_func(tgamma_conjugate). latex_name("\\Gamma")); @@ -329,7 +353,7 @@ REGISTER_FUNCTION(beta, eval_func(beta_eval). derivative_func(beta_deriv). series_func(beta_series). latex_name("\\mathrm{B}"). - set_symmetry(sy_symm(0, 1))); + set_symmetry(sy_symm(0, 1))); //////////