Mitsubishi Electric MELDAS C6 Programming Manual page 231

Hide thumbs Also See for MELDAS C6:
Table of Contents

Advertisement

13. Program Support Functions
Arithmetic accuracy
As shown in the following table, errors will be generated when performing arithmetic operations
once and these errors will accumulate by repeating the operations.
Arithmetic format
a = b + c
a = b − c
a = b∗c
a = b/c
a = b
a = SIN [b]
a = COS [b]
a = ATAN [b/c]
(Note)
SIN/COS is calculated for the function TAN.
Notes on reduced accuracy
(1) Addition and subtraction
It should be noted that when absolute values are used subtractively in addition or subtraction,
the relative error cannot be kept below 10
For instance, it is assumed that the real values produced as the arithmetic calculation result of
#10 and #20 are as follows (these values cannot be substituted directly) :
#10 = 2345678988888.888
#20 = 2345678901234.567
Performing #10 − #20 will not produced #10 − 320 = 87654.321. There are 8 significant digits
in the variables and so the values of #10 and #20 will be as follows (strictly speaking, the
internal values will differ somewhat from the values below because they are binary numbers) :
#10 = 2345679000000.000
#20 = 2345678900000.000
Consequently, #10 − #20 = 100000.000 will generate a large error.
(2) Logical operations
EQ, NE, GT, LT, GE and LE are basically the same as addition and subtraction and so care
should be taken with errors. For instance, to determine whether or not #10 and #20 are equal
in the above example :
IF [#10EQ#20]
It is not always possible to provide proper evaluation because of the above mentioned error.
Therefore, when the error is evaluated as in the following expression :
IF [ABS [#10 − #20] LT200000]
and the difference between #10 and #20 falls within the designated range error, both values
should be considered equal.
(3) Trigonometric functions
Absolute errors are guaranteed with trigonometric functions but since the relative error is not
under 10
trigonometric function.
Average error
2.33 × 10
1.55 × 10
4.66 × 10
1.24 × 10
5.0 × 10
1.8 × 10
− 8
, care should be taken when dividing or multiplying after having used a
223
13.5 User macro specifications
Maximum error
− 10
5.32 × 10
− 10
4.66 × 10
− 10
1.86 × 10
− 9
3.73 × 10
− 9
1.0 × 10
− 6
3.6 × 10
− 8
.
Type of error
− 10
Min. |ε/b|, |ε/c|
− 10
Relative error
− 9
|ε/a|
− 9
− 8
Absolute error
|ε|°
− 6

Advertisement

Table of Contents
loading

This manual is also suitable for:

Meldas c64Meldas c64t

Table of Contents