Hi,
This behavior has already been discussed here :
http://bugzilla.scilab.org/show_bug.cgi?id=15349
S.
Le 10/01/2019 à 14:32, CRETE Denis a écrit :
Hello,
I tried this correction to the initial roots z:
z-4*(1+z).^4 ./([ones(z),z,z.^2,z.^3]*(C(2:5).*(1:4))')
ans =
-1. - 1.923D-13i
-1. + 1.189D-12i
-1. - 1.189D-12i
-1. - 1.919D-13i
// Evaluation of new error, (and defining Z as the intended root, i.e. here
Z=-1):
z2=z-4*(z-Z).^4 ./([ones(z),z,z.^2,z.^3]*(C(2:5).*(1:4))')
z2 - Z
ans =
2.233D-08 - 1.923D-13i
-2.968D-08 + 1.189D-12i
-2.968D-08 - 1.189D-12i
2.131D-08 - 1.919D-13i
The factor 4 in the correction is a bit obscure to me, but it seems to work
also for R=(3+p)^4, again with an accuracy on the roots of a ~2E-8.
HTH
Denis
-----Message d'origine-----
De : users [mailto:[email protected]] De la part de Federico Miyara
Envoyé : jeudi 10 janvier 2019 00:32
À : [email protected]
Objet : [Scilab-users] improve accuracy of roots
Dear all,
Consider this code:
// Define polynomial variable
p = poly(0, 'p', 'roots');
// Define fourth degree polynomial
R = (1 + p)^4;
// Find its roots
z = roots(R)
The result (Scilab 6.0.1) is
z =
-1.0001886
-1. + 0.0001886i
-1. - 0.0001886i
-0.9998114
It should be something closer to
-1.
-1.
-1.
-1.
Using these roots
C = coeff((p-z(1))*(p-z(2))*(p-z(3))*(p-z(4)))
yield seemingly accurate coefficients
C =
1. 4. 6. 4. 1.
but
C - [1 4 6 4 1]
shows the actual error:
ans =
3.775D-15 1.243D-14 1.155D-14 4.441D-15 0.
This is acceptable for the coefficients, but the error in the roots is
too large. Somehow the errors cancel out when assembling back the
polynomial but each individual zero should be closer to the theoretical
value
Is there some way to improve the accuracy?
Regards,
Federico Miyara
---
El software de antivirus Avast ha analizado este correo electrónico en busca de
virus.
https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.avast.com/antivirus
_______________________________________________
users mailing list
[email protected]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users