[SystemSafety] [External] Re: Accuracy of COVID modeling code

Driscoll, Kevin kevin.driscoll at honeywell.com
Sat May 9 18:15:44 CEST 2020


> the accuracy of the FP performed depends on the language
... and the specific compiler for that language, and the specific invocation of that compiler.  This is because FP is neither associative nor communicative.  An early version of a compiler targeted to DO-178 Level A code used heuristic optimization seeded by a random number every time it was invoked.  So, recompiling the same code often created object code that produced different results.

> * that words have gotten a lot longer (that helps some);
But, the IEEE 754 FP standard has not changed.  And, for performance reasons, many applications use single precision FP.
Another thing that can affect accuracy is interrupt servicing.  Does this servicing save the full 80-bit precision of the floating-point registers or use one of the lesser precision formats?  I have warned about using floating-point in interrupt service routines, but that advice has gone unheeded in cases.  Thus, the specific timing of interrupts can affect FP results in code that has nothing to do with the interrupts.

-----Original Message-----
From: systemsafety <systemsafety-bounces at lists.techfak.uni-bielefeld.de> On Behalf Of Peter Bernard Ladkin
Sent: Saturday, May 9, 2020 10:27 AM
To: systemsafety at lists.techfak.uni-bielefeld.de
Subject: [External] Re: [SystemSafety] Accuracy of COVID modeling code

On 2020-05-09 15:51 , Derek M Jones wrote:
> 
>> Consider an example from Goldberg's survey which you reference, when 
>> a programmer writes "z := x^2 - y^2" , exactly what is it that 
>> "correctly uses the FPU" to ensure that z gets an appropriate and accurate value?
>>
> All the language specifications I am familiar with are very clear, 
> implement what the code says.  In your example, it's always do the 
> multiples, and then the subtracts.
Thank you. That demonstrates clearly that the accuracy of the FP performed depends on the language, as I was saying.

It seems to me that David is also agreeing.

It was obvious to anyone doing scientific computing in the 1970's that the accuracy of FP computations was dependent on the HLL used. Most people used Fortran for numerics, and no one used Cobol, C or Lisp. That is, amongst other things, because the Fortran people paid a lot of attention to floating point computation, and C programmers were at the time more interested in other things.
That started evening out in the 1980's when the standard algorithm libraries branched out into letting themselves be called from various language sources.

The fine points of FP arithmetic crop up almost everywhere, and they are handled very differently in various programming systems. I don't know for the life of me why anyone would want to claim that they are language-independent.

What has changed in the last fifty years is mostly:
* that words have gotten a lot longer (that helps some);
* that it is now more widely understood that specific types of computation require specific library functions to get them right;
* and that these libraries are now available for a variety of HLLs, so exactly how an HLL performs its FP arithmetic is less sensitive an issue than it used to be.

PBL

Prof. Peter Bernard Ladkin, Bielefeld, Germany Styelfy Bleibgsnd
Tel+msg +49 (0)521 880 7319  www.rvs-bi.de



More information about the systemsafety mailing list