<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>This problem is fixed in Scilab 6.1</p>
<p>S.<br>
</p>
<div class="moz-cite-prefix">Le 06/02/2020 à 08:30, Federico Miyara
a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:75983741-0e07-d325-a439-43f803c835b8@fceia.unr.edu.ar">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br>
Dear all,<br>
<br>
Trying to implement sine integral from the series, my first
attempt <br>
<br>
y = 0<br>
N = 30;<br>
for n=0:N<br>
y = y + (-1)^n *
x.^(2*n+1)./(2*n+1)./factorial(2*n+1);<br>
end<br>
<br>
works fine for x<20. Now I want to vectorize it so the plan is
to create a polynomial and then apply horner. The coefficients are<br>
<br>
coe = (-1).^(0:N)./(1:2:2*N+1)./factorial(1:2:2*N+1)<br>
<br>
I get<br>
<br>
coe = <br>
<br>
column 1 to 6<br>
<br>
1. -0.055555555556 0.001666666667 -0.000028344671
0.000000306192 -0.000000002277<br>
<br>
column 7 to 19<br>
<br>
0.000000000012 -5.09810915D-14 1.65379838D-16 0. 0.
0. 0. 0. 0. 0. 0. 0. 0.<br>
<br>
column 20 to 31<br>
<br>
0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.<br>
<br>
From the 10-th coefficient on, the value seems to be 0. However,
coe(10) yields 9.32044813D-22<br>
<br>
Actually this is a documented behavior (it is described in hhe
format help page). But I wonder if it is advisable, since it may
be confusing.<br>
<br>
Indeed, it took me some time to discover that the coefficients
were stored as floating point. At the beginning I "believed" what
I saw and started to think which would be the best order of the
operations to avoid too small intermediate values.<br>
<br>
Is there a reason for that behavior that outweighs the
inconvenience I've mentioned? <br>
<br>
Regards,<br>
<br>
Federico Miyra<br>
<br>
<br>
<pre style="font-family:Monospaced;font-style:normal;font-size:16.0;"><span style="color:rgb(74,85,219);">
</span><span style="color:rgb(74,85,219);"></span></pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
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="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
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
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet">http://www.utc.fr/~mottelet</a>
</pre>
</body>
</html>