- #1
Karlisbad
- 131
- 0
let be "A" a big number, my question is, is there an efficient algorith (with only a few steps) to evaluate [tex] e^{A} [/tex]
0rthodontist said:I'm certainly no expert on this, but you could get an order-of-magnitude approximation by taking the logarithm. Also, you could reduce the number of multiplications used in an exact answer to only log A by using the same technique used in RSA fast exponentiation.
No, not that technique, the one that splits up the exponent. It would take me some time to remember it but the basic idea is that if you have an exponent like 2n, it computes x^n and then squares it.NateTG said:The RSA thing only works for modular arithmetic.
0rthodontist said:No, not that technique, the one that splits up the exponent. It would take me some time to remember it but the basic idea is that if you have an exponent like 2n, it computes x^n and then squares it.
The goal, of course, is to get that "few minutes" down to "few milliseconds".cells said:* if your accuracy is only to a few sig figures , perhaps upto 10sig fig, then you can write a computer program to give you e^x where x is any number, the program if written well will not take very long to run, probably in the order of a few min max
If your exponent is a C integer, then there's a nice optimization you can do; you can simply precompute0rthodontist said:Yes, that's it. It's called "square and multiply" exponentiation.
The most efficient algorithm to evaluate exp(A) is the Taylor series expansion method, which involves breaking down the exponential function into a series of polynomial terms.
The Taylor series expansion method works by using the fact that the exponential function can be expressed as an infinite sum of power series, which can then be evaluated using the coefficients of the series.
The time complexity of the Taylor series expansion method is O(n), where n is the number of terms used in the series. This makes it a very efficient algorithm for evaluating exp(A) compared to other methods.
One drawback of the Taylor series expansion method is that it may not be accurate enough for certain values of A, especially when the number of terms used in the series is limited. In such cases, other methods such as exponential approximation may be more suitable.
Yes, the Taylor series expansion method can be used to evaluate exp(A) for complex numbers as well. However, the number of terms used in the series may need to be increased to achieve the desired accuracy.