Computational complexity of exponent vs arithmetic operation?
Ältere Kommentare anzeigen
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
Antworten (1)
Walter Roberson
am 21 Jan. 2019
0 Stimmen
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 Kommentar
Arif Ahmed
am 22 Jan. 2019
Kategorien
Mehr zu Smoothing and Denoising finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!