From 0a2231e31d5d0eb780ebb7ffb8d0628c78b74248 Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Tue, 6 Jan 2004 18:38:10 +0000 Subject: [PATCH] Fixed bug in harmonic polylogs for complex arguments with positive imaginary part. --- ginac/inifcns_nstdsums.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ginac/inifcns_nstdsums.cpp b/ginac/inifcns_nstdsums.cpp index 55520e34..3b7fc556 100644 --- a/ginac/inifcns_nstdsums.cpp +++ b/ginac/inifcns_nstdsums.cpp @@ -46,7 +46,7 @@ */ /* - * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1088,6 +1088,10 @@ REGISTER_FUNCTION(S, // anonymous namespace for helper functions namespace { + +// regulates the pole (used by 1/x-transformation) +symbol H_polesign("IMSIGN"); + // convert parameters from H to Li representation // parameters are expected to be in expanded form, i.e. only 0, 1 and -1 @@ -1601,7 +1605,7 @@ struct map_trafo_H_1overx : public map_function } if (allthesame) { map_trafo_H_mult unify; - return unify((pow(H(lst(1),1/arg).hold() + H(lst(0),1/arg).hold() - I*Pi, parameter.nops()) + return unify((pow(H(lst(1),1/arg).hold() + H(lst(0),1/arg).hold() + H_polesign, parameter.nops()) / factorial(parameter.nops())).expand()); } } @@ -1928,6 +1932,11 @@ static ex H_evalf(const ex& x1, const ex& x2) // x -> 1/x map_trafo_H_1overx trafo; res *= trafo(H(m, xtemp)); + if (cln::imagpart(x) <= 0) { + res = res.subs(H_polesign == -I*Pi); + } else { + res = res.subs(H_polesign == I*Pi); + } } // simplify result -- 2.44.0