3

Stability (Numerical analysis)

Trying to apply the answer I saw in this question, a+x=a worked just fine with a+eps(a)/2. Suppose we have x^b+a=a, where b is a small integer, say 3 and a=2000. Then a+(eps(a))^3 or a+(eps(a)/2)^3 will always return number a. Can someone help with the measurement of x? Any way, even different from eps will do just fine.

p.s. 1938+(eps(1938)/0.00000000469)^3 is the last number that returns ans = 1.9380e+003. 1938+(eps(1938)/0.0000000047)^3 returns a=1938. Does that have to do with anything?

Community
  • 1
  • 1
GengisKhan
  • 65
  • 5
  • It look like a digit rounding problem ? Can you clarify your question, you want help to know why using epsilon ? Or something else ? – Vuwox Dec 12 '13 at 19:54

1 Answers1

3

x = (eps(a)/2).^(1/(b-eps(a)/2))

if b = 3,

(eps(1938)/2).^(1/(3-eps(1938)/2)) > eps(1938)/0.0000000047
lennon310
  • 12,503
  • 11
  • 43
  • 61
  • a=1938; b=3; x = (eps(a)/2).^(1/b) x = 4.8444e-005 a+x^3 ans = 1.9380e+003 I need a+x^3 to be sharply 1938. It would work for b=5, but not for b=3. Any suggestions? (Sorry for bad formatting, I'm only new in stackoverflow) – GengisKhan Dec 12 '13 at 20:14
  • try x=(eps(a)/2).^(1/(b-eps(a)/2)) , I updated the answer as well, thx – lennon310 Dec 12 '13 at 20:29