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!