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.

Execution of SQRT() function from RTS takes a long time?

Other Parts Discussed in Thread: MSP430F2417

Hello Everyone,

I am using MSP430F2417 device and CCE v3.

I am working on a time critical code and While doing the profiling of the code we observed that the Sqrt() function from the RTS library takes approximately 1 ms to execute.
Is this much time justified? We are working with floating point numbers.

And is there any means to make the sqrt() execution faster, like adding any other advanced library into the project ? Or can we write a faster routine for taking the square root of a floating pont number?

Thanks!

  • In this age, with technology innovators such as Microsoft, an "advanced library" probably  requires a faster and newer hardware to do the same job slower and crashes more often. I would try the old Newton's method.

  • Hello!

    It depends on the data you are processing.

    If you want the best possible precision on a large range of data, I guess you have to

    spend time on calculation. Hint: search the net for "sqrt algorithm" and you will get

    some methods for a wide range of applications (size optimized, speed optimized, etc...)

    One important question: do you absolutely need floating point numbers?

    Recently, I needed a power spectrum for an FFT. I simply used a 4K values lookup

    table which gives a good approximation, anyway accurate enough for what I want to do.

    An it would fit in your the 2417's 92K flash.

    Pascal

     

     

**Attention** This is a public forum