Category "numerical-methods"

up to 20% Numerical error or Bug in ten line code block [closed]

Rewriting a single tiny block of code of an application has yielded a considerable performance improvement. The code is 100% sequential, thus

Problem on Solving a 1D Navier Stokes with Compressible Mass Conservation (Hydraulic Damper)

I would like to solve a 1D Navier equation on a cylindrical imposed tubes(cartesian cordinates). The flow is along y direction, with right chamber having press

center of mass in each cell of N-dimensional rectilinear grid

I have an n-Dimensional rectilinear grid, such that the edges in each dimension i are given by x_i = {x[i, 0], x[i,1], ..., x[i, Ni-1], x[i, Ni]}, with N_i edge

Why does this naive solution to catastrophic cancellation not work?

I see on wikipedia that catastrophic cancellation is a phenomena where B~=A then A-B will have very high relative error compared to the true difference. I quite