<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Monospaced;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"Préformaté HTML Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
span.PrformatHTMLCar
        {mso-style-name:"Préformaté HTML Car";
        mso-style-priority:99;
        mso-style-link:"Préformaté HTML";
        font-family:"Courier New";
        mso-fareast-language:FR;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1228345496;
        mso-list-type:hybrid;
        mso-list-template-ids:828263506 -180042942 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l0:level1
        {mso-level-start-at:13;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D">Stephane pointed out on the issue : after calculation and prior to the Acos one, some values were “1.0000000000000002220446” leading to “acos = 2.107D-08i” ; in addition he suggested
 me to use something like “acos(max(-1,min(1,-1.0000000000000002220446)))” or “acos(max(-1,min(1,1.0000000000000002220446)))” … very smart
</span><span lang="EN-US" style="font-size:12.0pt;font-family:Wingdings;color:#1F497D">J</span><span lang="EN-US" style="font-size:12.0pt;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D">Paul<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p></o:p></p>
<p><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:gray">EXPORT CONTROL :
<br>
</span></i></b><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Cet email ne contient pas de données techniques<br>
This email does not contain technical data</span></b><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:FR">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:FR">
 users [mailto:users-bounces@lists.scilab.org] <b>De la part de</b> Stéphane Mottelet<br>
<b>Envoyé :</b> mardi 29 janvier 2019 16:59<br>
<b>À :</b> users@lists.scilab.org<br>
<b>Objet :</b> Re: [Scilab-users] [EXTERNAL] Re: acos leads to complex values<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">It is the same if x is slightly > 1:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">--> x=1+%eps<br>
 x  = <br>
<br>
   1.<br>
<br>
<br>
--> acos(x)<br>
 ans  =<br>
<br>
   2.107D-08i <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">--> format(25); x <br>
 x  = <br>
<br>
   1.0000000000000002220446 <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Le 29/01/2019 à 16:55, Carrico, Paul a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D">When I scroll to the list, the lowest (positive) value is 8.4<sup>E</sup>-08 (works fine) and no %eps .</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D">How Can I check if %eps is in?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:FR">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:FR"> users
 [<a href="mailto:users-bounces@lists.scilab.org">mailto:users-bounces@lists.scilab.org</a>]
<b>De la part de</b> Stéphane Mottelet<br>
<b>Envoyé :</b> mardi 29 janvier 2019 16:50<br>
<b>À :</b> <a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<b>Objet :</b> [EXTERNAL] Re: [Scilab-users] acos leads to complex values</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">Le 29/01/2019 à 16:45, Carrico, Paul a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Dear All</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I spent some time in looking for a mistake in my code ; finally I’ve found that the ACOS of a real vector leads to some complex values (???)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<pre><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">acos</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif"">Scar_P</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#FFAA00">:</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">./</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif""> CM_x_CN</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#FFAA00">:</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">))</span><o:p></o:p></pre>
</blockquote>
<p>Are your really sure, because we may have<o:p></o:p></p>
<p>--> x=-1-%eps <br>
 x  = <br>
<br>
  -1.<br>
<br>
<br>
--> acos(x)<br>
 ans  =<br>
<br>
   3.1415927 - 2.107D-08i<o:p></o:p></p>
<p>S.<o:p></o:p></p>
<p> <o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span lang="ES" style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><o:p></o:p></pre>
<p class="MsoNormal"><span lang="EN-US">(the formula worked so far)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I checked that the input values are correct:</span><o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span><![endif]><span lang="EN-US">Comprised between [-1; 1] using MIN and MAX</span><o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span><![endif]><span lang="EN-US">Composed only of real values using ISREAL (all the vectors are correct)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thus I do not understand why complex values appear ?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">May it come from the vectorization ?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Paul</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><br>
<br>
<br>
</span><o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>users mailing list<o:p></o:p></pre>
<pre><a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><o:p></o:p></pre>
<pre><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__antispam.utc.fr_proxy_2_c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy_urldefense.proofpoint.com_v2_url-3Fu-3Dhttps-2D3A-5F-5Fantispam.utc.fr-5Fproxy-5F1-5Fc3RlcGhhbmUubW90dGVsZXRAdXRjLmZy-5Flists.scilab.org-5Fmailman-5Flistinfo-5Fusers-26d-3DDwMG-2Dg-26c-3D0hKVUfnuoBozYN8UvxPA-2Dw-26r-3D4TCz-2D-2D8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo-26m-3DrN8DsnGalih7CBHModSb9evOi3rmZRFFYcBFHTC71gU-26s-3DRgKyyESZ7uSTxlU7V0nR42XTJybjC0Ar5fDcrouQThE-26e-3D&d=DwMG-g&c=0hKVUfnuoBozYN8UvxPA-w&r=4TCz--8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo&m=gwQYJePMwf66Qkf2heyo1UqhkxA31D8XuF0dNsmnvOg&s=WFlVbPNytDi1qDLq35P7qeSGnwD6PCRMRL4tKAtS9no&e=">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre>
</blockquote>
<p> <o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Stéphane Mottelet<o:p></o:p></pre>
<pre>Ingénieur de recherche<o:p></o:p></pre>
<pre>EA 4297 Transformations Intégrées de la Matière Renouvelable<o:p></o:p></pre>
<pre>Département Génie des Procédés Industriels<o:p></o:p></pre>
<pre>Sorbonne Universités - Université de Technologie de Compiègne<o:p></o:p></pre>
<pre>CS 60319, 60203 Compiègne cedex<o:p></o:p></pre>
<pre>Tel : +33(0)344234688<o:p></o:p></pre>
<pre><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__antispam.utc.fr_proxy_2_c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy_urldefense.proofpoint.com_v2_url-3Fu-3Dhttp-2D3A-5F-5Fwww.utc.fr-5F-2D7Emottelet-26d-3DDwMG-2Dg-26c-3D0hKVUfnuoBozYN8UvxPA-2Dw-26r-3D4TCz-2D-2D8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo-26m-3DrN8DsnGalih7CBHModSb9evOi3rmZRFFYcBFHTC71gU-26s-3D34gC0H3RYWxwcKp7fr4bR5XFfy1acxO72YI9AYJJFhA-26e-3D&d=DwMG-g&c=0hKVUfnuoBozYN8UvxPA-w&r=4TCz--8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo&m=gwQYJePMwf66Qkf2heyo1UqhkxA31D8XuF0dNsmnvOg&s=Z35_aByfKODglW8yDddkINmGp0XVNG2FnCHehVQ_xic&e=">http://www.utc.fr/~mottelet</a><o:p></o:p></pre>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>users mailing list<o:p></o:p></pre>
<pre><a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><o:p></o:p></pre>
<pre><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__antispam.utc.fr_proxy_1_c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy_lists.scilab.org_mailman_listinfo_users&d=DwMG-g&c=0hKVUfnuoBozYN8UvxPA-w&r=4TCz--8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo&m=gwQYJePMwf66Qkf2heyo1UqhkxA31D8XuF0dNsmnvOg&s=DUbP9Ae1PnplwVsabbz8k-6A-ZRz3dLu7e5o5GI9yqU&e=">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre>
</blockquote>
<p><o:p> </o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Stéphane Mottelet<o:p></o:p></pre>
<pre>Ingénieur de recherche<o:p></o:p></pre>
<pre>EA 4297 Transformations Intégrées de la Matière Renouvelable<o:p></o:p></pre>
<pre>Département Génie des Procédés Industriels<o:p></o:p></pre>
<pre>Sorbonne Universités - Université de Technologie de Compiègne<o:p></o:p></pre>
<pre>CS 60319, 60203 Compiègne cedex<o:p></o:p></pre>
<pre>Tel : +33(0)344234688<o:p></o:p></pre>
<pre><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.utc.fr_-7Emottelet&d=DwMG-g&c=0hKVUfnuoBozYN8UvxPA-w&r=4TCz--8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo&m=gwQYJePMwf66Qkf2heyo1UqhkxA31D8XuF0dNsmnvOg&s=gdmVN-2pjNdKfA0yL_jVwCc5aMSV0eTSd7Qdt4ClIBo&e=">http://www.utc.fr/~mottelet</a><o:p></o:p></pre>
</div>
</body>
</html>