]> www.ginac.de Git - ginac.git/commitdiff
- gamma() -> Gamma().
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 21 Mar 2000 19:30:22 +0000 (19:30 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 21 Mar 2000 19:30:22 +0000 (19:30 +0000)
- EulerGamma -> gamma.
- beta() -> Beta().
- Version -> 0.6.0 in order to make it clear there were *real* changes.

18 files changed:
NEWS
check/exam_inifcns.cpp
check/exam_pseries.cpp
check/time_gammaseries.cpp
check/times.ref
configure
configure.in
doc/tutorial/ginac.texi
ginac/constant.cpp
ginac/constant.h
ginac/inifcns.cpp
ginac/inifcns.h
ginac/inifcns_gamma.cpp
ginac/numeric.cpp
ginac/numeric.h
ginsh/ginsh.1
ginsh/ginsh_lexer.ll
ginsh/ginsh_parser.yy

diff --git a/NEWS b/NEWS
index 4467ebcde59a2aec24bee7cc44c4fe41667fc35c..0824232ae0651befc14547b75e65a33715549406 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,11 @@
 This file records noteworthy changes.
 
+0.6.0 (...)
+* Important interface changes:
+  gamma() -> Gamma()
+  EulerGamma -> gamma
+  beta() -> Beta()
+
 0.5.4 (15 March 2000)
 * Some algorithms in class matrix (notably determinant) were replaced by
   less brain-dead ones and should now have much better performance.
index d91c02c0178346ccaed73f77d8976b3d2f5bce4b..16788c54d2c658f675d7172739b27e3952a6047e 100644 (file)
@@ -100,37 +100,37 @@ static unsigned inifcns_consist_gamma(void)
     unsigned result = 0;
     ex e;
     
-    e = gamma(ex(1));
+    e = Gamma(ex(1));
     for (int i=2; i<8; ++i)
-        e += gamma(ex(i));
+        e += Gamma(ex(i));
     if (e != numeric(874)) {
-        clog << "gamma(1)+...+gamma(7) erroneously returned "
+        clog << "Gamma(1)+...+Gamma(7) erroneously returned "
              << e << " instead of 874" << endl;
         ++result;
     }
     
-    e = gamma(ex(1));
+    e = Gamma(ex(1));
     for (int i=2; i<8; ++i)
-        e *= gamma(ex(i));    
+        e *= Gamma(ex(i));    
     if (e != numeric(24883200)) {
-        clog << "gamma(1)*...*gamma(7) erroneously returned "
+        clog << "Gamma(1)*...*Gamma(7) erroneously returned "
              << e << " instead of 24883200" << endl;
         ++result;
     }
     
-    e = gamma(ex(numeric(5, 2)))*gamma(ex(numeric(9, 2)))*64;
+    e = Gamma(ex(numeric(5, 2)))*Gamma(ex(numeric(9, 2)))*64;
     if (e != 315*Pi) {
-        clog << "64*gamma(5/2)*gamma(9/2) erroneously returned "
+        clog << "64*Gamma(5/2)*Gamma(9/2) erroneously returned "
              << e << " instead of 315*Pi" << endl;
         ++result;
     }
     
-    e = gamma(ex(numeric(-13, 2)));
+    e = Gamma(ex(numeric(-13, 2)));
     for (int i=-13; i<7; i=i+2)
-        e += gamma(ex(numeric(i, 2)));
-    e = (e*gamma(ex(numeric(15, 2)))*numeric(512));
+        e += Gamma(ex(numeric(i, 2)));
+    e = (e*Gamma(ex(numeric(15, 2)))*numeric(512));
     if (e != numeric(633935)*Pi) {
-        clog << "512*(gamma(-13/2)+...+gamma(5/2))*gamma(15/2) erroneously returned "
+        clog << "512*(Gamma(-13/2)+...+Gamma(5/2))*Gamma(15/2) erroneously returned "
              << e << " instead of 633935*Pi" << endl;
         ++result;
     }
@@ -147,11 +147,11 @@ static unsigned inifcns_consist_psi(void)
     ex e, f;
     
     // We check psi(1) and psi(1/2) implicitly by calculating the curious
-    // little identity gamma(1)'/gamma(1) - gamma(1/2)'/gamma(1/2) == 2*log(2).
-    e += (gamma(x).diff(x)/gamma(x)).subs(x==numeric(1));
-    e -= (gamma(x).diff(x)/gamma(x)).subs(x==numeric(1,2));
+    // little identity Gamma(1)'/Gamma(1) - Gamma(1/2)'/Gamma(1/2) == 2*log(2).
+    e += (Gamma(x).diff(x)/Gamma(x)).subs(x==numeric(1));
+    e -= (Gamma(x).diff(x)/Gamma(x)).subs(x==numeric(1,2));
     if (e!=2*log(2)) {
-        clog << "gamma(1)'/gamma(1) - gamma(1/2)'/gamma(1/2) erroneously returned "
+        clog << "Gamma(1)'/Gamma(1) - Gamma(1/2)'/Gamma(1/2) erroneously returned "
              << e << " instead of 2*log(2)" << endl;
         ++result;
     }
index efcc0fc173dd5cd77ab630edcceeb4f4b907faf1..a5625efa2c011afbc832c476a22e3069e3fd6e86 100644 (file)
@@ -153,32 +153,32 @@ static unsigned exam_series5(void)
     unsigned result = 0;
     ex e, d;
     
-    // gamma(-1):
-    e = gamma(2*x);
+    // Gamma(-1):
+    e = Gamma(2*x);
     d = pow(x+1,-1)*numeric(1,4) +
         pow(x+1,0)*(numeric(3,4) -
-                    numeric(1,2)*EulerGamma) +
+                    numeric(1,2)*gamma) +
         pow(x+1,1)*(numeric(7,4) -
-                    numeric(3,2)*EulerGamma +
-                    numeric(1,2)*pow(EulerGamma,2) +
+                    numeric(3,2)*gamma +
+                    numeric(1,2)*pow(gamma,2) +
                     numeric(1,12)*pow(Pi,2)) +
         pow(x+1,2)*(numeric(15,4) -
-                    numeric(7,2)*EulerGamma -
-                    numeric(1,3)*pow(EulerGamma,3) +
+                    numeric(7,2)*gamma -
+                    numeric(1,3)*pow(gamma,3) +
                     numeric(1,4)*pow(Pi,2) +
-                    numeric(3,2)*pow(EulerGamma,2) -
-                    numeric(1,6)*pow(Pi,2)*EulerGamma -
+                    numeric(3,2)*pow(gamma,2) -
+                    numeric(1,6)*pow(Pi,2)*gamma -
                     numeric(2,3)*zeta(3)) +
-        pow(x+1,3)*(numeric(31,4) - pow(EulerGamma,3) -
-                    numeric(15,2)*EulerGamma +
-                    numeric(1,6)*pow(EulerGamma,4) +
-                    numeric(7,2)*pow(EulerGamma,2) +
+        pow(x+1,3)*(numeric(31,4) - pow(gamma,3) -
+                    numeric(15,2)*gamma +
+                    numeric(1,6)*pow(gamma,4) +
+                    numeric(7,2)*pow(gamma,2) +
                     numeric(7,12)*pow(Pi,2) -
-                    numeric(1,2)*pow(Pi,2)*EulerGamma -
+                    numeric(1,2)*pow(Pi,2)*gamma -
                     numeric(2)*zeta(3) +
-                    numeric(1,6)*pow(EulerGamma,2)*pow(Pi,2) +
+                    numeric(1,6)*pow(gamma,2)*pow(Pi,2) +
                     numeric(1,40)*pow(Pi,4) +
-                    numeric(4,3)*zeta(3)*EulerGamma) +
+                    numeric(4,3)*zeta(3)*gamma) +
         Order(pow(x+1,4));
     result += check_series(e, -1, d, 4);
     
index 6da460f66994f7432db4aeb5a0579f883551d553..5fb3ddc95af6f7b7a5dfd5abb6c54cb03562b2fa 100644 (file)
@@ -1,6 +1,6 @@
 /** @file time_gammaseries.cpp
  *
- *  Some timings on series expansion of the gamma function around a pole. */
+ *  Some timings on series expansion of the Gamma function around a pole. */
 
 /*
  *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
 
 #include "times.h"
 
-unsigned gammaseries(unsigned order)
+unsigned Gammaseries(unsigned order)
 {
     unsigned result = 0;
     symbol x;
     
-    ex myseries = series(gamma(x),x,0,order);
+    ex myseries = series(Gamma(x),x,0,order);
     // compute the last coefficient numerically:
     ex last_coeff = myseries.coeff(x,order-1).evalf();
     // compute a bound for that coefficient using a variation of the leading
@@ -35,7 +35,7 @@ unsigned gammaseries(unsigned order)
     ex bound = evalf(exp(ex(-.57721566490153286*(order-1)))/(order-1));
     if (evalf(abs((last_coeff-pow(-1,order))/bound)) > numeric(1)) {
         clog << "The " << order-1
-             << "th order coefficient in the power series expansion of gamma(0) was erroneously found to be "
+             << "th order coefficient in the power series expansion of Gamma(0) was erroneously found to be "
              << last_coeff << ", violating a simple estimate." << endl;
         ++result;
     }
@@ -47,8 +47,8 @@ unsigned time_gammaseries(void)
 {
     unsigned result = 0;
     
-    cout << "timing Laurent series expansion of gamma function" << flush;
-    clog << "-------Laurent series expansion of gamma function:" << endl;
+    cout << "timing Laurent series expansion of Gamma function" << flush;
+    clog << "-------Laurent series expansion of Gamma function:" << endl;
     
     vector<unsigned> sizes;
     vector<double> times;
@@ -61,7 +61,7 @@ unsigned time_gammaseries(void)
     
     for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i) {
         omega.start();
-        result += gammaseries(*i);
+        result += Gammaseries(*i);
         times.push_back(omega.read());
         cout << '.' << flush;
     }
index abadcbe419d67d68f45c179c25bf76091c4ae10b..e45683b75b7b1d8acbf213ef1656ad2238ba3c7e 100644 (file)
@@ -1,6 +1,6 @@
 -------commutative expansion and substitution:
 (no output)
--------Laurent series expansion of gamma function:
+-------Laurent series expansion of Gamma function:
 (no output)
 -------determinant of univariate symbolic Vandermonde matrices:
 (no output)
index a48a95134a567a2bf84e7567a617b4e5321b0984..ca421d097c8ed856e051b9a215d868713f514cd0 100755 (executable)
--- a/configure
+++ b/configure
@@ -544,10 +544,10 @@ fi
 
 
 GINACLIB_MAJOR_VERSION=0
-GINACLIB_MINOR_VERSION=5
-GINACLIB_MICRO_VERSION=4
-GINACLIB_INTERFACE_AGE=4
-GINACLIB_BINARY_AGE=4
+GINACLIB_MINOR_VERSION=6
+GINACLIB_MICRO_VERSION=0
+GINACLIB_INTERFACE_AGE=0
+GINACLIB_BINARY_AGE=0
 GINACLIB_VERSION=$GINACLIB_MAJOR_VERSION.$GINACLIB_MINOR_VERSION.$GINACLIB_MICRO_VERSION
 
 
index d203c3acdfb3628b52323c956485521384204b06..432ca153c119551358fff71a5c24b49b776f0f29 100644 (file)
@@ -18,10 +18,10 @@ dnl autoconf sees "AC_MAJOR_VERSION" and complains about an undefined macro
 dnl (don't we all *love* M4?)...
 
 GINACLIB_MAJOR_VERSION=0
-GINACLIB_MINOR_VERSION=5
-GINACLIB_MICRO_VERSION=4
-GINACLIB_INTERFACE_AGE=4
-GINACLIB_BINARY_AGE=4
+GINACLIB_MINOR_VERSION=6
+GINACLIB_MICRO_VERSION=0
+GINACLIB_INTERFACE_AGE=0
+GINACLIB_BINARY_AGE=0
 GINACLIB_VERSION=$GINACLIB_MAJOR_VERSION.$GINACLIB_MINOR_VERSION.$GINACLIB_MICRO_VERSION
 
 AC_SUBST(GINACLIB_MAJOR_VERSION)
index 1d060689837613c748f78bc52102d9423c5d36f2..89a7b29da32d4df2d78f6bf9654f5c15efc38a02 100644 (file)
@@ -387,15 +387,15 @@ tan(x)^2+1
 x-1/6*x^3+Order(x^4)
 > series(1/tan(x),x,0,4);
 x^(-1)-1/3*x+Order(x^2)
-> series(gamma(x),x,0,3);
-x^(-1)-EulerGamma+(1/12*Pi^2+1/2*EulerGamma^2)*x
-+(-1/3*zeta(3)-1/12*Pi^2*EulerGamma-1/6*EulerGamma^3)*x^2+Order(x^3)
+> series(Gamma(x),x,0,3);
+x^(-1)-gamma+(1/12*Pi^2+1/2*gamma^2)*x+
+(-1/3*zeta(3)-1/12*Pi^2*gamma-1/6*gamma^3)*x^2+Order(x^3)
 > evalf(");
 x^(-1)-0.5772156649015328606+(0.9890559953279725555)*x
 -(0.90747907608088628905)*x^2+Order(x^3)
-> series(gamma(2*sin(x)-2),x,Pi/2,6);
--(x-1/2*Pi)^(-2)+(-1/12*Pi^2-1/2*EulerGamma^2-1/240)*(x-1/2*Pi)^2
--EulerGamma-1/12+Order((x-1/2*Pi)^3)
+> series(Gamma(2*sin(x)-2),x,Pi/2,6);
+-(x-1/2*Pi)^(-2)+(-1/12*Pi^2-1/2*gamma^2-1/240)*(x-1/2*Pi)^2
+-gamma-1/12+Order((x-1/2*Pi)^3)
 @end example
 
 Here we have made use of the @command{ginsh}-command @code{"} to pop the
@@ -1013,7 +1013,7 @@ following table.
 
 @cindex @code{Pi}
 @cindex @code{Catalan}
-@cindex @code{EulerGamma}
+@cindex @code{gamma}
 @cindex @code{evalf()}
 Constants behave pretty much like symbols except that they return some
 specific number when the method @code{.evalf()} is called.
@@ -1029,7 +1029,7 @@ The predefined known constants are:
 @item @code{Catalan}
 @tab Catalan's constant
 @tab 0.91596559417721901505460351493238411
-@item @code{EulerGamma}
+@item @code{gamma}
 @tab Euler's (or Euler-Mascheroni) constant
 @tab 0.57721566490153286060651209008240243
 @end multitable
@@ -1146,11 +1146,11 @@ int main()
     symbol x("x"), y("y");
     
     ex foo = x+y/2;
-    cout << "gamma(" << foo << ") -> " << gamma(foo) << endl;
+    cout << "Gamma(" << foo << ") -> " << Gamma(foo) << endl;
     ex bar = foo.subs(y==1);
-    cout << "gamma(" << bar << ") -> " << gamma(bar) << endl;
+    cout << "Gamma(" << bar << ") -> " << Gamma(bar) << endl;
     ex foobar = bar.subs(x==7);
-    cout << "gamma(" << foobar << ") -> " << gamma(foobar) << endl;
+    cout << "Gamma(" << foobar << ") -> " << Gamma(foobar) << endl;
     // ...
 @}
 @end example
@@ -1159,9 +1159,9 @@ This program shows how the function returns itself twice and finally an
 expression that may be really useful:
 
 @example
-gamma(x+(1/2)*y) -> gamma(x+(1/2)*y)
-gamma(x+1/2) -> gamma(x+1/2)
-gamma(15/2) -> (135135/128)*Pi^(1/2)
+Gamma(x+(1/2)*y) -> Gamma(x+(1/2)*y)
+Gamma(x+1/2) -> Gamma(x+1/2)
+Gamma(15/2) -> (135135/128)*Pi^(1/2)
 @end example
 
 @cindex branch cut
index b8543092c0d993e4b8993ceda68e9a435afba7d5..b1b9237a1a486b26345c489cb73bcb9bfd131e91 100644 (file)
@@ -125,8 +125,8 @@ ex constant::unarchive(const archive_node &n, const lst &sym_lst)
             return Pi;
         else if (s == Catalan.name)
             return Catalan;
-        else if (s == EulerGamma.name)
-            return EulerGamma;
+        else if (s == gamma.name)
+            return gamma;
         else
             throw (std::runtime_error("unknown constant '" + s + "' in archive"));
     } else
@@ -244,7 +244,7 @@ const type_info & typeid_constant=typeid(some_constant);
 /**  Pi. (3.14159...)  Diverts straight into CLN for evalf(). */
 const constant Pi("Pi", PiEvalf);
 /** Catalan's constant. (0.91597...)  Diverts straight into CLN for evalf(). */
-const constant EulerGamma("EulerGamma", EulerGammaEvalf);
+const constant gamma("gamma", gammaEvalf);
 /** Euler's constant. (0.57721...)  Sometimes called Euler-Mascheroni constant.
  *  Diverts straight into CLN for evalf(). */
 const constant Catalan("Catalan", CatalanEvalf);
index 91ede2825ec395a59c131419c493915f90c791f0..aa917e54b8510e735d22138a50618c810f467980 100644 (file)
@@ -95,7 +95,7 @@ extern const type_info & typeid_constant;
 // extern const numeric I;
 extern const constant Pi;
 extern const constant Catalan;
-extern const constant EulerGamma;
+extern const constant gamma;
 
 #ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
index e9e2cad1421b0bbcbccd985d487f61994d58d62a..e8531a062e8e7d6b2baed72620c23006c48ff8c8 100644 (file)
@@ -321,7 +321,7 @@ ex ncpower(const ex &basis, unsigned exponent)
 
 /** Force inclusion of functions from initcns_gamma and inifcns_zeta
  *  for static lib (so ginsh will see them). */
-unsigned force_include_gamma = function_index_gamma;
+unsigned force_include_gamma = function_index_Gamma;
 unsigned force_include_zeta1 = function_index_zeta1;
 
 #ifndef NO_NAMESPACE_GINAC
index 176f67943ccbfecdb9af7fb7ba4f035aae790196..5dfbdaa902844d31f101f020e191d3ed06968e97 100644 (file)
@@ -97,10 +97,10 @@ inline function zeta(const ex & p1, const ex & p2) {
 }
 
 /** Gamma-function. */
-DECLARE_FUNCTION_1P(gamma)
+DECLARE_FUNCTION_1P(Gamma)
 
 /** Beta-function. */
-DECLARE_FUNCTION_2P(beta)
+DECLARE_FUNCTION_2P(Beta)
 
 // overloading at work: we cannot use the macros
 /** Psi-function (aka digamma-function). */
index 7480bf204385814a5fbe68b3212be4c04caf76aa..fe059a4449003ee08099fb79cbcd274efe19588c 100644 (file)
@@ -42,37 +42,37 @@ namespace GiNaC {
 // Gamma-function
 //////////
 
-static ex gamma_evalf(const ex & x)
+static ex Gamma_evalf(const ex & x)
 {
     BEGIN_TYPECHECK
         TYPECHECK(x,numeric)
-    END_TYPECHECK(gamma(x))
+    END_TYPECHECK(Gamma(x))
     
-    return gamma(ex_to_numeric(x));
+    return Gamma(ex_to_numeric(x));
 }
 
 
-/** Evaluation of gamma(x). Knows about integer arguments, half-integer
+/** 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...
  *
- *  @exception std::domain_error("gamma_eval(): simple pole") */
-static ex gamma_eval(const ex & x)
+ *  @exception std::domain_error("Gamma_eval(): simple pole") */
+static ex Gamma_eval(const ex & x)
 {
     if (x.info(info_flags::numeric)) {
         // trap integer arguments:
         if (x.info(info_flags::integer)) {
-            // gamma(n+1) -> n! for postitive n
+            // Gamma(n+1) -> n! for postitive n
             if (x.info(info_flags::posint)) {
                 return factorial(ex_to_numeric(x).sub(_num1()));
             } else {
-                throw (std::domain_error("gamma_eval(): simple pole"));
+                throw (std::domain_error("Gamma_eval(): simple pole"));
             }
         }
         // trap half integer arguments:
         if ((x*2).info(info_flags::integer)) {
             // trap positive x==(n+1/2)
-            // gamma(n+1/2) -> Pi^(1/2)*(1*3*..*(2*n-1))/(2^n)
+            // Gamma(n+1/2) -> Pi^(1/2)*(1*3*..*(2*n-1))/(2^n)
             if ((x*_ex2()).info(info_flags::posint)) {
                 numeric n = ex_to_numeric(x).sub(_num1_2());
                 numeric coefficient = doublefactorial(n.mul(_num2()).sub(_num1()));
@@ -80,40 +80,40 @@ static ex gamma_eval(const ex & x)
                 return coefficient * pow(Pi,_ex1_2());
             } else {
                 // trap negative x==(-n+1/2)
-                // gamma(-n+1/2) -> Pi^(1/2)*(-2)^n/(1*3*..*(2*n-1))
+                // Gamma(-n+1/2) -> Pi^(1/2)*(-2)^n/(1*3*..*(2*n-1))
                 numeric n = abs(ex_to_numeric(x).sub(_num1_2()));
                 numeric coefficient = pow(_num_2(), n);
                 coefficient = coefficient.div(doublefactorial(n.mul(_num2()).sub(_num1())));;
                 return coefficient*power(Pi,_ex1_2());
             }
         }
-        //  gamma_evalf should be called here once it becomes available
+        //  Gamma_evalf should be called here once it becomes available
     }
     
-    return gamma(x).hold();
+    return Gamma(x).hold();
 }    
 
 
-static ex gamma_deriv(const ex & x, unsigned deriv_param)
+static ex Gamma_deriv(const ex & x, unsigned deriv_param)
 {
     GINAC_ASSERT(deriv_param==0);
     
-    // d/dx  log(gamma(x)) -> psi(x)
-    // d/dx  gamma(x) -> psi(x)*gamma(x)
-    return psi(x)*gamma(x);
+    // d/dx  log(Gamma(x)) -> psi(x)
+    // d/dx  Gamma(x) -> psi(x)*Gamma(x)
+    return psi(x)*Gamma(x);
 }
 
 
-static ex gamma_series(const ex & x, const symbol & s, const ex & pt, int order)
+static ex Gamma_series(const ex & x, const symbol & s, const ex & pt, int order)
 {
     // method:
     // Taylor series where there is no pole falls back to psi function
     // evaluation.
     // On a pole at -m use the recurrence relation
-    //   gamma(x) == gamma(x+1) / x
+    //   Gamma(x) == Gamma(x+1) / x
     // from which follows
-    //   series(gamma(x),x,-m,order) ==
-    //   series(gamma(x+m+1)/(x*(x+1)*...*(x+m)),x,-m,order+1);
+    //   series(Gamma(x),x,-m,order) ==
+    //   series(Gamma(x+m+1)/(x*(x+1)*...*(x+m)),x,-m,order+1);
     const ex x_pt = x.subs(s==pt);
     if (!x_pt.info(info_flags::integer) || x_pt.info(info_flags::positive))
         throw do_taylor();  // caught by function::series()
@@ -122,54 +122,54 @@ static ex gamma_series(const ex & x, const symbol & s, const ex & pt, int order)
     ex ser_denom = _ex1();
     for (numeric p; p<=m; ++p)
         ser_denom *= x+p;
-    return (gamma(x+m+_ex1())/ser_denom).series(s, pt, order+1);
+    return (Gamma(x+m+_ex1())/ser_denom).series(s, pt, order+1);
 }
 
 
-REGISTER_FUNCTION(gamma, eval_func(gamma_eval).
-                         evalf_func(gamma_evalf).
-                         derivative_func(gamma_deriv).
-                         series_func(gamma_series));
+REGISTER_FUNCTION(Gamma, eval_func(Gamma_eval).
+                         evalf_func(Gamma_evalf).
+                         derivative_func(Gamma_deriv).
+                         series_func(Gamma_series));
 
 
 //////////
 // Beta-function
 //////////
 
-static ex beta_evalf(const ex & x, const ex & y)
+static ex Beta_evalf(const ex & x, const ex & y)
 {
     BEGIN_TYPECHECK
         TYPECHECK(x,numeric)
         TYPECHECK(y,numeric)
-    END_TYPECHECK(beta(x,y))
+    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)
+static ex Beta_eval(const ex & x, const ex & y)
 {
     if (x.info(info_flags::numeric) && y.info(info_flags::numeric)) {
-        // treat all problematic x and y that may not be passed into gamma,
-        // because they would throw there although beta(x,y) is well-defined
-        // using the formula beta(x,y) == (-1)^y * beta(1-x-y, y)
+        // treat all problematic x and y that may not be passed into Gamma,
+        // because they would throw there although Beta(x,y) is well-defined
+        // using the formula Beta(x,y) == (-1)^y * Beta(1-x-y, y)
         numeric nx(ex_to_numeric(x));
         numeric ny(ex_to_numeric(y));
         if (nx.is_real() && nx.is_integer() &&
             ny.is_real() && ny.is_integer()) {
             if (nx.is_negative()) {
                 if (nx<=-ny)
-                    return pow(_num_1(), ny)*beta(1-x-y, y);
+                    return pow(_num_1(), ny)*Beta(1-x-y, y);
                 else
-                    throw (std::domain_error("beta_eval(): simple pole"));
+                    throw (std::domain_error("Beta_eval(): simple pole"));
             }
             if (ny.is_negative()) {
                 if (ny<=-nx)
-                    return pow(_num_1(), nx)*beta(1-y-x, x);
+                    return pow(_num_1(), nx)*Beta(1-y-x, x);
                 else
-                    throw (std::domain_error("beta_eval(): simple pole"));
+                    throw (std::domain_error("Beta_eval(): simple pole"));
             }
-            return gamma(x)*gamma(y)/gamma(x+y);
+            return Gamma(x)*Gamma(y)/Gamma(x+y);
         }
         // no problem in numerator, but denominator has pole:
         if ((nx+ny).is_real() &&
@@ -177,34 +177,34 @@ static ex beta_eval(const ex & x, const ex & y)
             !(nx+ny).is_positive())
              return _ex0();
         // everything is ok:
-        return gamma(x)*gamma(y)/gamma(x+y);
+        return Gamma(x)*Gamma(y)/Gamma(x+y);
     }
     
-    return beta(x,y).hold();
+    return Beta(x,y).hold();
 }
 
 
-static ex beta_deriv(const ex & x, const ex & y, unsigned deriv_param)
+static ex Beta_deriv(const ex & x, const ex & y, unsigned deriv_param)
 {
     GINAC_ASSERT(deriv_param<2);
     ex retval;
     
-    // d/dx beta(x,y) -> (psi(x)-psi(x+y)) * beta(x,y)
+    // d/dx Beta(x,y) -> (psi(x)-psi(x+y)) * Beta(x,y)
     if (deriv_param==0)
-        retval = (psi(x)-psi(x+y))*beta(x,y);
-    // d/dy beta(x,y) -> (psi(y)-psi(x+y)) * beta(x,y)
+        retval = (psi(x)-psi(x+y))*Beta(x,y);
+    // d/dy Beta(x,y) -> (psi(y)-psi(x+y)) * Beta(x,y)
     if (deriv_param==1)
-        retval = (psi(y)-psi(x+y))*beta(x,y);
+        retval = (psi(y)-psi(x+y))*Beta(x,y);
     return retval;
 }
 
 
-static ex beta_series(const ex & x, const ex & y, const symbol & s, const ex & pt, int order)
+static ex Beta_series(const ex & x, const ex & y, const symbol & s, const ex & pt, int order)
 {
     // method:
-    // Taylor series where there is no pole of one of the gamma functions
-    // falls back to beta function evaluation.  Otherwise, fall back to
-    // gamma series directly.
+    // Taylor series where there is no pole of one of the Gamma functions
+    // falls back to Beta function evaluation.  Otherwise, fall back to
+    // Gamma series directly.
     // FIXME: this could need some testing, maybe it's wrong in some cases?
     const ex x_pt = x.subs(s==pt);
     const ex y_pt = y.subs(s==pt);
@@ -214,28 +214,28 @@ static ex beta_series(const ex & x, const ex & y, const symbol & s, const ex & p
         throw do_taylor();  // caught by function::series()
     // 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);
+        x_ser = Gamma(x+s).series(s,pt,order);
     else
-        x_ser = gamma(x).series(s,pt,order);
+        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);
+        y_ser = Gamma(y+s).series(s,pt,order);
     else
-        y_ser = gamma(y).series(s,pt,order);
+        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);
+        xy_ser = Gamma(y+x+s).series(s,pt,order);
     else
-        xy_ser = gamma(y+x).series(s,pt,order);
+        xy_ser = Gamma(y+x).series(s,pt,order);
     // compose the result:
     return (x_ser*y_ser/xy_ser).series(s,pt,order);
 }
 
 
-REGISTER_FUNCTION(beta, eval_func(beta_eval).
-                        evalf_func(beta_evalf).
-                        derivative_func(beta_deriv).
-                        series_func(beta_series));
+REGISTER_FUNCTION(Beta, eval_func(Beta_eval).
+                        evalf_func(Beta_evalf).
+                        derivative_func(Beta_deriv).
+                        series_func(Beta_series));
 
 
 //////////
@@ -260,11 +260,11 @@ static ex psi1_eval(const ex & x)
         if (nx.is_integer()) {
             // integer case 
             if (nx.is_positive()) {
-                // psi(n) -> 1 + 1/2 +...+ 1/(n-1) - EulerGamma
+                // psi(n) -> 1 + 1/2 +...+ 1/(n-1) - gamma
                 numeric rat(0);
                 for (numeric i(nx+_num_1()); i.is_positive(); --i)
                     rat += i.inverse();
-                return rat-EulerGamma;
+                return rat-gamma;
             } else {
                 // for non-positive integers there is a pole:
                 throw (std::domain_error("psi_eval(): simple pole"));
@@ -273,11 +273,11 @@ static ex psi1_eval(const ex & x)
         if ((_num2()*nx).is_integer()) {
             // half integer case
             if (nx.is_positive()) {
-                // psi((2m+1)/2) -> 2/(2m+1) + 2/2m +...+ 2/1 - EulerGamma - 2log(2)
+                // psi((2m+1)/2) -> 2/(2m+1) + 2/2m +...+ 2/1 - gamma - 2log(2)
                 numeric rat(0);
                 for (numeric i((nx+_num_1())*_num2()); i.is_positive(); i-=_num2())
                                       rat += _num2()*i.inverse();
-                                      return rat-EulerGamma-_ex2()*log(_ex2());
+                                      return rat-gamma-_ex2()*log(_ex2());
             } else {
                 // use the recurrence relation
                 //   psi(-m-1/2) == psi(-m-1/2+1) - 1 / (-m-1/2)
@@ -354,9 +354,9 @@ static ex psi2_eval(const ex & n, const ex & x)
     // psi(0,x) -> psi(x)
     if (n.is_zero())
         return psi(x);
-    // psi(-1,x) -> log(gamma(x))
+    // psi(-1,x) -> log(Gamma(x))
     if (n.is_equal(_ex_1()))
-        return log(gamma(x));
+        return log(Gamma(x));
     if (n.info(info_flags::numeric) && n.info(info_flags::posint) &&
         x.info(info_flags::numeric)) {
         numeric nn = ex_to_numeric(n);
index e5611eaf808f5d6b43cea22ea1a0068ddb10cc6e..c0649f6f70b550987df6177efcea50f44b0e8f9d 100644 (file)
@@ -1382,11 +1382,11 @@ const numeric zeta(const numeric & x)
 }
 
 
-/** The gamma function.
+/** The Gamma function.
  *  This is only a stub! */
-const numeric gamma(const numeric & x)
+const numeric Gamma(const numeric & x)
 {
-    clog << "gamma(" << x
+    clog << "Gamma(" << x
          << "): Does anybody know good way to calculate this numerically?"
          << endl;
     return numeric(0);
@@ -1732,7 +1732,7 @@ ex PiEvalf(void)
 
 
 /** Floating point evaluation of Euler's constant Gamma. */
-ex EulerGammaEvalf(void)
+ex gammaEvalf(void)
 { 
     return numeric(::cl_eulerconst(cl_default_float_format));  // -> CLN
 }
index 95ba4419073d4b75b2d30e2b3bc3bc4176231883..bd05bf663c12d57b4c8a298f2089f4c0712d8fab 100644 (file)
@@ -232,7 +232,7 @@ const numeric asinh(const numeric & x);
 const numeric acosh(const numeric & x);
 const numeric atanh(const numeric & x);
 const numeric zeta(const numeric & x);
-const numeric gamma(const numeric & x);
+const numeric Gamma(const numeric & x);
 const numeric psi(const numeric & x);
 const numeric psi(const numeric & n, const numeric & x);
 const numeric factorial(const numeric & n);
@@ -322,7 +322,7 @@ inline numeric denom(const numeric & x)
 // numeric evaluation functions for class constant objects:
 
 ex PiEvalf(void);
-ex EulerGammaEvalf(void);
+ex gammaEvalf(void);
 ex CatalanEvalf(void);
 
 
index 9df41f777263cddcaf9c6bdeb0f5305e6af93549..414f95b46de6d813d86d60bd2834bd99aa0be3df 100644 (file)
@@ -82,7 +82,7 @@ Archimedes' Constant
 .B Catalan
 Catalan's Constant
 .TP
-.B EulerGamma
+.B gamma
 Euler-Mascheroni Constant
 .TP
 .B I
index fddc0b3718c47618a51a5860114a0435bb580400..94bff017b1de95c3c130210ce3377433c4a556b7 100644 (file)
@@ -59,7 +59,7 @@ AN    [0-9a-zA-Z_]
 
                        /* special values */
 Pi                     yylval = Pi; return T_LITERAL;
-EulerGamma             yylval = EulerGamma; return T_LITERAL;
+gamma                  yylval = gamma; return T_LITERAL;
 Catalan                        yylval = Catalan; return T_LITERAL;
 FAIL                   yylval = *new fail(); return T_LITERAL;
 I                      yylval = I; return T_NUMBER;
index 6697d6f020ce0cfc4285ec72361488a1b26b7db0..77d21e72d0d873750fceb71e6c06ec39c83d4e80 100644 (file)
@@ -773,13 +773,13 @@ int main(int argc, char **argv)
        insert_fcn_help("atan", "inverse tangent function");
        insert_fcn_help("atan2", "inverse tangent function with two arguments");
        insert_fcn_help("atanh", "inverse hyperbolic tangent function");
-       insert_fcn_help("beta", "beta function");
+       insert_fcn_help("Beta", "Beta function");
        insert_fcn_help("binomial", "binomial function");
        insert_fcn_help("cos", "cosine function");
        insert_fcn_help("cosh", "hyperbolic cosine function");
        insert_fcn_help("exp", "exponential function");
        insert_fcn_help("factorial", "factorial function");
-       insert_fcn_help("gamma", "gamma function");
+       insert_fcn_help("Gamma", "Gamma function");
        insert_fcn_help("log", "natural logarithm");
        insert_fcn_help("psi", "psi function\npsi(x) is the digamma function, psi(n,x) the nth polygamma function");
        insert_fcn_help("sin", "sine function");