I am looking to find a numerical solution to the equation:
$$\frac{e^x}{2} = 1 + x + \frac{x^2}{2!} + \dots + \frac{x^{k-1}}{(k-1)!}$$
where $k$ is of the order of $10^7$, and the solution is accurate to at least 2-3 decimals. It is not hard to show that the equation has exactly one positive solution (just differentiate and use induction).
Roughly, it measures how good of an approximation is the Taylor expansion of $e^x$ upto $k$ terms. Thus, as $k$ increases, we can expect $x$ to increase as well, as the accuracy of the expansion increases farther from the origin. We can get an lower bound on $x$ by the Taylor's theorem on $e^x$, as the remainder here is $\frac{e^x}{2}$, so $\frac{e^x}{2} \leq \frac{e^x}{k!}x^k$ which implies $\sqrt[k]{\frac{k!}{2}} \leq x$. Thus by Stirling's formula, we see that the lower bound is almost $\frac{k}{e}$.
My first idea was to use binary search, by simply computing the entire function and checking its sign. I coded it up in Python, but unfortunately, it only works for values of $k$ upto about $1000$. Beyond that, the values get too big to fit in its numeric data type. I tried many other ways, like Newton's method which did not work out, amongst other things. The main problem here is I can't find a way to avoid computing the entire function (which will overflow). I have tried hard to solve it, but couldn't do it so hopefully you all can help.