Post Reply 
Looking for TVM formulas
04-03-2014, 01:22 PM (This post was last modified: 04-03-2014 01:34 PM by Dieter.)
Post: #18
RE: Looking for TVM formulas
(04-03-2014 01:10 AM)Manolo Sobrino Wrote:  
(04-02-2014 07:40 PM)Dieter Wrote:  ln 0,9 < z < ln 2 is all that's required. ;-)
With terms up to n = 9 the result has 11 valid digits.

You're right, lower bound is wrong for 11 digits. Yet I get 11 up to -0.38. Where did you get the analytical expression for the bounds? (yeah, I'm asking for "here be dragons" stuff Big Grin)

Simple: the basic idea of a dedicated ex—1 function is better accuracy than a simple ex minus one.

For x > 0 this is true if the result is less than one. And ex—1 < 1 means that x is less than ln 2.

For x < 0, ex—1 is something between –1 and 0. Results within [–1; –0,1] have full accuracy even without a dedicated ex—1 function. Which is required only for results > –0,1. Which means that x > ln 0,9.

So we only have to consider the interval from ln 0,9 to ln 2. Using the contiued fraction method up to n=9 this yields a largest error (at ln 2) of 3,6 units in the 12th place, i.e. 11 valid digits.

In all other cases a simple ex minus one will return exact results, so the approximation is not required.

For more details, visit Casio's Keisan calculator, set the accuracy to 22 digits and copy the following code into the "Expression" window:

Code:
approx = z/(1 - z/(2 + z/(3 - z/(2 + z/(5 - z/(2 + z/(7 - z/(2 + z/(9 - z/2)))))))));
exact = e^z-1;
err = approx - exact;
shift = 10^(-(1+int(log(abs(approx)))));
print(exact, approx, err*shift);

Press "Execute", and then enter -1, 0.02, 101 at the now appearing "Variable" input line below. You will get a table for z = –1 to +1 with the true value, the approximation and the error, expressed in units of the nth significant digit (i.e. 3,5E-14 means the approximation is off by 3,5 units in the 14th digit).

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


Messages In This Thread
Looking for TVM formulas - Dave Britten - 03-31-2014, 11:21 PM
RE: Looking for TVM formulas - Jeff_Kearns - 04-01-2014, 10:40 AM
RE: Looking for TVM formulas - Jeff_Kearns - 04-01-2014, 07:37 PM
RE: Looking for TVM formulas - Dieter - 04-02-2014, 12:21 PM
RE: Looking for TVM formulas - Dieter - 04-02-2014, 07:23 PM
RE: Looking for TVM formulas - Dieter - 04-06-2014, 07:46 PM
RE: Looking for TVM formulas - Dieter - 04-09-2014, 01:36 PM
RE: Looking for TVM formulas - Dieter - 04-02-2014, 07:40 PM
RE: Looking for TVM formulas - Dieter - 04-03-2014 01:22 PM
RE: Looking for TVM formulas - Jeff_Kearns - 04-04-2014, 09:44 PM
RE: Looking for TVM formulas - Dieter - 04-05-2014, 09:58 PM



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