<?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 Oops, strike 1), the r = diff in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143972#M137992</link>
    <description>&lt;P&gt;Oops, strike 1), the r = diff... should be sufficient to take into consideration the magnitudes verses precision.&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
    <pubDate>Sat, 11 May 2019 15:29:53 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2019-05-11T15:29:53Z</dc:date>
    <item>
      <title>new versions of svml give different results that older versions for many math functions</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143968#M137988</link>
      <description>&lt;P&gt;Consider the following code as an example&lt;/P&gt;&lt;P&gt;version 14.0 of svml calculates the sin(90) as 1 while latest svml&amp;nbsp; calculates it as 0.99999.&lt;/P&gt;&lt;P&gt;This can obviously create problems if subsequent calculations rely on the sin result&amp;nbsp; to be exactly one.&lt;/P&gt;&lt;P&gt;Could someone please advice what is the best way to deal with these roundoff errors in newer versions of the libraries.&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;program sum
    real angle_degrees(100)
    real angle_radians(100)
    pi = 4 * atan (1.0_4)

    pi180 = pi/180.0

    angle_degrees = 90

    angle_radians = sin(angle_degrees * pi180 )

    print * , angle_radians

end program sum
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 12:34:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143968#M137988</guid>
      <dc:creator>gn164</dc:creator>
      <dc:date>2019-05-11T12:34:30Z</dc:date>
    </item>
    <item>
      <title>This is the usual issue with</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143969#M137989</link>
      <description>&lt;P&gt;This is the usual issue with floating point numbers. For floating point numbers you should never test for exact equality&lt;/P&gt;&lt;P&gt;but for equality within a given precision. E.g. something like the code below. Check the documentation on the flags for the numerical models in order&lt;/P&gt;&lt;P&gt;to look what the exact behavior is.&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;  elemental function nearly_equal_real (a, b, abs_smallness, rel_smallness) result (r)
    logical :: r
    real(default), intent(in) :: a, b
    real(default), intent(in), optional :: abs_smallness, rel_smallness
    real(default) :: abs_a, abs_b, diff, abs_small, rel_small
    abs_a = abs (a)
    abs_b = abs (b)
    diff = abs (a - b)
    ! shortcut, handles infinities and nans
    if (a == b) then
       r = .true.
       return
    else if (ieee_is_nan (a) .or. ieee_is_nan (b) .or. ieee_is_nan (diff)) then
       r = .false.
       return
    end if
    abs_small = tiny_13; if (present (abs_smallness)) abs_small = abs_smallness
    rel_small = tiny_10; if (present (rel_smallness)) rel_small = rel_smallness
    if (abs_a &amp;lt; abs_small .and. abs_b &amp;lt; abs_small) then
       r = diff &amp;lt; abs_small
    else
       r = diff / max (abs_a, abs_b) &amp;lt; rel_small
    end if
  end function nearly_equal_real&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 12:41:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143969#M137989</guid>
      <dc:creator>Juergen_R_R</dc:creator>
      <dc:date>2019-05-11T12:41:05Z</dc:date>
    </item>
    <item>
      <title>Juergen,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143970#M137990</link>
      <description>&lt;P&gt;Juergen,&lt;/P&gt;&lt;P&gt;Three points:&lt;/P&gt;&lt;P&gt;1) the epsilon function should be used in combination with the magnitudes of the input arguments such that the precision takes into account of these magnitudes.&lt;/P&gt;&lt;P&gt;2) ieee_is_... intrinsic functions have significant overhead, if possible perform what you can before making these tests.&lt;/P&gt;&lt;P&gt;3) While one NAN is not equal to one not-NAN, two NAN's are neither equal nor unequal&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 13:18:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143970#M137990</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2019-05-11T13:18:16Z</dc:date>
    </item>
    <item>
      <title>Thanks, Jim. Our definition</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143971#M137991</link>
      <description>Thanks, Jim. Our definition of "tiny" contains the epsilon function:
  real(default), parameter, public :: &amp;amp;
       eps0 = epsilon (zero), &amp;amp;
       tiny_13 = 1E3_default * epsilon (zero), &amp;amp;
       tiny_10 = 1E6_default * epsilon (zero), &amp;amp;
       tiny_07 = 1E9_default * epsilon (zero)

Furthermore, we do test runs with signalling NaNs for our software, so that the test for NaNs in this float comparison function is rather academic. 
But most definitely thanks for the remarks.</description>
      <pubDate>Sat, 11 May 2019 13:22:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143971#M137991</guid>
      <dc:creator>Juergen_R_R</dc:creator>
      <dc:date>2019-05-11T13:22:38Z</dc:date>
    </item>
    <item>
      <title>Oops, strike 1), the r = diff</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143972#M137992</link>
      <description>&lt;P&gt;Oops, strike 1), the r = diff... should be sufficient to take into consideration the magnitudes verses precision.&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 15:29:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143972#M137992</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2019-05-11T15:29:53Z</dc:date>
    </item>
    <item>
      <title>But then these are relative</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143973#M137993</link>
      <description>&lt;P&gt;But then these are relative to 1E3, 6 and 9. When you have numbers of much larger (e.g. astronomical scale) or smaller (atomic scale) then the magnitude of your tiny(s) must be futzed with. You might want to consider&lt;/P&gt;&lt;P&gt;tiny = min(a,b) * epsilon(zero) * YouPickNumberRelativeToLSB (e.g 2, 4, ...)&lt;/P&gt;&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2019 15:35:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/new-versions-of-svml-give-different-results-that-older-versions/m-p/1143973#M137993</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2019-05-11T15:35:18Z</dc:date>
    </item>
  </channel>
</rss>

