Skip to main content
Share Your Experience: Take the 2024 Developer Survey
8 votes

Unexpected result when summing sorted (and unsorted) positive floating point numbers

Very interesting problem! I might have a partial answer. To start, I replicated a simple C++ demo that can reproduce the effect ...
Mikael Öhman's user avatar
2 votes

numerical schemes for 1D PDE: for smaller grid size there is an increased roundoff error, larger size more truncation, so sweet spot in between?

I think there are two types of error being conflated here. The first is that if you are using an $n$-th order spatial discretization and an $m$-th order temporal discretization then the total error is ...
whpowell96's user avatar
  • 2,548
2 votes

Is computing the 2-norm of a vector numerically stable?

The link says computing directly on a large vector could result in overflow in float64 type before taking the norm. However, if the values in the vector vary wildly, e.g., there is a huge value and ...
Yimin's user avatar
  • 188
2 votes

Oscillation in non-linear porous flow solved by finite difference

Thank you for the tip whpowell96, I did as you suggested and it works fine. I also got inspired by this question. Here is exactly what I've done: recast the two equations as one: $$\frac{\partial\rho}...
MaximeMaurice's user avatar
1 vote

Is computing the 2-norm of a vector numerically stable?

It is stable but perhaps not accurate. There is a decades-long series of papers that were published in ACM Transactions on Mathematical Software that describes algorithms for specifically this problem....
Wolfgang Bangerth's user avatar
1 vote

Intuition for relative error for vectors

Let $x \in \mathbb{R}^{n}\setminus \{0\}$ be a point and $\mathrm{\delta}x \in \mathbb{R}^{n}$ be a tangent vector at $x$. The relative error $||\delta x||_x := \frac{||\delta x||}{||x||}$ defines a ...
user357269's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible