Can differentiation be defined for floating point numbers? Can differentiation be defined for floating point numbers (e.g. 32 bit floats or 64 bits doubles)?
I think one can have limit points in floating point numbers, I read somewhere that they have a discrete topology, and discrete topologies can be made coarser, and then limit points exist.
However when I tried using the c++ method for the closest bigger floating point number starting from zero the values did not seem to be stable. It usually goes like
: (NaN|Inf|0|explosions)....(0|explosions)...(close to zero| truncated/rounded values)...(wrong value, diffing by a small value)...(just plain wrong value|explosions) –
So i did not manage to create a cauchy sequence for the difference formula I used.
An approach I saw was using interval arithmetic, perhaps that is a suitable "coarser topology".
Can one define $\mathcal{C}^n$ differentiability over the floating point numbers?
 A: A simpler question is: how can you define the derivative of a function $f$ on the integers? Since differentiation is a local property, you can restrict your attention to finite intervals of integers like $\{0,...,n\}$ if you prefer.
There's an immediate problem: since differentiation is a local property, it should only depend on values sufficiently close to the input value $a$, for any definition of "sufficiently close", but on the integers (or the floating point numbers), as a direct consequence of discreteness, you can zoom in enough that there are no points sufficiently close to $a$ other than $a$ itself. So any line that passes through $f(a)$ is a perfect approximation of the function $f$ in this neighborhood, and so the derivative is degenerate - every number is a derivative of $f$ at $a$.
There are ways to circumvent this problem, but they all assume that there is some underlying continuous function that is being approximated by $f$. The function $f$ itself just doesn't have enough information in it to have a well defined derivative.
For example, if we "connect the dots" between $f(a-1),f(a),f(a+1)$ by a quadratic function, essentially making the best possible use of the directly neighboring information, we obtain the "central difference" numerical scheme for approximating the derivative at $a$, $$f'(a)\approx\frac12 (f(a+1)-f(a-1)).$$
In general, we often consider this as a function of the step size $h\in\Bbb R^+$, i.e. considering functions defined on $h\Bbb Z$ instead of just $\Bbb Z$. In this case we can say
$$f'(a)=\frac{f(a+h)-f(a-h)}{2h}+O(h^2)$$
whenever $f$ is a $C^2$ real function. Notice that the error bounds depend on there existing a smooth real function $f$ already, but the right hand side (without the error bound) can be evaluated on grid points, which is the function you actually have available.
This is just the beginning of the field of numerical analysis, which often uses techniques like floating point computation and tries to relate this to idealized mathematical functions and derivatives.
