|
D.8.3.1 laguerre_solve
Procedure from library solve.lib (see solve_lib).
- Usage:
- laguerre_solve(f [, m, l, n, s] ); f = polynomial,
m, l, n, s = integers (control parameters of the method)
m: precision of output in digits ( 4 <= m), if basering is not ring of
complex numbers;
l: precision of internal computation in decimal digits ( l >=8 )
only if the basering is not complex or complex with smaller precision;
n: control of multiplicity of roots or of splitting of f into
squarefree factors
n < 0, no split of f (good, if all roots are simple)
n >= 0, try to split
n = 0, return only different roots
n > 0, find all roots (with multiplicity)
s: s != 0, returns ERROR if | f(root) | > 0.1^m (when computing in the
current ring)
( default: m, l, n, s = 8, 30, 1, 0 )
- 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
entries of the result are of type
string: if the basering is not complex,
number: otherwise.
- 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.8924637479
==> [2]:
==> (-0.7392783383+i*0.5355190078)
==> [3]:
==> (-0.7392783383-i*0.5355190078)
==> [4]:
==> (0.2930464644-i*0.9003002396)
==> [5]:
==> (0.2930464644+i*0.9003002396)
// 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.8557376852+i*0.3557664188)
==> [2]:
==> (-0.5462895588-i*0.6796668873)
==> [3]:
==> (0.04588498039+i*0.9133296179)
==> [4]:
==> (0.5037408279-i*0.8058051828)
==> [5]:
==> (0.8524014357+i*0.2163760334)
// check result, value of substituted polynomial 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
|
|