halve(e,Q)={
x_0=Q[1];
Half=[];
f=x^4-e.b4*x^2-2*e.b6*x-e.b8-x_0*(4*x^3+e.b2*x^2+2*e.b4*x+e.b6);
g=factor(f);
v=[];
for(i=1,#g~,
if(poldegree(g[i,1])==1,
v=concat(v,-polcoeff(g[i,1],0)/polcoeff(g[i,1],1));
);
);
for(i=1,#v~,
x=v[i];
y=ellordinate(e,x)[1];
if(ellpow(e,[x,y],2)==Q,
Half=concat(Half,[[x,y]]);
);
if(ellpow(e,[x,-1*y],2)==Q,
Half=concat(Half,[[x,-1*y]]);
);
);
}
It works! But there is a problem, when I use
e=ellinit([0,0,0,-1563056672958141,0]);
P_1=[48408867,194361588954];
P_2=[48432972,194700535386];
Q=elladd(e,ellpow(e,P_1,2),ellpow(e,P_2,3));
halve(e,Q);
Then Half will be [], as I want. but when I use
Q1=ellpow(e,Q,2)
halve(e,Q1)
Q1=Half[1]
halve(e,Q1);
Pari doesn't work. But we now Q1=Q! Why???????Is there an algorithm which computes (1/2)Q?