// Gamma-function
//////////
+static ex gamma_evalf(ex const & x)
+{
+ BEGIN_TYPECHECK
+ TYPECHECK(x,numeric)
+ END_TYPECHECK(gamma(x))
+
+ 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_evalf(ex const & x)
-{
- BEGIN_TYPECHECK
- TYPECHECK(x,numeric)
- END_TYPECHECK(gamma(x))
-
- return gamma(ex_to_numeric(x));
-}
-
static ex gamma_diff(ex const & x, unsigned diff_param)
{
GINAC_ASSERT(diff_param==0);
// Beta-function
//////////
+static ex beta_evalf(ex const & x, ex const & y)
+{
+ BEGIN_TYPECHECK
+ TYPECHECK(x,numeric)
+ 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));
+}
+
static ex beta_eval(ex const & x, ex const & y)
{
if (x.info(info_flags::numeric) && y.info(info_flags::numeric)) {
return beta(x,y).hold();
}
-static ex beta_evalf(ex const & x, ex const & y)
-{
- BEGIN_TYPECHECK
- TYPECHECK(x,numeric)
- 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));
-}
-
static ex beta_diff(ex const & x, ex const & y, unsigned diff_param)
{
GINAC_ASSERT(diff_param<2);
// Psi-function (aka polygamma-function)
//////////
+static ex psi1_evalf(ex const & x)
+{
+ BEGIN_TYPECHECK
+ TYPECHECK(x,numeric)
+ END_TYPECHECK(psi(x))
+
+ return psi(ex_to_numeric(x));
+}
+
/** Evaluation of polygamma-function psi(x).
* Somebody ought to provide some good numerical evaluation some day... */
static ex psi1_eval(ex const & x)
return psi(x).hold();
}
-static ex psi1_evalf(ex const & x)
-{
- BEGIN_TYPECHECK
- TYPECHECK(x,numeric)
- END_TYPECHECK(psi(x))
-
- return psi(ex_to_numeric(x));
-}
-
static ex psi1_diff(ex const & x, unsigned diff_param)
{
GINAC_ASSERT(diff_param==0);
// Psi-functions (aka polygamma-functions) psi(0,x)==psi(x)
//////////
+static ex psi2_evalf(ex const & n, ex const & x)
+{
+ BEGIN_TYPECHECK
+ TYPECHECK(n,numeric)
+ TYPECHECK(x,numeric)
+ END_TYPECHECK(psi(n,x))
+
+ return psi(ex_to_numeric(n), ex_to_numeric(x));
+}
+
/** Evaluation of polygamma-function psi(n,x).
* Somebody ought to provide some good numerical evaluation some day... */
static ex psi2_eval(ex const & n, ex const & x)
return psi(n, x).hold();
}
-static ex psi2_evalf(ex const & n, ex const & x)
-{
- BEGIN_TYPECHECK
- TYPECHECK(n,numeric)
- TYPECHECK(x,numeric)
- END_TYPECHECK(psi(n,x))
-
- return psi(ex_to_numeric(n), ex_to_numeric(x));
-}
-
static ex psi2_diff(ex const & n, ex const & x, unsigned diff_param)
{
GINAC_ASSERT(diff_param<2);