From 270969d036bd27a8454442501f8eb241fa66c9b2 Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Wed, 12 Oct 2005 18:05:03 +0000 Subject: [PATCH] Changed the conditions for the application of the (1-x)/(1+x) transformation, which caused an endless recursion for certain arguments around +-I. --- ginac/inifcns_nstdsums.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ginac/inifcns_nstdsums.cpp b/ginac/inifcns_nstdsums.cpp index 3920bf9e..88f0fa4e 100644 --- a/ginac/inifcns_nstdsums.cpp +++ b/ginac/inifcns_nstdsums.cpp @@ -2839,10 +2839,16 @@ static ex H_evalf(const ex& x1, const ex& x2) } } - // since the transformations produce a lot of terms, they are only efficient for - // argument near one. - // no transformation needed -> do summation - if (cln::abs(x) < 0.95) { + // check for the applicability of transformations + // + // first condition: since the transformations produce a lot of terms, + // they are only efficient for argument near the boundary |x| = 1, then no + // transformation is needed + // second condition: veto for region around +-I to avoid endless recursion + // with the (1-x)/(1+x) transformation. 1.198 is sqrt(1.4142) is the + // boundary of the problematic transformation. + // + if (cln::abs(x) < 0.95 || (cln::abs(x) < 1 && cln::abs(x-1) >= 1.198)) { lst m_lst; lst s_lst; ex pf; -- 2.44.0