return gamma(ex_to_numeric(x));
}
+
/** Evaluation of gamma(x). Knows about integer arguments, half-integer
* arguments and that's it. Somebody ought to provide some good numerical
* evaluation some day...
return gamma(x).hold();
}
+
static ex gamma_diff(const ex & x, unsigned diff_param)
{
GINAC_ASSERT(diff_param==0);
return psi(x)*gamma(x);
}
+
static ex gamma_series(const ex & x, const symbol & s, const ex & pt, int order)
{
// method:
throw do_taylor(); // caught by function::series()
// if we got here we have to care for a simple pole at -m:
numeric m = -ex_to_numeric(x_pt);
- ex ser_numer = gamma(x+m+_ex1());
ex ser_denom = _ex1();
for (numeric p; p<=m; ++p)
ser_denom *= x+p;
- return (ser_numer/ser_denom).series(s, pt, order+1);
+ return (gamma(x+m+_ex1())/ser_denom).series(s, pt, order+1);
}
+
REGISTER_FUNCTION(gamma, gamma_eval, gamma_evalf, gamma_diff, gamma_series);
+
//////////
// Beta-function
//////////
TYPECHECK(y,numeric)
END_TYPECHECK(beta(x,y))
- return gamma(ex_to_numeric(x))*gamma(ex_to_numeric(y))
- / gamma(ex_to_numeric(x+y));
+ return gamma(ex_to_numeric(x))*gamma(ex_to_numeric(y))/gamma(ex_to_numeric(x+y));
}
+
static ex beta_eval(const ex & x, const ex & y)
{
if (x.info(info_flags::numeric) && y.info(info_flags::numeric)) {
return beta(x,y).hold();
}
+
static ex beta_diff(const ex & x, const ex & y, unsigned diff_param)
{
GINAC_ASSERT(diff_param<2);
return retval;
}
+
static ex beta_series(const ex & x, const ex & y, const symbol & s, const ex & pt, int order)
{
// method:
return (x_ser*y_ser/xy_ser).series(s,pt,order);
}
+
REGISTER_FUNCTION(beta, beta_eval, beta_evalf, beta_diff, beta_series);
+
//////////
// Psi-function (aka digamma-function)
//////////