This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: TMU support: What does the note "may differ slightly" mean?

Part Number: TMS320F28377D


Tool/software:

In the compiler documentation SPRU514,
for the option "--fp_mode",
there is:
"Note that there are algorithmic differences between the TMU hardware instructions and the library routines, so the results of operations may differ slightly."

What does "may differ slightly" mean?

We would need a clear description of the TMU performance that we can safely rely on.

Is there somewhere a precise description of the "slight differences" ?

Is there a way to measure the differences ?
A systematic test for the 2^64 possibilities (two 32-bits singles for the division) is not realistic.

Best regards

  • Pierre,

    Please see below. 

    Operation

    TMU

    Accuracy (with floating-pt)

    Input range limitations

    Floating-pt cycles

    Fixed-pt cycles (Assumes conversion to floating-pt, compute, then conversion back to fixed-pt)

    Division

    1 ULP (unit of least precision)

    -

    5

    9

    Square root

    1 ULP

    -

    5

    9

    sine, cosine

    2.6822 x 10^-7

    -

    6

    10

    arc tangent (atan2(y,x))

    1.036096 x 10^-8

    -

    10

    14

    arc tangent (atan(x))

    1.036096 x 10^-8

    [-1,1]

    6

    10

    Exponent

    Max (7 ULP, 2^-20)

    6

    10

    Natural logarithm

    Max (1 ULP, 2^-23)

    -

    6

    10

    The one concern area would be the Exponent, where the accuracy starts to fall off as the base or exponent gets larger.

    Input=1.6324520,RTS output=5.1164045334,Golden output=5.1164045334,RTS Error = 0.0000000000

    Input=1.6324520,TMU output=5.1164054871,Golden output=5.1164045334,TMU Error = 0.0000009537

    Input=2.3451440,RTS output=10.4347753525,Golden output=10.4347753525,RTS Error = 0.0000000000

    Input=2.3451440,TMU output=10.4347734451,Golden output=10.4347753525,TMU Error = -0.0000019073

    Input=3.2344100,RTS output=25.3913879395,Golden output=25.3913879395,RTS Error = 0.0000000000

    Input=3.2344100,TMU output=25.3913345337,Golden output=25.3913879395,TMU Error = -0.0000534058

    Input=6.4230309,RTS output=615.8668823242,Golden output=615.8668823242,RTS Error = 0.0000000000

    Input=6.4230309,TMU output=615.8727416992,Golden output=615.8668823242,TMU Error = 0.0058593750

    Input=9.2389936,RTS output=10290.6777343750,Golden output=10290.6777343750,RTS Error = 0.0000000000

    Input=9.2389936,TMU output=10290.5507812500,Golden output=10290.6777343750,TMU Error = -0.1269531250

    Input=13.8610001,RTS output=1046540.0000000000,Golden output=1046540.0000000000,RTS Error = 0.0000000000

    Input=13.8610001,TMU output=1850481.3750000000,Golden output=1046540.0000000000,TMU Error = 803941.37500

     

    Thanks,

    Sira

  • Thank you very much for the answer.

    Nevertheless, there are two things that I don't understand:

    1. The precision for arc tangent seems suspicious:
      The maximal precision for 32-bits IEEE754 floats is between 3E-8 and 6E-8
      (half of the ULP relative to the encoded value).
      How the precision could be 1.036096E-8 ?

    2. The precision for exponent: Max (7 ULP, 2^-20)
      seems not consistent with the example
      Input=13.861,TMU output=1850481.375,TMU Error = 803941.375
  • Hi Pierre,

    1. Let me look into this further. 

    2. Yes, it is a Max function, and with floating-point numbers, the ULP gets larger as the numbers get larger.

    Thanks,

    Sira