Agree The Lagrange remainder theorem is a great idea to use 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork
Re: News Project step #5, deadline Monday 2 December (Mike O'Donnell)
Re: Idea exp_xreal Analysis (Mark Kittisopikul)
Re: Idea Using Lagrange Remainder Theorem (Mark Kittisopikul)
Date: 2002, Nov 29
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

This is a great idea for making sure that the last term of the rounded-up Taylor approximation is large enough. We know that the value and all derivatives of e^x increase, so we can use the value at x=1 as an upper bound. As long as n+1 is even, x^(n+1) is nonnegative, so we don't need to worry about a positive correction for positive x vs. a negative correction for negative x. The only annoyance is that the value and all derivatives at 1 are e, rather than a nice rational. But we can probably do well with a reasonably crude upper bound on e.

Alternatively, we can pick some nice upper bound on the value and derivatives of e^x, and replace [-1,1] by an interval in which that bound holds. For example, on [-1,2/3] e^x and all of its derivatives are less than 2.

Using the rather crude bound e<11/4, and the Lagrange theorem, it appears that

1+x+x^2/2+x^3/6+x^4/24+x^5/120+x^6*11/2880
is a safe upper bound on e^x on [-1,1]. The difference between 11/2880 and 1/619 is just a bit more than .0022.

The idea of using the Lagrange theorem to choose a good order of approximation for ((exp_real xr) prec), depending on the size of xr and prec, is also very appealing, and might improve the efficiency. To make it work, you need a very efficient procedure to compute the Taylor expansion up to a chosen order, making sure not to repeat any multiplications unnecessarily. You also need to think about the interaction between the scaling factor and the order of the Taylor expansion. A very superficial idea of the interaction may be enough, but you shouldn't ignore it.

But, don't stack all of your hopes on this approach. Notice that the effect of higher-order Taylor expansions on the numerators and denominators of rational approxmiations is similar to the effect of raising them to the power of the scale factor. Higher-order Taylor expansion is a great idea to try, but in the end we may find that the key to efficiency lies elsewhere.




Mike O'D.


to: "The Lagrange remainder theorem is a great idea to use"