//======================================================================== //========================= real roots ================================== //======================================================================== int i; ring R=0,x,dp; poly p=x+1; for(i=2;i<=20;i++){p=p*(x+i);} p=p+1/2^23*x19; p; LIB"solve.lib"; list L=solve(p,1000,0,1000,"nodisplay"); def SS=L[1]; setring SS; SOL; setring R; LIB "rootsur.lib"; nrroots(p); kill R; //---------------------- A problem from economy ------------------------- /* ring R = 0,x(1..22),dp; ideal I = -1+x(1)^5*x(4)*x(13), -1+x(2)^5*x(4)*x(14), -1+x(3)^5*x(4)*x(15), -1+x(5)^3*x(8)*x(13), -1+x(6)^3*x(8)*x(14), -1+x(7)^3*x(8)*x(15), -1+x(9)^4*x(12)*x(13), -1+x(10)^4*x(12)*x(14), -1+x(11)^4*x(12)*x(15), 5+2*x(16)-x(1)*x(13)-x(2)*x(14)-x(3)*x(15), 3+5*x(16)-x(5)*x(13)-x(6)*x(14)-x(7)*x(15), (x(1)+x(5)+x(9))^3-x(17)^2*x(18), (x(2)+x(6)+x(10))^2-x(19)*x(20), (x(3)+x(7)+x(11))^2-4*x(21)*x(22), x(17)+x(19)+x(21)-10, x(18)+x(20)+x(22)-10, 8*x(13)^3*x(18)-27*x(16)^3*x(17), x(13)^3*x(17)^2-27*x(18)^2, x(14)^2*x(20)-4*x(16)^2*x(19), x(14)^2*x(19)-4*x(20), x(15)^2*x(22)-x(16)^2*x(21), x(15)^2*x(21)-x(22); [1]: 1.3052038473760073256623306244817723267588 [2]: 1.3015615481354881445308859481238941838024 [3]: 1.4951016092706294276032406269979249042168 [4]: 0.1177781622069377483217973542947036297245 [5]: 1.5952142884773910674527976400006334736637 [6]: 1.587801855753990046379741047911189107525 [7]: 2.000504981126595096852145097851486893749 [8]: 0.1099004338442310860992554824336595075249 [9]: 1.0036890295014795948077757476240053622462 [10]: 1.0001891358877747542338111572455677741369 [11]: 1.189432036746165160621093881016603209741 [12]: 0.4396021328049473249197481732025006287596 [13]: 2.2415245518985307429141711235276676775061 [14]: 2.2730640719635375307986935544224207811234 [15]: 1.1365320359817687653993467772112103905617 [16]: 1.2917050688128645316413842694628547496947 [17]: 4.5165893647991132091724493807295711813949 [18]: 2.9170506881286453164138426946285474969468 [19]: 3.4222990788089370518402204519976365817761 [20]: 4.4206010670911009313877589338804922465161 [21]: 2.061111556391949738987330167272792236829 [22]: 2.6623482447802537521983983714909602565371 */ //======================================================================== //================== genus of a curve ======================== //======================================================================== //Needs: Puiseux expansion,Primary decomposition,Field extensions //Newton polygon. LIB "normal.lib"; //Rob Koelman ring r=0,(x,y,z),dp;//genus 10 with 26 cusps ideal I= 761328152*x^6*z^4-5431439286*x^2*y^8+2494*x^2*z^8+228715574724*x^6*y^4+ 9127158539954*x^10-15052058268*x^6*y^2*z^2+3212722859346*x^8*y^2- 134266087241*x^8*z^2-202172841*y^8*z^2-34263110700*x^4*y^6-6697080*y^6*z^4- 2042158*x^4*z^6-201803238*y^10+12024807786*x^4*y^4*z^2-128361096*x^4*y^2*z^4+ 506101284*x^2*z^2*y^6+47970216*x^2*z^4*y^4+660492*x^2*z^6*y^2- z^10-474*z^8*y^2-84366*z^6*y^4; genus(I); //====================================================== // Groebner basis can be complicated //====================================================== option(redSB); ring r=0,(x,y),lp; ideal i=5x4+3x2y9+y9,9x3y8+9xy8+11y10; ideal j=std(i); simplify(j,1);