Problems with order parameter of 'series' method

Jens Vollinga vollinga at thep.physik.uni-mainz.de
Tue Feb 17 13:06:44 CET 2004


Hi.

The series expansion in GiNaC has now been revised in favor of
a more predictable expansion scheme. The given order parameter
now determines the last exact term in the series.

For example
> symbol eps("eps");
> ex expr = (pow(eps, 8)*pow(pow(eps,3)+ pow(eps + pow(eps,3), 2),-2))
>                     .series(eps==0, 6);
> cout << "expr: " << expr << endl;

would give
expr: 1*eps^4+(-2)*eps^5+(-1)*eps^6+Order(eps^7)

The Order function's degree corresponds not nescessarily to the
next-to-be term in the series expansion. For "simple" Taylor expansion
it does, but if the expression is (or contains) something like f^(-a),
where f is a not too simple expression, the Order function's degree
does not.

The code is momentarily only in CVS for GiNaC 1.1 (not CVS HEAD).
You are welcome to participate in testing the new code, so that
we get confident enough to put it in the next release :-)
(*Note* that this change could result in your software giving wrong
results, even if the series expansion is still mathematically correct,
due to implicit expectations you might have put on the return value
of the series method.)

Bye,
Jens



More information about the GiNaC-list mailing list