Part Number: TMS320F280025
Hello Champs,
Shall we have F28002x library demo codes for calculation such as cube root, fourth root, fifth root, etc? Thanks!
Best Regards,
Linda
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.
Part Number: TMS320F280025
Hello Champs,
Shall we have F28002x library demo codes for calculation such as cube root, fourth root, fifth root, etc? Thanks!
Best Regards,
Linda
Linda,
You can use the LOG2F32 and IEXP2F32 instructions to accomplish this.
For example, suppose x = y ^ 1/3, then log2(x) = 1/3 * log2(y). Log2(y) can be computed using the LOG2F32 instruction, division by 3 can be computed using the DIVF32 instruction. Then inverse log can be computed using the IEXP2F32 instruction, followed by another DIVF32 instruction to obtain the reciprocal.
Fourth root would be simpler in that you can just use the SQRTF32 instruction twice.
Thanks,
Sira