source: git/Tst/Manual/laguerre_solve.tst @ a1ef3a2

fieker-DuValspielwiese
Last change on this file since a1ef3a2 was f16c7da, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
fix the test Manual/laguerre_solve.tst to work in SW and legacy Singular CHG: in the legacy Singular (real, ??, i) is a (real) complex (!) field with parameter i (but not in SW!?) TODO: needs to be clarified in documentation!!!
  • Property mode set to 100644
File size: 627 bytes
Line 
1LIB "tst.lib"; tst_init();
2LIB "solve.lib";
3// Find all roots of an univariate polynomial using Laguerre's method:
4ring rs1= 0,(x,y),lp;
5poly f = 15x5 + x3 + x2 - 10;
6// 10 digits precision
7laguerre_solve(f,10);
8// Now with complex coefficients,
9// internal precision is 30 digits (default)
10printlevel=2;
11ring rsc= (complex,10,i),x,lp;
12poly f = (15.4+i*5)*x^5 + (25.0e-2+i*2)*x^3 + x2 - 10*i;
13list l = laguerre_solve(f);
14l;
15// check result, value of substituted polynomial should be near to zero
16// remember that l contains a list of strings
17// in the case of a different ring
18subst(f,x,l[1]);
19subst(f,x,l[2]);
20tst_status(1);$
Note: See TracBrowser for help on using the repository browser.