<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The question About the GFLIB_Asin function in NXP  in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/The-question-About-the-GFLIB-Asin-function-in-NXP/m-p/660601#M238</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The model about the GFLIB_Asin function comparing with the Asin Math Function in Matlab/Simulink:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17630i78D90661E0738D56/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As above Shown,The input paramater is 0.5 ,but the answer is difference,why?who can help us ,Thanks a lot.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Apr 2017 12:42:04 GMT</pubDate>
    <dc:creator>edenli</dc:creator>
    <dc:date>2017-04-07T12:42:04Z</dc:date>
    <item>
      <title>The question About the GFLIB_Asin function in NXP</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/The-question-About-the-GFLIB-Asin-function-in-NXP/m-p/660601#M238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The model about the GFLIB_Asin function comparing with the Asin Math Function in Matlab/Simulink:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17630i78D90661E0738D56/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As above Shown,The input paramater is 0.5 ,but the answer is difference,why?who can help us ,Thanks a lot.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 12:42:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/The-question-About-the-GFLIB-Asin-function-in-NXP/m-p/660601#M238</guid>
      <dc:creator>edenli</dc:creator>
      <dc:date>2017-04-07T12:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: The question About the GFLIB_Asin function in NXP</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/The-question-About-the-GFLIB-Asin-function-in-NXP/m-p/660602#M239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eden Li,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this question you have opened the Pandora's box of numerical methods on embedded system :-)&lt;/P&gt;&lt;P&gt;There are a lot of technical articles about numeric approximations in the field of transcendental functions. Since we are dealing with an embedded system where time matters - we need to take into account some "shortcuts" when computing a specific function. In other words, you do not want to spend a great amount of time computing a number with a high precision by introducing penalties to other critical processes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this particular case asin(x), the implementation is using the Taylor polynomial approximation for 2 different numerical intervals: [0, 0.4) with relative good precision using a specific set of polynomial coefficients and [0.4, 1) with "some" precision using a different set.&lt;/P&gt;&lt;P&gt;On the other hand, the Matlab is using the &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;FDLIBM implementation (you can get details here:&amp;nbsp;&lt;A class="link-titled" href="http://www.netlib.org/fdlibm/e_asin.c" title="http://www.netlib.org/fdlibm/e_asin.c"&gt;http://www.netlib.org/fdlibm/e_asin.c&lt;/A&gt;&amp;nbsp;) which gives much better results but the execution time is longer if implemented on MPC564x e200@150MHz.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence, the difference results depending on the value received as input between our implementation and the one from Matlab. If we compare the 2 methods over the entire range of inputs we get:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="error.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17633i387522680633840C/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.JPG" alt="error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As said before, you need to accept a trade off between speed vs. precision.&lt;/P&gt;&lt;P&gt;If we compare the output dynamically for an input sine signal [-1,1] we get the following:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17682iB69272E014FE5050/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For the reference I've included a model to replicate this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clarify your concern!&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Apr 2017 10:45:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/The-question-About-the-GFLIB-Asin-function-in-NXP/m-p/660602#M239</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2017-04-08T10:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: The question About the GFLIB_Asin function in NXP</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/The-question-About-the-GFLIB-Asin-function-in-NXP/m-p/660603#M240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi，Dumitru-daniel.popa,thank you very much for your reply,Iam very grateful for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Apr 2017 11:47:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/The-question-About-the-GFLIB-Asin-function-in-NXP/m-p/660603#M240</guid>
      <dc:creator>edenli</dc:creator>
      <dc:date>2017-04-08T11:47:08Z</dc:date>
    </item>
  </channel>
</rss>

