default(realprecision,38);
s=x+x^2+O(x^5)
f=[atan,asin,acos,cosh,sinh,tanh,cotanh,acosh,asinh,atanh];
{
for (i=1,#f,
  print(f[i](s));
  print(f[i](O(x^5)));
  print(f[i]([Pol(1)]));
)
}
O(x^-2)
O(1/x^2)
trace(I*x+1+O(x^2))
norm(I*x+1+O(x^2))
a=Ser(vector(200,i,i));
a^2 == a*(a+1) - a \\ test RgX_mullow, RgX_sqrlow
3+O(1)
serreverse(x/2+O(x^2))
serreverse(tan(x)/2)

iferr(sqrt(x+1/y),E,E)

\\ #2063
((y^-3+O(y))*x+1)/x

s = 1/x + x + 2*x^2 + O(x^3);
serchop(s)
serchop(s, 2)
serchop(s, 100)
s = Mod(0,3) + x + O(x^2)
serchop(s)
serchop(Mod(0,3)+O(x^2))
serchop(Mod(0,3)*x+O(x^2))
s = Mod(0,3)+O(x); s * s
s = 1 + O(x);
0 * s
[Pol(0) * s, Pol(0) / s]
[Mod(0,3) * s, Mod(0,3) / s]
[Pol(Mod(0,3)) * s, Pol(Mod(0,3)) / s]
[0. * s, 0. / s]

Ser(Qfb(1,2,3))
Ser(Qfb(1,2,3),, 5.5)
Ser(Qfb(1,2,-5))
Ser(Qfb(1,2,-5),y,2)
Ser([1,2,3], y, 5)
Ser([1,2,3]~, y, 5)
Ser([],,3)
Ser(Vecsmall([1,2,3]), y, 5)
Ser(x+O(x^2),,3)
Ser(O(x^2),,3)
Ser(x+x^2+x^3+O(x^4),,2)
Ser(x^2+x^3,x,0)
Ser(1+x,x,0)
Ser(1/(x+1),x,0)
Ser(1/x,x,0)
Ser(1/y,x,0)

Ser(x+y+O(x^2),x)
Ser(x+y+O(x^2),y)
s = Ser(Mod(0,7))
Ser(Mod(1,7)*(x^4+x^2), x,3)
s+O(x^16)
s+Mod(1,7)
s+Mod(1,7)*x
s/x
s'
deriv(s,y)
trace(s)
round(s)
round(s,&e)
lift(s)
lift(s,x)
liftint(s)
O(x^2)*0
deriv(Mod(2,4)*x^2+O(x^3))
x^3*(1+O(y^2))
Mod(1,3)*x^3*(1+O(y^2))
O(x)/2
s = O(3^2)+O(x);
s/3
s/2
s*3
(1+O(x))^2
1/(x+0.)+O(x^2)
1/(x^2+0.)+O(x^2)
[1==O(x), 1==O(x^0), 1==O(x^-1), 1 == 0.+O(x), 1 == 0.+O(1)]
[-1==O(x), -1==O(x^0), -1==O(x^-1), -1 == 0.+O(x), -1 == 0.+O(1)]
[2==O(x), 2==O(x^0), 2==O(x^-1), 2 == 0.+O(x), 2 == 0.+O(1)]

a=Mod(3,9) + O(x^2); b=Mod(3,9) + O(x^2); a*b

a=1./x+O(1);a-a
a=1/x+O(1);a-a
a=Mod(1,2)/x+O(1);a-a

Mod(0,5) * O(x^1)
Mod(1,5) * O(x^0)
O(x^0) / Mod(1,5)

subst(1+O(x),x,y)
subst(1+x+O(x^2),x,y^2)
O(1)==O(x)
O(1)==x
O(x)==1
1+O(x)==O(x)
Ser([Mod(0,2)]) == 1
S = Ser([Mod(0,2)]) / x; S == 1
S + 1
O(x^-2)/(4+O(11))
O(x^-2)+(x+O(23^0))/x^3
O(x^-1)/(1+O(23)+I)
O(x^-2)/(1+O(23)+I)
serconvol(O(x^-2),O(23)*O(x^-2))

\\ #2364
f=Mod(y^4+y/t^3+1/t^6+1/t^12,2); s=t^-1+t^-3;
subst(f,y,s)

\\ #2188
S = x+O(x^2);T = O(y) + x + O(x^2); T==S
S = x+O(x^2);T = O(y) + x + x^2 + O(x^3); T==S
S = x+O(x^2);T = O(y) + O(x); T==S
S = x+x^2+ O(x^3);T = O(y) + x + O(x^2); T==S

exp(x+O(x^200))*exp(-x+O(x^200))
exp(x+O(x^200))^2==exp(2*x+O(x^200))

subst(1+x^3+O(x^6),x,x+O(x^4))
subst(1+x^2+O(x^6),x,x+O(x^3))
subst(1+x^3+x^4+O(x^6),x,x+x^2+O(x^3))

subst(x^2+O(x^3),x,0*x)
subst(x^2+O(x^3),x,Mod(0,3)*x)
subst(x^2+O(x^3),x,O(3)*x)
subst(1+x+O(x^2),x,0*x)
subst(1+x+O(x^2),x,Mod(0,3)*x)
subst(1+x+O(x^2),x,O(3)*x)
subst(1+x^2+O(x^3),x,z)
subst(1+x^2+y^2+O(x^3),x,z)

laurentseries(x->sin(x)/x^2, 3)
laurentseries(x->sin(x)/x^2, 3, t)
laurentseries(x->(cos(x)-1)/x)

f=1+4*t^2+36*t^4+O(t^6);
g=q-4*q^3+14*q^5+O(q^7); subst(f,t,g)

f=t^32000+O(t^32001); g=q*Ser(vector(32000,i,1),q); h=subst(f,t,g)
f=q^32000+O(q^32001); h=subst(f,q,g)

exp(1.*x + O(x^2))
exp(.*x)
1/(0.+x)+O(x^2)
polcoef(0.+O(x),0)
polcoef(Mod(0,2)+O(x),0)
z=(Mod(2,17)*v1^-2+O(v1^-1))/(Mod(5,12)*v1^-4+O(v1));
z==1
z-1

\\ Errors. Keep at end of file
polcoef(0.+O(x),1)
polcoef(Mod(0,2)+O(x),1)
subst(x^-1+O(x),x,Mod(0,3))
subst(O(x^-1),x,Mod(0,3))
subst(x^-1+O(x),x,0*x)
subst(O(x^-1),x,0*x)
Ser(1/x,y)
Ser(x,y)
Ser([x],y)
Ser(x,, -5)
Ser("")
O(13^-5)/Mat(Mod(2,26)*y*x+(Mod(1,2)*y^-1+O(y^3)))
laurentseries(1)
laurentseries((x,y)->1)
O(x) / Mod(0,5)
O(x) / O(y)
O(y) / O(x)
