]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_gamma.cpp
Synced to HEAD.
[ginac.git] / ginac / inifcns_gamma.cpp
index 6bf85621d8e6f8f216edcb182b44fa4b7d2ddeb0..0ae8d1a351c985effbcd5cc95b2f891651e25b5c 100644 (file)
@@ -4,7 +4,7 @@
  *  some related stuff. */
 
 /*
- *  GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2004 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
@@ -193,7 +193,7 @@ static ex tgamma_series(const ex & arg,
        //   tgamma(x) == tgamma(x+1) / x
        // from which follows
        //   series(tgamma(x),x==-m,order) ==
-       //   series(tgamma(x+m+1)/(x*(x+1)*...*(x+m)),x==-m,order+1);
+       //   series(tgamma(x+m+1)/(x*(x+1)*...*(x+m)),x==-m,order);
        const ex arg_pt = arg.subs(rel, subs_options::no_pattern);
        if (!arg_pt.info(info_flags::integer) || arg_pt.info(info_flags::positive))
                throw do_taylor();  // caught by function::series()
@@ -202,7 +202,7 @@ static ex tgamma_series(const ex & arg,
        ex ser_denom = _ex1;
        for (numeric p; p<=m; ++p)
                ser_denom *= arg+p;
-       return (tgamma(arg+m+_ex1)/ser_denom).series(rel, order+1, options);
+       return (tgamma(arg+m+_ex1)/ser_denom).series(rel, order, options);
 }
 
 
@@ -304,19 +304,19 @@ static ex beta_series(const ex & arg1,
                throw do_taylor();  // caught by function::series()
        // trap the case where arg1 is on a pole:
        if (arg1.info(info_flags::integer) && !arg1.info(info_flags::positive))
-               arg1_ser = tgamma(arg1+s).series(rel, order, options);
+               arg1_ser = tgamma(arg1+s);
        else
-               arg1_ser = tgamma(arg1).series(rel,order);
+               arg1_ser = tgamma(arg1);
        // trap the case where arg2 is on a pole:
        if (arg2.info(info_flags::integer) && !arg2.info(info_flags::positive))
-               arg2_ser = tgamma(arg2+s).series(rel, order, options);
+               arg2_ser = tgamma(arg2+s);
        else
-               arg2_ser = tgamma(arg2).series(rel,order);
+               arg2_ser = tgamma(arg2);
        // trap the case where arg1+arg2 is on a pole:
        if ((arg1+arg2).info(info_flags::integer) && !(arg1+arg2).info(info_flags::positive))
-               arg1arg2_ser = tgamma(arg2+arg1+s).series(rel, order, options);
+               arg1arg2_ser = tgamma(arg2+arg1+s);
        else
-               arg1arg2_ser = tgamma(arg2+arg1).series(rel,order);
+               arg1arg2_ser = tgamma(arg2+arg1);
        // compose the result (expanding all the terms):
        return (arg1_ser*arg2_ser/arg1arg2_ser).series(rel, order, options).expand();
 }