]> www.ginac.de Git - ginac.git/commitdiff
define lgamma and tgamma taking cl_N as an argument.
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Wed, 19 Mar 2008 09:28:34 +0000 (12:28 +0300)
committerJens Vollinga <jensv@nikhef.nl>
Mon, 28 Jul 2008 19:22:51 +0000 (21:22 +0200)
The actual code is the same. These functions are OK since cl_N is not
automatically converted to numeric any more.

ginac/numeric.cpp

index 1b98040314e22f679649fd0386c28e8838805d38..69a787b5d985b5e174ea61a6f38c7b89f2bb3a2c 100644 (file)
@@ -1977,7 +1977,7 @@ static const cln::float_format_t guess_precision(const cln::cl_N& x)
  *  sufficiently many or sufficiently accurate, more can be calculated
  *  using the program doc/examples/lanczos.cpp. In that case, be sure to
  *  read the comments in that file. */
  *  sufficiently many or sufficiently accurate, more can be calculated
  *  using the program doc/examples/lanczos.cpp. In that case, be sure to
  *  read the comments in that file. */
-const cln::cl_N lgamma_(const cln::cl_N &x)
+const cln::cl_N lgamma(const cln::cl_N &x)
 {
        cln::float_format_t prec = guess_precision(x);
        lanczos_coeffs lc;
 {
        cln::float_format_t prec = guess_precision(x);
        lanczos_coeffs lc;
@@ -1985,7 +1985,7 @@ const cln::cl_N lgamma_(const cln::cl_N &x)
                cln::cl_N pi_val = cln::pi(prec);
                if (realpart(x) < 0.5)
                        return cln::log(pi_val) - cln::log(sin(pi_val*x))
                cln::cl_N pi_val = cln::pi(prec);
                if (realpart(x) < 0.5)
                        return cln::log(pi_val) - cln::log(sin(pi_val*x))
-                               - lgamma_(1 - x);
+                               - lgamma(1 - x);
                cln::cl_N A = lc.calc_lanczos_A(x);
                cln::cl_N temp = x + lc.get_order() - cln::cl_N(1)/2;
        cln::cl_N result = log(cln::cl_I(2)*pi_val)/2
                cln::cl_N A = lc.calc_lanczos_A(x);
                cln::cl_N temp = x + lc.get_order() - cln::cl_N(1)/2;
        cln::cl_N result = log(cln::cl_I(2)*pi_val)/2
@@ -2001,18 +2001,18 @@ const cln::cl_N lgamma_(const cln::cl_N &x)
 const numeric lgamma(const numeric &x)
 {
        const cln::cl_N x_ = x.to_cl_N();
 const numeric lgamma(const numeric &x)
 {
        const cln::cl_N x_ = x.to_cl_N();
-       const cln::cl_N result = lgamma_(x_);
+       const cln::cl_N result = lgamma(x_);
        return numeric(result);
 }
 
        return numeric(result);
 }
 
-const cln::cl_N tgamma_(const cln::cl_N &x)
+const cln::cl_N tgamma(const cln::cl_N &x)
 {
        cln::float_format_t prec = guess_precision(x);
        lanczos_coeffs lc;
        if (lc.sufficiently_accurate(prec)) {
                cln::cl_N pi_val = cln::pi(prec);
                if (realpart(x) < 0.5)
 {
        cln::float_format_t prec = guess_precision(x);
        lanczos_coeffs lc;
        if (lc.sufficiently_accurate(prec)) {
                cln::cl_N pi_val = cln::pi(prec);
                if (realpart(x) < 0.5)
-                       return pi_val/(cln::sin(pi_val*x))/tgamma_(1 - x);
+                       return pi_val/(cln::sin(pi_val*x))/tgamma(1 - x);
                cln::cl_N A = lc.calc_lanczos_A(x);
                cln::cl_N temp = x + lc.get_order() - cln::cl_N(1)/2;
        cln::cl_N result
                cln::cl_N A = lc.calc_lanczos_A(x);
                cln::cl_N temp = x + lc.get_order() - cln::cl_N(1)/2;
        cln::cl_N result
@@ -2027,7 +2027,7 @@ const cln::cl_N tgamma_(const cln::cl_N &x)
 const numeric tgamma(const numeric &x)
 {
        const cln::cl_N x_ = x.to_cl_N();
 const numeric tgamma(const numeric &x)
 {
        const cln::cl_N x_ = x.to_cl_N();
-       const cln::cl_N result = tgamma_(x_);
+       const cln::cl_N result = tgamma(x_);
        return numeric(result);
 }
 
        return numeric(result);
 }