- // if we got here we have to care for a simple pole at -m:
- throw (std::domain_error("beta_series(): Mama, please code me!"));
+ // trap the case where x is on a pole directly:
+ if (x.info(info_flags::integer) && !x.info(info_flags::positive))
+ x_ser = gamma(x+s).series(s,pt,order);
+ else
+ x_ser = gamma(x).series(s,pt,order);
+ // trap the case where y is on a pole directly:
+ if (y.info(info_flags::integer) && !y.info(info_flags::positive))
+ y_ser = gamma(y+s).series(s,pt,order);
+ else
+ y_ser = gamma(y).series(s,pt,order);
+ // trap the case where y is on a pole directly:
+ if ((x+y).info(info_flags::integer) && !(x+y).info(info_flags::positive))
+ xy_ser = gamma(y+x+s).series(s,pt,order);
+ else
+ xy_ser = gamma(y+x).series(s,pt,order);
+ // compose the result:
+ return (x_ser*y_ser/xy_ser).series(s,pt,order);