<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Hello,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Le 09/05/2020 à 09:48, Peter Bernard
      Ladkin a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:413cdcac-4c14-2eba-6e17-d4f820c3de3b@causalis.com">
      <pre class="moz-quote-pre" wrap="">
On 2020-05-08 21:01 , David MENTRÉ wrote:
</pre>
      <blockquote type="cite" style="color: #000000;">
        <pre class="moz-quote-pre" wrap="">Hello,

Regarding floating-point computation, for once I'll agree with Derek:
accuracy of floating point computations does not depend on the
programming language but the correct use of the FPU. 
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">And exactly what is it that would be making "correct use of the FPU" or not? Surely the
paraphernalia of whatever HLL you are using.

There you are, programming in Excel. It is well known that Excel computations are not necessarily
reliable. Saying it is to do with  "the (in)correct use of the FPU" does not strike me as a helpful
way of expressing what is going on, which is that it is the Excel system itself which is engaging in
inaccurate computation, no matter whether the FPU conforms to IEEE 754 or not.

Consider an example from Goldberg's survey which you reference, when a programmer writes "z := x<sup class="moz-txt-sup"><span style="display:inline-block;width:0;height:0;overflow:hidden">^</span>2</sup> -
y<sup class="moz-txt-sup"><span style="display:inline-block;width:0;height:0;overflow:hidden">^</span>2</sup>" , exactly what is it that "correctly uses the FPU" to ensure that z gets an appropriate and
accurate value?</pre>
    </blockquote>
    <p>By carefully designing the algorithm and organizing code doing
      computations do avoid rounding and other numerical computation
      errors. Of course, most people doing numerical computations won't
      do that. :-)<br>
    </p>
    <p>Just to please Derek ;-) , some formal method tools are designed
      to help such kind of analysis like Fluctuat (used on Airbus
      manually written C numerical computations libraries if I am
      correct): <br>
    </p>
    <p>   
      <a class="moz-txt-link-freetext" href="http://www.lix.polytechnique.fr/Labo/Sylvie.Putot/fluctuat.html">http://www.lix.polytechnique.fr/Labo/Sylvie.Putot/fluctuat.html</a></p>
    <p><br>
    </p>
    <blockquote type="cite"
      cite="mid:413cdcac-4c14-2eba-6e17-d4f820c3de3b@causalis.com">
      <pre class="moz-quote-pre" wrap="">The answer is the programming system you are using. For example, does your compiler calculate x<sup class="moz-txt-sup"><span style="display:inline-block;width:0;height:0;overflow:hidden">^</span>2</sup>
and y<sup class="moz-txt-sup"><span style="display:inline-block;width:0;height:0;overflow:hidden">^</span>2</sup> and perform a subtraction, or does it calculate x+y and x-y and perform a multiplication? As
Goldberg notes, there are differences. It is not the FPU which chooses how this calculation is to be
performed, except in the limited cases handled in IEEE 754, but the HLL paraphernalia.
</pre>
    </blockquote>
    <p>From the programming language point of view, I don't think there
      is much difference between languages. As illustration (and not
      proof) here is above x²-y² expression computed in C++ (with GCC
      and msvc), Rust:</p>
    <p>    <a class="moz-txt-link-freetext" href="https://godbolt.org/z/8XZhxp">https://godbolt.org/z/8XZhxp</a></p>
    <p>...and Ada:</p>
    <p>    <a class="moz-txt-link-freetext" href="https://godbolt.org/z/AwQdFS">https://godbolt.org/z/AwQdFS</a></p>
    <p>The resulting assembly is exactly the same, following code order
      (you can see that for example by swapping into y²-x²).</p>
    <p>Considering the complexity of floating-point computations
      (rounding, non-commutativity, ...), I don't think most compiler
      would mess with source code order (of course, they might introduce
      optimizations on loops like hoisting that could impact numerical
      computations).</p>
    <p>That's said, if you are doing more complex computations (e.g.
      linear algebra, ...), then you will probably use pre-made
      libraries (as you said, the "programming system") that might
      implement more precise algorithms than others. I don't have
      knowledge on the preciseness of computations done in NAG, Matlab,
      R, LAPACK, ... to comment further. But my feeling is that you
      don't have much information because precision of numerical
      computations depends to much on range of inputs, order of
      computations, number of iterations, ... For example there is no
      paragraph on numerical precision in Matlab matrix multiplication
      documentation:
      <a class="moz-txt-link-freetext" href="https://www.mathworks.com/help/matlab/ref/mtimes.html">https://www.mathworks.com/help/matlab/ref/mtimes.html</a></p>
    <p>Excel might not be reliable because Excel decides the order of
      computations (according to cell dependencies), not the user. But
      in any other systems, if the user decides the order of
      computations, (s)he can directly manage computations done on the
      FPU and thus manage precision. I'm not saying this is easy. ;-)</p>
    <p>To go closer to this list topic on safety: does anybody knows
      programming language, programming system or project specific tool
      that were designed specifically for the precision of numerical
      computations?I know some domains (railway, older automotive code,
      ...) are using exclusively fixed point computations mapped on
      integers to master precision, while others (aeronautics, newer
      automotive code, ...) use extensively floating point for numerical
      computations. I am interested in process, methodology and tool
      used to master accuracy in industrial projects.<br>
    </p>
    <p>Best regards,<br>
      david</p>
    <p><br>
    </p>
  </body>
</html>