I'm having problem with a certain pretty basic Numerical Analysis problem. Its been a long while since I've done a problem like this, and I'm seriously out of practice, not to mention I cannot find my notes on this type of problem. I'm looking at something like this:
-Show how to evaluate the following expression in a numerically stable fashion:
1 / (1 + 2*x) - (1 - x) / (1 + x)
for abs(x) << 1
I see that if x < machine epsilon, the equation comes out to 1 - 1 = 0, and I need to fix that. I'm just having trouble remembering exactly how I go about doing that. If I combine the two terms into one, I get:
2*x / (2*x + 1)
Which I think would still come out to 0 if x is very, very small. Any tips on what I should do for my approach?
XI Wiki

