Share Your Experience: Take the 2024 Developer Survey

# Tag Info

### 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 ...
• 1,008

### 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 ...
• 2,548

### 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 ...
• 188

### 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}...
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....
• 55.7k
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 ...
• 363

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