Post Reply 
AriCalculator is a home made pocket calculator.
06-14-2017, 12:23 PM
Post: #32
RE: AriCalculator is a home made pocket calculator.
(06-13-2017 03:20 AM)Dan Wrote:  I'm thinking of implementing e^x next. Maclaurin series converges rapidly for x near 0, but what about for other values of x?

One option is to factorise the index, e.g. e^32 = (e^3.2)^10, calculating e^3.2 using the Maclaurin series and then raising the result to the power of 10.

Another is to use e^x = e^a (1 + (x-a) +(1/2)(x-a)^2 + ...), storing e^5, e^10,...,e^30 in memory and choosing the closest value for a, e.g. e^32 = e^30 (1 + (32-30) + (1/2)(32-30)^2+...).

Thoughts?

You can use a CORDIC algorithm to calculate the exponential function. This page gives C source code implementing the algorithm for a wide range of different functions. It should be faster than using the power series directly.

Nigel (UK)
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. - Nigel (UK) - 06-14-2017 12:23 PM



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