What is the best way to estimate the truncated exponential ?
$$f(x,k) = \sum_{n = 0}^{k} \frac{x^n}{n!} $$
By estimate I mean some kind of asymptotic and/or faster and simpler way to compute its value at least approximately. Something that requires less computation.
Im considering real $x$ here, in particular $x>0$ and large positive $x$.
I am aware of some ideas and of course they can be combined.
A few examples :
- There is "closed form " in terms of a ratio of (incomplete) gamma functions.
$$f(x,k) = \frac{\exp(x) \Gamma(k + 1,x)}{\Gamma(k + 1)}$$
However I rarely see a good estime for the incomplete gamma function with it.
It feels like turning the truncated exp problem into the truncated gamma problem.
- The highest term. And/or the term being closest to 1 gives some ideas. And similar ideas.
for instance we consider
$$y^m/m!$$ close to 1. so we know that terms beyond this $m$ th term contribute little value.
Similarly
$$y^l/l!$$ being the largest term for a given $x$. so we know that this $l$ th term contributes the most.
Related are theories like Wiman-Valiron.
https://en.wikipedia.org/wiki/Wiman-Valiron_theory
and the idea from " fake function theory " that approximately
$a_n < min[f(x)/x^n]$.
where $a_n$ is the n'th taylor coefficient.
See : https://sites.google.com/site/tommy1729/fake-function-theory
- For all x (in particular the small x) the taylor polynomial error terms ofcourse.
There are quite a few.
Lagrange remainder, Cauchy remainder, Schlömilch remainder (Cauchy and Lagrange belong to it), integral remainders , special case conditional remainders etc
- Tommy, my mentor, suggested this
$$f'(x,k) = f(x,k) - \frac{x^k}{n!}$$
So
the ratio $f'(x)/f(x)$ is not 1 and you get some kind of "local exponent" v ;
$$v = \frac{f(x,k)- \frac{x^k}{n!}}{f(x,k)}$$
giving some insight.
- truncating the limit , for large n : $(1+ x/n)^n$ and the alike.
My mentor often uses this when $x << n$ :
$$ \exp(x) = (\frac{n^2 + x/2 n + x^2/9}{n^2 - x/2 n + x^2/9})^n $$
(Notice $n^2 + x/2 n + x^2/9$ has no zero's on the real line)
what relates to padé approximation, least squares curve fitting and the simple facts $\exp(-x) = 1/\exp(x)$ and $\exp(x/n)^n = \exp(x) = = (1 + x/n + ...)^n$.
- Another idea might be to use Borel transforms.
Afterall we know
$$1 + x + x^2 + x^3 + ... x^u = \frac{x^{u+1}-1}{x-1}$$
Or say something like
$$e^{-y}\sum_{k=0}^{x-1}\frac{y^k}{k!}=\int_y^{\infty}e^{-t}\frac{t^{x-1}}{(x-1)!}dt$$
might help ?
- Maybe integrating some integrand that approximates $x^n/n!dn $ but has a closed form ?? Not sure what that would be.
etc etc
There are probably millions of ideas.
What is the best one ?
edit :
As talked about in the comment by HackR and myself , often the quality of approximation is dependant on the ratio $x/k$.
For instance
$$(1+x/n)^n$$
is equal to $2^n$ or equivalently $2^x$ when $x=n$.
When $n > 1 + x + x^2$ however it is pretty close to $\exp(x)$.
I think all methods above are better than this, but this example works very well as a good and clear example.
This is a limit example but sums and products and integrals can suffer the same situation.
How sensitive the connection $x$ to $k$ is in general is a difficult question.
It might suggest that an optimal method is a function of $x,k$ and $x/k$ or so.
I found this one
Maclauren series of $ (1+x)^{1/x} $
What naturally relates to
$$\lim_{x \to \infty} (1 + y/x)^x = \exp(y)$$
In particular for $y$ close to $1$ and $x$ growing.
Also related are these :
Partial sums of exponential series
And even more so
Evaluating $\lim\limits_{n\to\infty} e^{-n} \sum\limits_{k=0}^{n} \frac{n^k}{k!}$