# Tag Info

### C, Julia, Python, Maxima, Mathematica, ChatGPT and numerical errors

This function, as any similar hill, tent or hat functions, implements the expansion-and-folding scheme. This means that in the most benign interpretation you lose in each iteration one bit from the ...
• 6,109
Accepted

### Why do we usually not want the eigenvalues of non-symmetric matrices?

Stability under perturbations Let $E$ be a perturbation such that $\|E\| \leq \varepsilon$. If $A$ is symmetric, then the eigenvalues of $A+E$ are at a distance $\varepsilon$ from those of $A$. (Bauer-...
• 11.5k

### C, Julia, Python, Maxima, Mathematica, ChatGPT and numerical errors

I thought it would be interesting to see how the number of bits of precision affects the error. I wrote the following using arb, a library for interval arithmetic (and in particular a library that ...
Accepted

### Conserving Energy in Physics Simulation with imperfect Numerical Solver

There are a few ways to conserve energy during ODE integration. Method 1: Symplectic Integration The cheapest way that is to use a symplectic integrator. A symplectic integrator solves the ODE on a ...
• 12.3k
Accepted

### Is half precision supported by modern architecture?

Intel support for IEEE float16 storage format Intel supports IEEE half as a storage type in processors since Ivy Bridge (2013). Storage type means you can get a memory/cache capacity/bandwidth ...
• 2,126

• 1,391
Accepted

### Going back in time in an initial value problem

This is technically still an IVP if you do an appropriate change of variables. Given your time is between $t \in [t^*, 0]$, make a new time variable $\tau = -t$ so that $\tau \in [0, -t^*]$ and you ...
• 4,258

### What are the most important theorems in computational science?

You'll get everyone to give different answers to this question, and maybe that's alright. Here are some of my favorite ones: Taylor's theorem that a function (of sufficient smoothness) equals its ...
• 55.7k

### How to solve a second order differential equation (diffusion) with boundary conditions using Python

I have found that I must keep the value of dt near dx or the results become unstable This behavior you have noticed is known as the Courant–Friedrichs–Lewy (CFL) condition. Indeed, there are ...
• 1,114

### Accurate computation of logbinomial(x,y)

The proposed computation of $\ln{x \choose y}$ via the logarithm of the beta function does not give rise to catastrophic cancellation other than for cases where $y=0$, or $y =x$, which are easily ...
• 1,895

### Implementation of Monte-Carlo Integration

From Wikipedia: The naive Monte Carlo approach is to sample points uniformly on Ω[...] There is an implicit assumption here that a uniform distribution on $\Omega$ exists. It is well-known that such ...
• 2,636
Accepted

### Is it possible to proof a-b+b = a for all double floating-point numbers?

You can sometimes prove such results (or get counterexamples) using an SMT solver such as Z3 that supports floating point arithmetic. Here is a proof of a version of your theorem that says \$|((x+y)-y)-...
• 11.4k