Calculating e^x1 on classic HPs

01112016, 10:20 PM
(This post was last modified: 01112016 10:22 PM by Dieter.)
Post: #1




Calculating e^x1 on classic HPs
There is no doubt that the ln(1+x) and e^{x}–1 functions that appeared with the 41C are extremely useful as they allow more precise calculations for arguments close to zero, which otherwise would round to zero. The 15C Advanced Functions Handbook included a short routine for emulating ln(1+x) on calculators that no not feature this function, and another (IMHO slightly better) method has been posted in this forum.
On the other hand, the e^{x}–1 case seemed more challenging. Thomas Klemm posted a solution that included the hyperbolic sine for a short and elegant implementation of this function. However, not all HPs offer hyperbolic functions. Here is a method that should work on most classic HPs. I think it works fine but I did not do any extensive tests. So try it and see what you get. Coded in VBA, the algorithm is as follows: Code: Function expm1(x) On a classic HP it could look like this: Code: ENTER This returns e^{x} in Y and e^{x}–1 in X. What do you think? Dieter 

« Next Oldest  Next Newest »

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