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.

RCPSP simulation

I have an algorithm that wants to calculate multiplicative inverse of a floating-point number.  However speed is important, accuracy less so, so I am using the reciprocal approximation intrinsic _rcpsp.

This is a cross-platform project, so I would like to simulate the output of _rcpsp on the non-TI platforms.  Per the TMS320C66x DSP CPU and Instruction Set Reference Guide, 1/x should have a mantissa error of less than 2^-8 from RCPSP, but I am looking for a better simulation than that.  For now I am primarily interested in a domain of normal single-precision floating-point numbers; I'll deal with special cases (e.g. FLT_MIN, FLT_MAX, INFINITY, NAN, etc.) in the future.  I am not concerned with replicating timing.

Does anyone have a solution that is a good approximation of the RCPSP instruction?


There is a similar thread here that was not answered.


C6655, cgt 8.0.4, CCS 6.1.1

  • The non-TI platforms are not supported in TI e2e forums. I have assigned this thread to factory team for appropriate response. Thank you for your patience.
  • You can think about the RCPSP as a look-up table for the mantissa and a manipulation of the exponent (The exponent of 1/x is the minus value of the exponent of x)

    And it only look at the first 8 bits (256 values)

    1. To get the exact value of the table just call the function with exponent 0 and almost 1 (mantissa 0x11111111) and print out the results. This will give you the initial value for the simulation

    2. To get better accuracy people use what is called Newton-Raphson iteration, you can see it in https://en.wikipedia.org/wiki/Division_algorithm#Newton.E2.80.93Raphson_division  and more  about the theory  in . https://www.math.ubc.ca/~anstee/math104/104newtonmethod.pdf

    3. The original accuracy is 8 bits mantissa. One iteration takes you to 16 bit mantissa.  I think that it takes 3 cycles or so to do one iteration in a look.  Try it

    Doe sit answer your question?  If so, close the thread

    Ran

  • ran35366 said:

    You can think about the RCPSP as a look-up table for the mantissa and a manipulation of the exponent (The exponent of 1/x is the minus value of the exponent of x)

    And it only look at the first 8 bits (256 values)

    1. To get the exact value of the table just call the function with exponent 0 and almost 1 (mantissa 0x11111111) and print out the results.

    I believe this will get me on the right track.  Thanks.