Calculating e^x1 on classic HPs

01122016, 06:12 PM
(This post was last modified: 01152016 02:12 PM by Dieter.)
Post: #6




RE: Calculating e^x1 on classic HPs
(01122016 01:41 AM)Thomas Klemm Wrote: Brilliant! Thank you very much. Indeed the idea behind this is rather trivial. I'd like to explain this method with an example. Assume x = 3,141592654 E6 and a 10digit calculator. Evaluating u = e^{x} with 10 digit precision yields u = 1,000003142 Accordingly, e^{x}–1 is evaluated as u1 = 0,000003142 But that's not e^{x} or e^{x}1. The correct values are e^{x} = 1,0000031415975888... e^{x}–1 = 0,0000031415975888... The 10digit result we got actually is not e^{x} but e^{ln u} = e^{3,141995064E6} (resp. this minus one). Simply because only e^{ln u} exactly equals u: e^{ln u} = u = 1,000003142000000... e^{ln u } – 1 = 0,000003142000000... So we got an exact result for an argument that is slightly off. Precisely, we want the result for an argument that it is off by dx = x – ln u Now the rest is easy. With the first terms of a Taylor series we get f(x+dx) ≈ f(x) + dx · f'(x) and thus: e^{x}1 ≈ e^(ln u)  1 + (x  ln u) · d[e^{x}–1]/dx = (u  1) + (x  ln u) · e^{x} ...and since u agrees with e^{x} to machine accuracy we finally get: e^{x}1 ≈ (u  1) + (x  ln u) · u That's it. Dieter 

« Next Oldest  Next Newest »

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