<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <font face="Courier New, Courier, monospace">Denis,<br>
      <br>
      Thank you. <br>
      <br>
      If this were really a general solution it would be great, since it
      improves the root accuracy by several orders, but I don't fully
      get the rationale behind this method.<br>
      <br>
      It seems you are trying to apply a variant of the Raphson-Newton
      method, aren't you? <br>
      <br>
      However, in cases like this, in which there are repeated roots,
      the derivative approaches zero as you get closer to the root, but
      the polynomial goes to zero faster. <br>
      <br>
      In that case the factor 4 may imlpy that the next approximation
      gets closer to the actual root. But this is speculation. It  
      could also overshoot.<br>
      <br>
      Regards,<br>
      <br>
      Federico Miyara<br>
      <br>
      <br>
    </font><br>
    <div class="moz-cite-prefix">On 10/01/2019 10:32, CRETE Denis wrote:<br>
    </div>
    <blockquote
      cite="mid:c3f724bb53d54512918555d30053249f@thalesgroup.com"
      type="cite">
      <pre wrap="">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 [<a class="moz-txt-link-freetext" href="mailto:users-bounces@lists.scilab.org">mailto:users-bounces@lists.scilab.org</a>] De la part de Federico Miyara
Envoyé : jeudi 10 janvier 2019 00:32
À : <a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
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.
<a class="moz-txt-link-freetext" href="https://www.avast.com/antivirus">https://www.avast.com/antivirus</a>

_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>


</pre>
    </blockquote>
    <br>
  <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /> <table style="border-top: 1px solid #D3D4DE;">
        <tr>
      <td style="width: 55px; padding-top: 18px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
                <td style="width: 470px; padding-top: 17px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Libre de virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>           </td>
        </tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>