Computational complexity of exponent vs arithmetic operation?
Show older comments
Hi all,
I would like to know if the exponent operation is more computationally complex for the CPU compared to a normal addition, substraction, or multiplication?
Regards
Answers (1)
Walter Roberson
on 21 Jan 2019
0 votes
This is not a MATLAB question.
The question can be talked about from a theory standpoint, or from a practical standpoint.
From a theory standpoint, exp(), being a 1 to 1 function, could theoretically be implemented as a single lookup table, and therefore could be represented as taking constant time.
Some processors implement exp() in hardware, though it does not appear that any of the mainstream general purpose architectures do. NVIDIA offers __device__float __expf for base e exponentiation.
Otherwise you end up with a software implementation, which is what MATLAB uses. I do not know what algorithm MATLAB uses, but I see a polynomial approach is recommended: http://jrfonseca.blogspot.com/2008/09/fast-sse2-pow-tables-or-polynomials.html
1 Comment
Arif Ahmed
on 22 Jan 2019
Categories
Find more on Smoothing and Denoising in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!