What are some numerically stable forms of common mathematical expressions?

  • Thread starter Thread starter Kalimaa23
  • Start date Start date
  • Tags Tags
    Forms Stable
Click For Summary

Homework Help Overview

The discussion revolves around finding numerically stable forms of various mathematical expressions, specifically focusing on expressions that may lead to large rounding errors under certain conditions. The subject area includes numerical analysis and mathematical expressions involving exponential, hyperbolic, and logarithmic functions.

Discussion Character

  • Exploratory, Mathematical reasoning

Approaches and Questions Raised

  • Participants explore different mathematical expressions that are prone to numerical instability, such as e^x - e, sinh(x) - tanh(x), and log(x + sqrt(x^2 + 1)). Suggestions include using Taylor series expansions and analytical forms to address these issues.

Discussion Status

Some participants have offered specific transformations and tricks to rewrite the expressions in potentially more stable forms. There is an ongoing exploration of different approaches, but no explicit consensus has been reached regarding the best methods.

Contextual Notes

Participants note that the assignment requires analytical forms rather than numerical methods, which influences the direction of the discussion.

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.

[tex] e^{x}-e[/tex]

This has large rounding errors if x is close to 1

[tex] sinh (x) - tanh (x)[/tex]

Large errors for x close to 0

[tex] log(x+\sqrt{x^2+1})[/tex]

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.

[tex] e^{x}-e[/tex]

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.:
[tex]sinh(x)-tanh(x)=sinh(x)(\frac{cosh(x)-1}{cosh(x)})=2tanh(x)sinh^{2}(\frac{x}{2})[/tex]

Use a similar trick for 1, by noting [tex]sinh(y)=\frac{e^{y}-e^{-y}}{2}[/tex]
 
Last edited:
Thanks! This is just what I needed!
 

Similar threads

Replies
25
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 36 ·
2
Replies
36
Views
5K
Replies
3
Views
3K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 21 ·
Replies
21
Views
6K
Replies
41
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K