X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finifcns_gamma.cpp;h=fc4a992c97acc6db876bbb1c61ac9818fd0c21eb;hp=15b1a9a5e851ea19dc68992a576de7eee5c0febe;hb=f64dcc8accf3e0603d0701de0c87e36f1ee6262d;hpb=e7cc6a764ff67b5885d6633385fac23ccc1dc9a7 diff --git a/ginac/inifcns_gamma.cpp b/ginac/inifcns_gamma.cpp index 15b1a9a5..fc4a992c 100644 --- a/ginac/inifcns_gamma.cpp +++ b/ginac/inifcns_gamma.cpp @@ -4,7 +4,7 @@ * some related stuff. */ /* - * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include "numeric.h" #include "power.h" #include "relational.h" +#include "operators.h" #include "symbol.h" #include "symmetry.h" #include "utils.h" @@ -230,6 +231,10 @@ static ex beta_evalf(const ex & x, const ex & y) static ex beta_eval(const ex & x, const ex & y) { + if (x.is_equal(_ex1)) + return 1/y; + if (y.is_equal(_ex1)) + return 1/x; if (x.info(info_flags::numeric) && y.info(info_flags::numeric)) { // treat all problematic x and y that may not be passed into tgamma, // because they would throw there although beta(x,y) is well-defined @@ -291,7 +296,7 @@ static ex beta_series(const ex & arg1, // tgamma series directly. const ex arg1_pt = arg1.subs(rel); const ex arg2_pt = arg2.subs(rel); - GINAC_ASSERT(is_exactly_a(rel.lhs())); + GINAC_ASSERT(is_a(rel.lhs())); const symbol &s = ex_to(rel.lhs()); ex arg1_ser, arg2_ser, arg1arg2_ser; if ((!arg1_pt.info(info_flags::integer) || arg1_pt.info(info_flags::positive)) && @@ -417,7 +422,7 @@ static ex psi1_series(const ex & arg, return (psi(arg+m+_ex1)-recur).series(rel, order, options); } -const unsigned function_index_psi1 = +unsigned psi1_SERIAL::serial = function::register_new(function_options("psi"). eval_func(psi1_eval). evalf_func(psi1_evalf). @@ -545,7 +550,7 @@ static ex psi2_series(const ex & n, return (psi(n, arg+m+_ex1)-recur).series(rel, order, options); } -const unsigned function_index_psi2 = +unsigned psi2_SERIAL::serial = function::register_new(function_options("psi"). eval_func(psi2_eval). evalf_func(psi2_evalf).