Computational complexity of exponent vs arithmetic operation?
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2019년 1월 21일
0 개 추천
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
카테고리
도움말 센터 및 File Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!