How to realize exp() function or sigmoid() function

cancel
Showing results for 
Search instead for 
Did you mean: 

How to realize exp() function or sigmoid() function

Jump to solution
717 Views
maxxu
Contributor IV

Hi

   I want to implement the sigmoid function,but, It appears that the function does not exist in the library,

   I use the Automotive Math and Motor Control Library Set for NXP MC9S12ZVM devices.

   Does the exp()function exist in the library? or,How should I implement it with other tools

   This algorithm, I hope to have as fast calculation speed as possible。

                                                                                                thank you 

0 Kudos
1 Solution
679 Views
pachamatej
NXP Employee
NXP Employee

Hello,

if you don't care about CPU load, then I would follow standard programming patterns for math implementation. Otherwise, I'd recommend to calculate a lookup table offline (e.g. using MS Excel) and then use it in the MCU. Polynomial approximation is also an option. The two techniques mentioned can be realized with support of the AMMCLib (GFLIB_Lut1D and MLIB functions such as Mul, Add, etc.).

Best regards,

Matej

View solution in original post

2 Replies
680 Views
pachamatej
NXP Employee
NXP Employee

Hello,

if you don't care about CPU load, then I would follow standard programming patterns for math implementation. Otherwise, I'd recommend to calculate a lookup table offline (e.g. using MS Excel) and then use it in the MCU. Polynomial approximation is also an option. The two techniques mentioned can be realized with support of the AMMCLib (GFLIB_Lut1D and MLIB functions such as Mul, Add, etc.).

Best regards,

Matej

696 Views
maxxu
Contributor IV

Can someone help me?

0 Kudos