Post Reply 
AriCalculator is a home made pocket calculator.
06-15-2017, 07:35 AM
Post: #35
RE: AriCalculator is a home made pocket calculator.
(06-15-2017 04:52 AM)Dan Wrote:  I wonder why they use e^-x = 1/e^x to change the sign?

My initial thought would be due to accuracy issues, with x < 0, the series alternates in sign. I've seen the same thing done in other implementations of \( e^x \).

You might want to consider using \( e^x = { \left( e^{\frac{x}{10}} \right) }^{10} \) since you are working in base ten. It would also be possible to reduce the threshold below 1, this will increase the rate of convergence of the series expansion, i.e. reduce x until \( x < \frac{1}{10} = x_{max} \) or even smaller. It becomes a balancing act between the costs of the preprocessing and the series computation. Accuracy loss can also come into play, so verify the algorithm on a desktop computer first.

You'll want to carry more digits than the result and ideally compute the series backwards using Horner's method. This means estimating the number of terms required in advance -- the worst case will be \( x = x_{max} \) and since the first term in the expansion is 1, you'll need an n such that \( 1 + \frac{{x_{max}}^n}{n!} \) stays 1.


Pauli
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: AriCalculator is a home made pocket calculator. - Paul Dale - 06-15-2017 07:35 AM



User(s) browsing this thread: 1 Guest(s)