[GiNaC-devel] series() errors with divide by zero

Richard B. Kreckel kreckel at ginac.de
Mon Jun 27 08:27:59 CEST 2011


Hi!

On 06/27/2011 07:09 AM, J Sage wrote:
>     ...
>       series(sqrt(x),x,0,3)
>         = series(sqrt(y^2),y,0,3*2)
>         = y
>         = x^(1/2).
>
>     Note that the member functions degree() and ldegree() currently
>     return int, so this would have to be generalized somehow, when
>     implementing Puiseux series directly in GiNaC.
>
>     Bye
>       -richy.
>     --
>     Richard B. Kreckel
>     <http://www.ginac.de/~kreckel/ <http://www.ginac.de/%7Ekreckel/>>
>
>
> Actually, ginac cannot do a series on x^n or on sqrt(x^2).  Here's the
> ginsh output:
>
>  > series(x^n,x,1);
> (0^n)+Order(x)
>  > series(x^n,x,2);
> power::eval(): division by zero
>  > series(sqrt(x^2),x,3);
> power::eval(): division by zero

Oh, you're so right! Actually, that's because the result of 
series(sqrt(x^2),x==0,3) is not necessarly x: it could just as well be 
-x. The presence of the branch point makes it more tricky.

Sorry for not being able to help.

Bye
   -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the GiNaC-devel mailing list