[SystemSafety] Accuracy of COVID modeling code

Derek M Jones derek at knosof.co.uk
Sat May 9 18:41:54 CEST 2020


Martyn,

> I haven't seen a language specification that rules out any form of
> optimisation that involves rearranging code or using mathematically
> equivalent operations. Please post a link to the sections of those that
> you have seen that make that clear.

Section 5.1.2.3 of the C Standard,

or sentence 189: https://c0x.coding-guidelines.com/5.1.2.3.html
"In the abstract machine, all expressions are evaluated as specified by the semantics."

There as an as-if rule that allows implementations to do what they
like (e.g., turn an integer multiple by two into a shift), as long as
the behavior is the same.

-- 
Derek M. Jones           Evidence-based software engineering
tel: +44 (0)1252 520667  blog:shape-of-code.coding-guidelines.com


More information about the systemsafety mailing list