[SystemSafety] Accuracy of COVID modeling code
Peter Bernard Ladkin
ladkin at causalis.com
Sat May 9 09:48:33 CEST 2020
On 2020-05-08 21:01 , David MENTRÉ wrote:
> 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.
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^2 -
y^2" , exactly what is it that "correctly uses the FPU" to ensure that z gets an appropriate and
accurate value?
The answer is the programming system you are using. For example, does your compiler calculate x^2
and y^2 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.
People who want accurate FP computations use special libraries such as NAG. Doesn't the very
existence of such facilities as the NAG libraries for those who want accurate computation prove my
point?
BTW, the guy who wrote the first working draft of IEEE 754, Jerry Coonen, took Maths 228A/B, the
graduate course in numerics, when Ole Hald taught it and I was the teaching assistant. That was such
easy work - to grade the exercises each week, I didn't need to solve the problems myself (though it
would undoubtedly have been better for my education had I done so). I just looked at Jerry's
solutions, and those of this guy https://math.berkeley.edu/people/faculty/james-sethian They always
managed to get some decent results before the error terms took over. Velvel Kahan became Jerry's PhD
supervisor, and his thesis consisted of a first draft plus a "series of footnotes to" IEEE 754
https://dl.acm.org/doi/book/10.5555/911871
PBL
Prof. Peter Bernard Ladkin, Bielefeld, Germany
Styelfy Bleibgsnd
Tel+msg +49 (0)521 880 7319 www.rvs-bi.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.techfak.uni-bielefeld.de/pipermail/systemsafety/attachments/20200509/4b0ba205/attachment.sig>
More information about the systemsafety
mailing list