]> www.ginac.de Git - ginac.git/commitdiff
- removed superfluous ex ser_numer; in gamma_series()
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 24 Jan 2000 22:19:37 +0000 (22:19 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 24 Jan 2000 22:19:37 +0000 (22:19 +0000)
ginac/inifcns_gamma.cpp

index d20a27f24b72409ea8b403b982dd2add89b37bb2..3a956a92f07e04735bccfa0a1f862609f6181533 100644 (file)
@@ -51,6 +51,7 @@ static ex gamma_evalf(const ex & x)
     return gamma(ex_to_numeric(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...
 /** 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...
@@ -92,6 +93,7 @@ static ex gamma_eval(const ex & x)
     return gamma(x).hold();
 }    
 
     return gamma(x).hold();
 }    
 
+
 static ex gamma_diff(const ex & x, unsigned diff_param)
 {
     GINAC_ASSERT(diff_param==0);
 static ex gamma_diff(const ex & x, unsigned diff_param)
 {
     GINAC_ASSERT(diff_param==0);
@@ -101,6 +103,7 @@ static ex gamma_diff(const ex & x, unsigned diff_param)
     return psi(x)*gamma(x);
 }
 
     return psi(x)*gamma(x);
 }
 
+
 static ex gamma_series(const ex & x, const symbol & s, const ex & pt, int order)
 {
     // method:
 static ex gamma_series(const ex & x, const symbol & s, const ex & pt, int order)
 {
     // method:
@@ -116,15 +119,16 @@ static ex gamma_series(const ex & x, const symbol & s, const ex & pt, int order)
         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);
         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;
     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);
 
 REGISTER_FUNCTION(gamma, gamma_eval, gamma_evalf, gamma_diff, gamma_series);
 
+
 //////////
 // Beta-function
 //////////
 //////////
 // Beta-function
 //////////
@@ -136,10 +140,10 @@ static ex beta_evalf(const ex & x, const ex & y)
         TYPECHECK(y,numeric)
     END_TYPECHECK(beta(x,y))
     
         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)) {
 static ex beta_eval(const ex & x, const ex & y)
 {
     if (x.info(info_flags::numeric) && y.info(info_flags::numeric)) {
@@ -176,6 +180,7 @@ static ex beta_eval(const ex & x, const ex & y)
     return beta(x,y).hold();
 }
 
     return beta(x,y).hold();
 }
 
+
 static ex beta_diff(const ex & x, const ex & y, unsigned diff_param)
 {
     GINAC_ASSERT(diff_param<2);
 static ex beta_diff(const ex & x, const ex & y, unsigned diff_param)
 {
     GINAC_ASSERT(diff_param<2);
@@ -190,6 +195,7 @@ static ex beta_diff(const ex & x, const ex & y, unsigned diff_param)
     return retval;
 }
 
     return retval;
 }
 
+
 static ex beta_series(const ex & x, const ex & y, const symbol & s, const ex & pt, int order)
 {
     // method:
 static ex beta_series(const ex & x, const ex & y, const symbol & s, const ex & pt, int order)
 {
     // method:
@@ -222,8 +228,10 @@ static ex beta_series(const ex & x, const ex & y, const symbol & s, const ex & p
     return (x_ser*y_ser/xy_ser).series(s,pt,order);
 }
 
     return (x_ser*y_ser/xy_ser).series(s,pt,order);
 }
 
+
 REGISTER_FUNCTION(beta, beta_eval, beta_evalf, beta_diff, beta_series);
 
 REGISTER_FUNCTION(beta, beta_eval, beta_evalf, beta_diff, beta_series);
 
+
 //////////
 // Psi-function (aka digamma-function)
 //////////
 //////////
 // Psi-function (aka digamma-function)
 //////////