Floating point undesireable in highly critical code?

Posted by Kirt Undercoffer on Programmers See other posts from Programmers or by Kirt Undercoffer
Published on 2012-09-25T22:27:27Z Indexed on 2012/09/26 3:49 UTC
Read the original article Hit count: 290

Filed under:
|

Question 11 in the Software Quality section of "IEEE Computer Society Real-World Software Engineering Problems", Naveda, Seidman, lists fp computation as undesirable because "the accuracy of the computations cannot be guaranteed".

This is in the context of computing acceleration for an emergency braking system for a high speed train. This thinking seems to be invoking possible errors in small differences between measurements of a moving object but small differences at slow speeds aren't a problem (or shouldn't be), small differences between two measurements at high speed are irrelevant - can there be a problem with small roundoff errors during deceleration for an emergency braking system? This problem has been observed with airplane braking systems resulting in hydroplaning but could this actually happen in the context of a high speed train? The concern about fp errors seems to not be well-founded in this context. Any insight? The fp is used for acceleration so perhaps the concern is inching over a speed limit? But fp should be just fine if they use a double in whatever implementation language.

The actual problem in the text states: During the inspection of the code for the emergency braking system of a new high speed train (a highly critical, real-time application), the review team identifies several characteristics of the code. Which of these characteristics are generally viewed as undesirable?

  1. The code contains three recursive functions (well that one is obvious).
  2. The computation of acceleration uses floating point arithmetic.
  3. All other computations use integer arithmetic.
  4. The code contains one linked list that uses dynamic memory allocation (second obvious problem).
  5. All inputs are checked to determine that they are within expected bounds before they are used.

© Programmers or respective owner

Related posts about software

Related posts about real-time