Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

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

share|improve this question
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? –  Johannes Kloos Mar 30 '12 at 11:00
    
@JohannesKloos sorry I missed your comment. –  draks ... Mar 30 '12 at 11:10
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. –  Must Mar 30 '12 at 12:10
1  
Have you tried playing around with the Taylor expansion? –  Johannes Kloos Mar 30 '12 at 12:48
    
Thanks for mentioning Taylor expansion. I will try to see what can I do with the following functions: link –  Must Mar 30 '12 at 13:25
show 2 more comments

3 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
The step "Let t = t - floor(t)." will reduce the size, but the result will be incorrect. –  Must Mar 30 '12 at 14:20
    
@Must: Oops, I stated it wrong. In my actual code I had a different variable holding the floored part. Let me rewrite. –  Charles Mar 30 '12 at 15:06
add comment

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...

share|improve this answer
add comment

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

share|improve this answer
    
I suppose this is the best answer one can give under the circumstances, but I do hope we get some clarification from OP. –  Gerry Myerson Mar 30 '12 at 11:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.