What are some numerically stable forms of common mathematical expressions?

  • Thread starter Thread starter Kalimaa23
  • Start date Start date
  • Tags Tags
    Forms Stable
AI Thread Summary
Numerically stable forms of mathematical expressions are crucial for minimizing rounding errors, particularly for functions like e^x - e and sinh(x) - tanh(x), which can exhibit significant inaccuracies near specific values. For e^x - e, a Taylor series expansion is suggested, although the assignment requires analytical forms. The expression sinh(x) - tanh(x) can be rewritten to reduce errors by using identities involving sinh and cosh. The discussion also touches on log(x + √(x^2 + 1), with no clear stable form provided. Overall, the conversation emphasizes the importance of finding stable formulations for these mathematical expressions.
Kalimaa23
Messages
277
Reaction score
1
Hi.

I have an assignment lying around, in which I have to find numerically stable forms of some expressions. A few still elude me, so I was wondering if someone might have a suggestion.

<br /> e^{x}-e<br />

This has large rounding errors if x is close to 1

<br /> sinh (x) - tanh (x)<br />

Large errors for x close to 0

<br /> log(x+\sqrt{x^2+1})<br />

No idea...
 
Last edited:
Physics news on Phys.org
Dimitri Terryn said:
Hi.

I have an assignment lying around, in which I have to find numerically stable forms of some expressions. A few still elude me, so I was wondering if someone might have a suggestion.

<br /> e^{x}-e<br />

This has large rounding errors if x is close to 1

did you try a Taylor series expansion, or is that not what's being asked for?
 
Yes, a Taylor expansion does seem obvious; but alas, the'yre asking analytical forms...
 
2.:
sinh(x)-tanh(x)=sinh(x)(\frac{cosh(x)-1}{cosh(x)})=2tanh(x)sinh^{2}(\frac{x}{2})

Use a similar trick for 1, by noting sinh(y)=\frac{e^{y}-e^{-y}}{2}
 
Last edited:
Thanks! This is just what I needed!
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...
Back
Top