3
$\begingroup$

Given a real positive number $x\in\mathbb{R^+}$.

What is the function of the fractional part of $e^x$?

  • 0
    I was trying to mention another page. For this query: "E^x Taylor Expansion". It contains it under "Series representations".2012-03-30

3 Answers 3

2

As Johannes Kloos suggests, you can use the Taylor expansion. Here's the straightforward application; there may be better ones.

Let s = 0 and t = 1. Start a loop with n = 1, incrementing by 1 each time.   Let t = t * x / n.   If t is sufficiently small, exit the loop.   Let s = s + (t - floor(t)).   If s > 1, let s = s - 1. Return t. 

Essentially all the rounding error comes from the t - floor(t). Some numerical analysis should give the maximum size of t and hence the number of significant digits in t - floor(t); this, in turn, gives an idea of what "sufficiently small" means.

  • 0
    @Must: Oops, I stated it wrong. In my actual code I had a different variable holding the floored part. Let me rewrite.2012-03-30
3

Suppose $x$ is between $100$ and $101$. To compute even one significant figure for the fractional part of $e^x$, you will need to know $x$ accurate to about $44$ significant figures...

2

The Fractional part of $e^x$ is given by $\text{frac}(e^x)=e^x-\lfloor e^x\rfloor.$

  • 0
    I suppose this is the best answer one can give under the circumstances, but I do hope we get some clarification from OP.2012-03-30