<?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 John, we're not going to do in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935085#M88748</link>
    <description>&lt;P&gt;John, we're not going to do that. We did seriously discuss it at one point and realized that it would create too many issues in the compiler for very little gain. We'd like to move away from x87 as much as possible.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Mar 2014 00:53:13 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2014-03-13T00:53:13Z</dc:date>
    <item>
      <title>Floating point calculation issue</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935067#M88730</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Some time ago I converted a large numerical codebase over to the Intel Visual Fortran compiler. So far we have been unable to make the switch to IVF as we are seeing an unacceptably large discrepancy between the new simulation results and those produced by our old compiler.&amp;nbsp; After some work I have managed to identify the source of problem - the deviation seems to be seeded by an error in the last digit of a floating point calculation in the IVF build:&lt;/P&gt;

&lt;P&gt;x = 1.0000000/8.5404000&lt;/P&gt;

&lt;P&gt;the correct answer is:&lt;/P&gt;

&lt;P&gt;x = 0.11709053&lt;/P&gt;

&lt;P&gt;the IVF answer is:&lt;/P&gt;

&lt;P&gt;x = 0.11709054&lt;/P&gt;

&lt;P&gt;I suspect this is due to some kind of compiler optimisation - I have tried /fp:precise and /fp:strict with no success.&amp;nbsp; I have attached a small project which replicates the issue.&amp;nbsp; Could someone please tell me if/how I can resolve this issue?&amp;nbsp; Any guidance would be appreciated...&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Build 20101201 Package ID: w_cprof_p_11.1.072&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 11:18:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935067#M88730</guid>
      <dc:creator>David_Mccabe</dc:creator>
      <dc:date>2014-03-03T11:18:24Z</dc:date>
    </item>
    <item>
      <title>Looks like rounding issue.Are</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935068#M88731</link>
      <description>&lt;P&gt;Looks like rounding issue.Are those values i.e x and &amp;nbsp;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;"&gt;1.0000000/8.5404000&amp;nbsp;&lt;/SPAN&gt; declared as a double precision?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 12:05:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935068#M88731</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2014-03-03T12:05:00Z</dc:date>
    </item>
    <item>
      <title>Maybe FP environment is set</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935069#M88732</link>
      <description>&lt;P&gt;Maybe FP environment is set to default mode, thus implying rounding to the nearest.On the other hand &amp;nbsp;you have set /fp:strict.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 12:17:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935069#M88732</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2014-03-03T12:17:39Z</dc:date>
    </item>
    <item>
      <title>Are you comparing results</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935070#M88733</link>
      <description>&lt;P&gt;Are you comparing results with implicit promotion to double vs. results without? &amp;nbsp;You make it too much of a struggle to figure out what you are doing.&lt;/P&gt;

&lt;P&gt;If you want ia32 mode, implying implicit promotion to double, and no auto-vectorization, with win32 compilation you would set /arch:IA32&lt;/P&gt;

&lt;P&gt;but then you could not expect bit-wise agreement with results in default or intel64 modes unless you made promotion to double explicit e.g.&lt;/P&gt;

&lt;P&gt;1.0/(dble(HCO) + HRO)&lt;/P&gt;

&lt;P&gt;(but you may need to read from data file directly to double precision)&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 12:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935070#M88733</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-03-03T12:50:00Z</dc:date>
    </item>
    <item>
      <title>Quote:David Mccabe wrote:I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935071#M88734</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;David Mccabe wrote:&lt;BR /&gt;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 11.818181991577148px; line-height: 16.363636016845703px;"&gt;I suspect this is due to some kind of compiler optimisation&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT face="Arial, Helvetica, sans-serif"&gt;&lt;SPAN style="font-size: 11.818181991577148px; line-height: 16.363636016845703px;"&gt;No, it is something more basic at work. The differences between the "correct" and "incorrect" answers is too small to represent with default REAL precision. You can only expect about 7 decimal digits to agree. Try the following program, and before running it predict what it will print.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT face="Arial, Helvetica, sans-serif"&gt;&lt;SPAN style="font-size: 11.818181991577148px; line-height: 16.363636016845703px;"&gt;[fortran]&lt;/SPAN&gt;&lt;/FONT&gt;program fptest&lt;/P&gt;

&lt;P&gt;real x,rx&lt;/P&gt;

&lt;P&gt;x=8.5404000&lt;/P&gt;

&lt;P&gt;rx=1.0/x&lt;/P&gt;

&lt;P&gt;if(abs(x*rx - 1.0).lt.epsilon(x))then&lt;/P&gt;

&lt;P&gt;&amp;nbsp; write(*,*)'Correct'&lt;/P&gt;

&lt;P&gt;else&lt;/P&gt;

&lt;P&gt;&amp;nbsp; write(*,*)'Error'&lt;/P&gt;

&lt;P&gt;endif&lt;/P&gt;

&lt;P&gt;end program fptest[/fortran]&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 14:26:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935071#M88734</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-03-03T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935072#M88735</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;&lt;EM&gt;David Mccabe&lt;/EM&gt; wrote:I suspect this is due to some kind of compiler optimisation&lt;/BLOCKQUOTE&gt;

&lt;P&gt;No, it is something more basic at work. The differences between the "correct" and "incorrect" answers is too small to represent with default REAL precision. You can only expect about 7 decimal digits to agree.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Mecej4 is correct.&amp;nbsp; Single precision (SP) has only around 6.92 decimal digits of precision.&amp;nbsp; Double precision (DP) has 15.&amp;nbsp; You are asking for at least 8 decimal digits of precision in your results.&amp;nbsp; That is too much precision for SP.&lt;/P&gt;

&lt;P&gt;Even if the variable that you are assigning the result to is defined to be DP, the Fortran standard &lt;EM&gt;&lt;STRONG&gt;requires&lt;/STRONG&gt;&lt;/EM&gt; that the arithmetic on&amp;nbsp; the constants be performed using SP.&amp;nbsp; That is because you are using default real constants, since you do not have any kind type parameter at the end of the constants.&amp;nbsp; By rule, default real is SP.&lt;/P&gt;

&lt;P&gt;This may be old, "dusty deck" source code, from the days of Fortran 77 or before.&amp;nbsp; The Fortran 77 standard allowed a Fortran compiler to "promote" a constant from SP to DP if the result was being assigned to a DP variable.&amp;nbsp; Starting with Fortran 90, published in June 1991, this practice of "promoting" SP constants to DP is prohibited.&amp;nbsp; See Fortran 2008 standard, section 1.6.5, first bullet.&amp;nbsp; By rule, all arithmetic is performed using the data type and kind of the operands.&amp;nbsp; In this example, since both operands are SP, the arithmetic is SP and the result is SP.&lt;/P&gt;

&lt;P&gt;It appears that you desire a fairly high degree of accuracy in your results.&amp;nbsp; I strongly recommend that you us DP or greater for all of your floating-point work, both variables and constants.&amp;nbsp; If you do, I believe that it is highly likely that you will get the results that you desire.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 14:52:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935072#M88735</guid>
      <dc:creator>Craig_Dedo</dc:creator>
      <dc:date>2014-03-03T14:52:00Z</dc:date>
    </item>
    <item>
      <title>I think the Fortran standard</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935073#M88736</link>
      <description>&lt;P&gt;I think the Fortran standard issue to which Craig refers is that literal floating point constants with no type specification are to be interpreted as default real. &amp;nbsp;ifort has an option to change that (in conflict with the standard). &amp;nbsp;Your comment misled us into raising that issue which isn't supported as one related to your code sample.&lt;/P&gt;

&lt;P&gt;More than one of us also raised the issue that you can't expect identical results on a target where promotion to double precision occurs (after translation of constants to default real) as on a target where pure default real is supported (as ifort has done by default for several years now). &amp;nbsp;Fortran standard doesn't prevent such differences, nor does it disallow differences due to differing orders of evaluation (in the absence of parentheses, for which ifort requires /assume:protect_parens or a /fp: option for standard compliance). &amp;nbsp;Such differences, as others pointed out, easily account for changes on the order of the inherent precision of default real.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 15:55:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935073#M88736</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-03-03T15:55:00Z</dc:date>
    </item>
    <item>
      <title>The following might clarify</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935074#M88737</link>
      <description>&lt;P&gt;The following might clarify the difference&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; real*4 x4, x6&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; real*8 x8, x&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&amp;nbsp; = 1.0000000/8.5404000&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; x4 = 1.0000000/8.5404000&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; x6 = 1.00000d0/8.54040d0&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; x8 = 1.00000d0/8.54040d0&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	! the correct answer is: x = 0.11709053&lt;BR /&gt;
	&amp;nbsp;&lt;BR /&gt;
	! the IVF answer is:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = 0.11709054&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write (*,*) 'exp x = 0.11709053'&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; write (*,*) 'IVF x = 0.11709054'&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; write (*,1) 'x4&amp;nbsp;&amp;nbsp;&amp;nbsp; =',x4&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; write (*,1) 'x6&amp;nbsp;&amp;nbsp;&amp;nbsp; =',x6&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; write (*,2) 'x8&amp;nbsp;&amp;nbsp;&amp;nbsp; =',x8&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; write (*,2) 'x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =',x&lt;BR /&gt;
	1&amp;nbsp;&amp;nbsp; format (1x,a,f12.9)&lt;BR /&gt;
	2&amp;nbsp;&amp;nbsp; format (1x,a,f17.14)&lt;BR /&gt;
	end&lt;/P&gt;

&lt;P&gt;&amp;nbsp;exp x = 0.11709053&lt;BR /&gt;
	&amp;nbsp;IVF x = 0.11709054&lt;BR /&gt;
	&amp;nbsp;x4&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.117090538&lt;BR /&gt;
	&amp;nbsp;x6&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.117090531&lt;BR /&gt;
	&amp;nbsp;x8&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.11709053440120&lt;BR /&gt;
	&amp;nbsp;x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.11709053814411&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Does this says something about the stability or reliability of your simulation ?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 04:13:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935074#M88737</guid>
      <dc:creator>John_Campbell</dc:creator>
      <dc:date>2014-03-04T04:13:00Z</dc:date>
    </item>
    <item>
      <title>Thanks for the explanations..</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935075#M88738</link>
      <description>&lt;P&gt;Thanks for the explanations... just to clarify - I have no intention to promote anything to double precision, I only consider sp.&lt;/P&gt;

&lt;P&gt;It is now clear to me that the correct mathematical value from the expression cannot be represented exactly using the IEEE binary representation.&amp;nbsp; Nevertheless&amp;nbsp;it would&amp;nbsp;be interesting to know why the result&amp;nbsp;varies between the&amp;nbsp;two compilers.&lt;/P&gt;

&lt;P&gt;Both functions are fed the&amp;nbsp;same bit patterns:&lt;/P&gt;

&lt;P&gt;HRO:&amp;nbsp; 01000000101100010100101011110101&lt;/P&gt;

&lt;P&gt;HCO:&amp;nbsp; 01000000010000000000000000000000&lt;/P&gt;

&lt;P&gt;Yet they return:&lt;/P&gt;

&lt;P&gt;ifort:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00111101111011111100110100101010&amp;nbsp; (0.117090538144112)&lt;/P&gt;

&lt;P&gt;ftn95:&amp;nbsp;&amp;nbsp;&amp;nbsp; 00111101111011111100110100101001 (0.1170790530693531)&lt;/P&gt;

&lt;P&gt;I guess the cause of this is the ifort compiler first&amp;nbsp;calculating the denominator (HRO+HCO)&amp;nbsp;which is stored in a&amp;nbsp;in a&amp;nbsp;4 byte buffer, then the division is performed.&amp;nbsp; In the case of ftn95 the whole calculation is performed at greater precision.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 10:47:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935075#M88738</guid>
      <dc:creator>David_Mccabe</dc:creator>
      <dc:date>2014-03-05T10:47:49Z</dc:date>
    </item>
    <item>
      <title>I ran the example code in #8</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935076#M88739</link>
      <description>&lt;P&gt;I ran the example code in #8 with ftn95 and it produced an identical result to IVF. The only calculations that produce what you want are when the constant 8.5404000 is treated as 8.54040d0. Did you run it with ftn77, as ftn95 is treating it as 8.54040e0 ?&lt;/P&gt;

&lt;P&gt;The only way I can get ftn95 to produce what you had is to use /DReal or /Xreal&lt;/P&gt;

&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 11:45:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935076#M88739</guid>
      <dc:creator>John_Campbell</dc:creator>
      <dc:date>2014-03-05T11:45:49Z</dc:date>
    </item>
    <item>
      <title>@John Campbell: thanks, ftn95</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935077#M88740</link>
      <description>&lt;P&gt;@John Campbell: thanks, ftn95 produces the same result as yours using single precision throughout - the reason being that there is no addition in your denominator. &amp;nbsp;The discrepancy in my example is caused by ftn95 performing a "f&lt;SPAN class="mw-headline" id="Fused_multiply.E2.80.93add"&gt;used multiply–add" (or fused divide add in this case) whereas ifort rounds the result of the addition before performing the division. &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Could it be that I need a compiler switch which forces this behavior in the ifort compiler?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 13:15:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935077#M88740</guid>
      <dc:creator>David_Mccabe</dc:creator>
      <dc:date>2014-03-05T13:15:07Z</dc:date>
    </item>
    <item>
      <title>You are at the limits of the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935078#M88741</link>
      <description>&lt;P&gt;You are at the limits of the precision chosen. Why worry about it? It is just a function of rounding/precision in the low level code? If this is something to worry about you need to be doing DP maths.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 13:24:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935078#M88741</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-03-05T13:24:50Z</dc:date>
    </item>
    <item>
      <title>Quote:David Mccabe wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935079#M88742</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;David Mccabe wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;@John Campbell: thanks, ftn95 produces the same result as yours using single precision throughout - the reason being that there is no addition in your denominator. &amp;nbsp;The discrepancy in my example is caused by ftn95 performing a "fused multiply–add" (or fused divide add in this case) whereas ifort rounds the result of the addition before performing the division. &amp;nbsp;Could it be that I need a compiler switch which forces this behavior in the ifort compiler?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Your argument is getting more circular. &amp;nbsp;You complain that ifort, when restricted to single precision, doesn't give the same result as you get with double precision evaluation, but say you don't want the promotion of expression evaluation&amp;nbsp; to double. &amp;nbsp;You tried options which imply /Qprec-div and now say you want some other option with similar effect? &amp;nbsp;By default, ifort is allowed to use an iterative method for division, although this wouldn't apply to the examples you gave here (one with addition in the divisor, one without).&lt;/P&gt;

&lt;P&gt;If you're reading about Itanium division expression evaluation methods, forget it, those are unique to Itanium.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 14:41:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935079#M88742</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-03-05T14:41:31Z</dc:date>
    </item>
    <item>
      <title>Quote:David Mccabe wrote:The</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935080#M88743</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;David Mccabe wrote:&lt;BR /&gt;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 11.818181991577148px; line-height: 16.363636016845703px;"&gt;The discrepancy in my example is caused by ftn95 performing a "fused multiply–add" (or fused divide add in this case) whereas ifort rounds the result of the addition before performing the division. &amp;nbsp;Could it be that I need a compiler switch which forces this behavior in the ifort compiler?&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Mainstream Intel processors preceding Haswell/Broadwell did not have FMA instructions (it is a different story with PowerPC), so your inference is wrong, unless one were to interpret "fused" as "with no memory accesses for intermediate results".&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;The differences that you are seeing are caused by the differences between 80X87 FPU (80 bit register stack) and XMM (32/64/128/.. bit register) architecture. Nor do you need to compare two different compilers to observe such behavior. With the current Intel compiler for 32-bit targets, with the option /arch:ia32 the result is&amp;nbsp;1.1709053E-01 (0X3DEFCD2&lt;STRONG&gt;9&lt;/STRONG&gt; in Hex Float format)&amp;nbsp;for Res, whereas with the default (SSE2) options the result is 1.1709054E-01 (3DEFCD2&lt;STRONG&gt;A&lt;/STRONG&gt; in Hex).&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;The difference is only in the least significant bit. I think that you should respect app4619's advice. Please read Tim Prince's comments, as well. He is an expert on these topics.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 14:49:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935080#M88743</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-03-05T14:49:00Z</dc:date>
    </item>
    <item>
      <title>Quote:David Mccabe wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935081#M88744</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;David Mccabe wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;we are seeing an unacceptably large discrepancy between the new simulation results and those produced by our old compiler.&lt;/P&gt;

&lt;P&gt;the correct answer is:&lt;/P&gt;

&lt;P&gt;x = 0.11709053&lt;/P&gt;

&lt;P&gt;the IVF answer is:&lt;/P&gt;

&lt;P&gt;x = 0.11709054&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;David,&lt;/P&gt;

&lt;P&gt;I would suggest that if differences at the last decimal place in single precision are causing "&lt;STRONG&gt;large&lt;/STRONG&gt; &lt;STRONG&gt;discrepancies"&amp;nbsp;&lt;/STRONG&gt;then the&amp;nbsp;algorithm&amp;nbsp;is suspect and/or should be changed to&amp;nbsp;a higher precision.&lt;/P&gt;

&lt;P&gt;The "correct" answer above is in fact only correct for a&amp;nbsp;particular definition of correct and is truncated from (my calculator value of) 0.11709053440119900707226827783242&lt;/P&gt;

&lt;P&gt;The compilers/processors would store this result&amp;nbsp;as single precision to the nearest bit depending on various factors (hardware registers, rounding options etc.)&lt;/P&gt;

&lt;P&gt;Les&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2014 16:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935081#M88744</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2014-03-05T16:19:00Z</dc:date>
    </item>
    <item>
      <title>Thanks all for the help, this</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935082#M88745</link>
      <description>&lt;P&gt;Thanks all for the help,&amp;nbsp;this has been a learning experience for me. @Tim Prince,&lt;A href="http://software.intel.com/en-us/user/1007934"&gt;mecej4&lt;/A&gt;&amp;nbsp;you are totally correct...&lt;/P&gt;

&lt;P&gt;"FPU (x87) instructions provide higher precision by calculating intermediate results with 80 bits of precision, by default, to minimise &lt;A class="mw-redirect" href="http://en.wikipedia.org/wiki/Roundoff_error" title="Roundoff error"&gt;&lt;U&gt;&lt;FONT color="#0066cc"&gt;roundoff error&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; in numerically unstable algorithms (see &lt;A href="http://en.wikipedia.org/wiki/Floating_point#IEEE_754_design_rationale" title="Floating point"&gt;&lt;U&gt;&lt;FONT color="#0066cc"&gt;IEEE 754 design rationale&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; and references therein). However, the x87 FPU is a scalar unit only whereas SSE2 can process a small vector of operands in parallel."&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 13:54:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935082#M88745</guid>
      <dc:creator>David_Mccabe</dc:creator>
      <dc:date>2014-03-12T13:54:21Z</dc:date>
    </item>
    <item>
      <title>You will need to revise your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935083#M88746</link>
      <description>&lt;P&gt;You will need to revise your code should you desire to migrate from x87 to SSE/AVX. Sometimes this is harder than simply changing a compiler switch. Often convergence&amp;nbsp;code which were formerly tweaked to the limits of x87 will not work when using SIMD instructions. You may need a larger epsilon. Then results will differ, and if you have a requirement to match a "certified" set of results then you will not be able to migrate to the newer technology.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2014 18:54:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935083#M88746</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2014-03-12T18:54:21Z</dc:date>
    </item>
    <item>
      <title>It would be useful if ifort</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935084#M88747</link>
      <description>&lt;P&gt;It would be useful if ifort provided real*10 to assist in replicating 80-bit computation. I presume this could be done with x87 instructions in i32. Would it be done as a software implementation in i64, or is there access to x87 instructions&amp;nbsp;?&lt;BR /&gt;
	The down side of providing&amp;nbsp;this kind is all those who use QP = Select_Real_Kind (P=16,R=308) for real(16)&lt;BR /&gt;
	would have to change to QP = Select_Real_Kind (P=19).&lt;/P&gt;

&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 00:24:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935084#M88747</guid>
      <dc:creator>John_Campbell</dc:creator>
      <dc:date>2014-03-13T00:24:36Z</dc:date>
    </item>
    <item>
      <title>John, we're not going to do</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935085#M88748</link>
      <description>&lt;P&gt;John, we're not going to do that. We did seriously discuss it at one point and realized that it would create too many issues in the compiler for very little gain. We'd like to move away from x87 as much as possible.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 00:53:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Floating-point-calculation-issue/m-p/935085#M88748</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-03-13T00:53:13Z</dc:date>
    </item>
  </channel>
</rss>

