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

spielwiese
Last change on this file since 894057 was 894057, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
  • Property mode set to 100644
File size: 624 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= (real,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.