3
$\begingroup$

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

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

  • 2
    I could give the answer $e^x - \lfloor e^x \rfloor$, but I suppose this is not what you are looking for. Why exactly do you need this expression, and in what form do you want it?2012-03-30
  • 0
    @JohannesKloos sorry I missed your comment.2012-03-30
  • 2
    I was looking for another function that calculate the fractional part without having to calculate $e^x$. $e^x$ will be very large for the given x. So, I need a function that gives approximately the same fractional part with smaller numbers while calculating the result.2012-03-30
  • 1
    Have you tried playing around with the Taylor expansion?2012-03-30
  • 0
    Thanks for mentioning Taylor expansion. I will try to see what can I do with the following functions: [link](http://www.wolframalpha.com/input/?i=E^x+Taylor+Expansion)2012-03-30
  • 0
    The Taylor series is the sum of x^n/n! for n = 0, 1, 2, ...; your link has an unrelated expansion.2012-03-30
  • 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
    The step "Let t = t - floor(t)." will reduce the size, but the result will be incorrect.2012-03-30
  • 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