Post Reply 
[BUG] weird Zeta function
01-18-2014, 07:17 AM (This post was last modified: 01-18-2014 07:18 AM by parisse.)
Post: #9
RE: [BUG] weird Zeta function
Zeta(n) is left as is if n>0 is odd, and computed using bernoulli numbers if n is even. You can't do any better if you want an exact answer. Of course, you can enter Zeta(d) where d is a floating point number to get an approximation.
Code:

...
    if ( (x.type==_INT_)){
      int n=x.val;
      if (!n)
    return minus_one_half;
      if (n==1)
    return plus_inf;
      if (n<0){
    if (n%2)
      return -rdiv(bernoulli(1-n),(1-n),contextptr) ;
    else
      return zero;
      }
      if (n%2)
    return symbolic(at_Zeta,x);
      else
    return pow(cst_pi,n)*ratnormal(abs(bernoulli(x),contextptr)*rdiv(pow(plus_two,n-1),factorial(n),contextptr));
    }
...
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[BUG] weird Zeta function - Tugdual - 01-12-2014, 10:38 PM
RE: weird Zeta function - Mark Hardman - 01-12-2014, 10:55 PM
RE: weird Zeta function - Tugdual - 01-13-2014, 06:55 AM
RE: [BUG] weird Zeta function - Joe Horn - 01-13-2014, 07:51 PM
RE: [BUG] weird Zeta function - Tugdual - 01-13-2014, 09:48 PM
RE: [BUG] weird Zeta function - Joe Horn - 01-16-2014, 07:23 PM
RE: [BUG] weird Zeta function - Curlytop - 01-17-2014, 09:33 PM
RE: [BUG] weird Zeta function - parisse - 01-18-2014 07:17 AM
RE: [BUG] weird Zeta function - Curlytop - 01-18-2014, 11:01 AM
RE: [BUG] weird Zeta function - Tugdual - 01-19-2014, 01:16 PM



User(s) browsing this thread: 3 Guest(s)