[GiNaC-devel] [GiNaC-list] archive/unarchive on functions with a variable number of arguments

Stefan Weinzierl weinzierl at uni-mainz.de
Fri Apr 10 15:21:55 CEST 2020


Hi,

the second argument in zeta(m,s) is supposed to be a sign, e.g. a number 
where either is_positive() or is_negative() is true, or a list of such 
signs.
For example
  zeta(5,1) = sum_{j=1}^infty 1/j^5
  zeta(5,-1) = sum_{j=1}^\infty (-1)^j/j^5
On the other hand,
  smybol x("x");
  zeta(5,x)
does not make any sense, if you want
  sum_{j=1}^infty x^j/j^5
use
  Li(5,x).
If a sign is negative, the latex output is a bar over the corresponding 
first index, e.g. zeta(5,-1) prints as \zeta(\overline{5}).
I suppose this is one reason for having the alternating Euler sums, as
the printout \zeta(\overline{5}) is shorter than \mathrm{Li}_{5}(-1).

Now, zeta2_print_latex checks only if is_negative() is true or false
and prints a bar or not.
One possibility could be to throw an exception early on, if for a sign
neither is_positive() nor is_negative() is true.
However, I have a tendency to leave this responsibility with the user.
In particular I would not add extra code to the print routines.
The print routines print out the functions correctly for legitime input,
adding extra print code to print out illegitime input seems the wrong 
thing to do to me.

  Best wishes,

    Stefan



More information about the GiNaC-devel mailing list