[GiNaC-devel] Problem with power series

Stefan Weinzierl stefanw at thep.physik.uni-mainz.de
Wed May 9 14:35:21 CEST 2007


Gentlemen,

I came across a small problem, when calculating series expansions.
The following code hangs, when attempting to compute the expansion:

#include <iostream>
#include <ginac/ginac.h>

using namespace std;
using namespace GiNaC;

int main()
{
  symbol x("x");

  ex e1 = pow(2,x)*( 1/x*(-(1+x)/(1-x)) + (1+x)/x/(1-x));

  cout << e1 << endl;
  cout << e1.expand() << endl;
  cout << e1.series(x,1) << endl;
}

I tried it with GiNaC 1.3.7 as well as 1.3.1 and 1.3.0.
e1 is actually a complicated zero, and the correct answer should we
O(x).

 Best wishes,

      Stefan




More information about the GiNaC-devel mailing list