Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //define basering as follow
- //ring GZ=(0,i),x,dp;
- //minpoly=i2+1;
- //setring GZ;
- proc re(poly f)
- {
- ring h=(0,i),x,dp;
- minpoly = i;
- setring h;
- poly b=imap(GZ,f);
- setring GZ;
- return (imap(h,b));
- }
- proc im(poly f)
- {
- return ((f-re(f))*(-i));
- }
- proc conj(poly f)
- {
- return (re(f)-im(f)*i);
- }
- proc abs(poly f)
- {
- return(re(f)^2+im(f)^2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement