|
D.7.2.1 laguerre_solve
Procedure from library solve.lib (see section solve_lib).
- Usage:
laguerre_solve(f [, m, l, n, s] ); f = polynomial,
m, l, n, s = integers (control parameters of the method)
- Assume:
f is a univariate polynomial;
basering has characteristic 0 and is either complex or without
parameters.
- Return:
list of (complex) roots of the polynomial f, depending on n. The
result is of type
- Note:
If printlevel >0: displays comments ( default = 0 ).
If s != 0 and if the procedure stops with ERROR, try a higher
internal precision m.
Example:
LIB "solve.lib";
// Find all roots of an univariate polynomial using Laguerre's method:
ring rs1= 0,(x,y),lp;
poly f = 15x5 + x3 + x2 - 10;
// 10 digits precision
laguerre_solve(f,10);
→ [1]:
→ (0.2930464644-i*0.9003002396)
→ [2]:
→ (0.2930464644+i*0.9003002396)
→ [3]:
→ (-0.7392783383-i*0.5355190078)
→ [4]:
→ (-0.7392783383+i*0.5355190078)
→ [5]:
→ 0.8924637479
// Now with complex coefficients,
// internal precision is 30 digits (default)
printlevel=2;
ring rsc= (real,10,i),x,lp;
poly f = (15.4+i*5)*x^5 + (25.0e-2+i*2)*x^3 + x2 - 10*i;
list l = laguerre_solve(f);
→ //BEGIN laguerre_solve
→ //control: complex ring with precision 30
→ //working in: ring lagc=(complex,30,30),x,lp;
→ // polynomial has complex coefficients
→ //split in working ring:
→ // split without result
→ //END laguerre_solve
l;
→ [1]:
→ (0.04588498039+i*0.9133296179)
→ [2]:
→ (0.5037408279-i*0.8058051828)
→ [3]:
→ (-0.5462895588-i*0.6796668873)
→ [4]:
→ (0.8524014357+i*0.2163760334)
→ [5]:
→ (-0.8557376852+i*0.3557664188)
// check result, value of substituted poly should be near to zero
// remember that l contains a list of strings
// in the case of a different ring
subst(f,x,l[1]);
→ 0
subst(f,x,l[2]);
→ 0
|