This is the web edition of the original ⮫ AC500-S safety user manual, version 1.3.2. This web edition is provided for quick reference only. The original safety user manual must be used to meet functional safety application requirements. |
Safety CPUs can perform floating-point operations.




DANGER

Divisions by zero are not allowed and shall be caught latest during the formal safety CPU code review according to safety programming guidelines⮫ “Safety programming guidelines”.
If case of exceptions during floating-point operations (e.g., due to usage of invalid arguments), the safety CPU goes to a SAFE STOP state or delivers a return value "Infinity".
Note that the range of valid arguments in safety CPU for floating-point functions is:
-
SIN and COS: [-9 x 1015 ... 9 x 1015]
-
TAN: [-4.5 x 1015 ... 4.5 x 1015]
-
ATAN: [-3.402823 x 1038 ... 3.402823 x 1038]
-
LOG, LN and SQRT: up to 3.402823 x 1038
The arguments outside the above-presented range will lead to a SAFE STOP state of the safety CPU.




DANGER

The end-result of floating-point operation has to be checked for its validity before it is further used in the safety program.




DANGER

It is important to take into account the following while programming with floating-point arithmetic⮫ [5]:
-
Round or truncate results after each floating-point operation according to defined ULPs (MOD, EXPT, EXP, ABS, TAN, ASIN, ACOS, ATAN, SIN, COS, LOG and LN operations are executed with a maximum expected error of 2 ULP; ADD, SUB, MUL, DIV and SQRT are executed with a maximum error of 1 ULP in the safety CPU). ⮫ http://en.wikipedia.org/wiki/Unit_in_the_last_place for more details on ULPs.
-
If you compute a value which is the result of a sequence of floating-point operations, the error can accumulate and greatly affect the computation itself.
-
Whenever subtracting two numbers with the same signs or adding two numbers with different signs, the accuracy of the result may be less than the precision available in the floating-point format.
-
The order of evaluation can affect the accuracy of the result.
-
When performing a chain of calculations involving addition, subtraction, multiplication and division, try to perform the multiplication and division operations first.
-
When multiplying and dividing sets of numbers, try to arrange the multiplications so that they multiply large and small numbers together; likewise, try to divide numbers that have the same relative magnitudes.
-
When comparing two floating-point numbers, always compare one value to see if it is in the range given by the second value plus or minus some small error value.