order=$ORder
!bound order between integer 2 and 8 default 3
!bound center within 0,1 default 0

!read types/.index
types=!listintersect $types and $exolist
!default types=$exolist

range=9
random1=(random($[2*$range+1])-$range)
random2=((random($range)+1)*(random(2)*2-1))
a0=$random1
b0=$random1

!if $center=0
 x0=0
!else
 x0=!randitem -5,-4,-3,-2,-1,1,2,3,4,5
!endif
!distribute item 0,$x0,$x0,$x0 into shift,y0,z0,t0

type=!randitem $types
!read types/$type
sorder=$[$order+$shift]

pari_header=vec1=concat([$a0],vector($sorder,i,$random2));\
	vec2=concat([$b0],vector($sorder,i,$random2));\
	ser1=Ser(vec1);ser2=Ser(vec2);\
	poly1=$A0 Pol(ser1);poly2=$B0 Pol(ser2);\
	$parisrc\
	poly3=$C0 Pol(ser3)

pariout=!exec pari print(ser1)\
	print(ser2+O(x^$[$order+1]))\
	print(ser3)\
	print(poly1)\
	print(poly2)\
	print(poly3)\
	print(vector($sorder+1,i,polcoeff(poly1,i-1)))\
	print(vector($sorder+1,i,polcoeff(poly2,i-1)))\
	print(vector($order+1,i,polcoeff(poly3,i-1)))

!distribute lines $pariout into ser1,ser2,ser3,poly1,poly2,poly3,vec1,vec2,vec3

!if $center!=0
 ser1=!mathsubst x=(x-$x0) in $ser1
 ser2=!mathsubst x=(x-$y0) in $ser2
 ser3=!mathsubst x=(x-$z0) in $ser3
 rest=!htmlmath (x-$t0)^$[$order+1]
!else
 rest=!htmlmath x^$[$order+1]
!endif
ser1=!htmlmath $A0$ser1
ser2=!htmlmath $B0$ser2
ser3=!htmlmath $C0$ser3
polh1=!htmlmath $poly1
polh2=!htmlmath $poly2
polh3=!htmlmath $poly3

!if $given!=$empty
 !read present
!else
 present=$present
!endif

status=waiting
replycnt=0
wims_module_log=$cmd: $type order $order, center=$center

