The title is quite self-explanatory, input is given double value, and I want to add/substract the smallest amount possible.
Here's a very dirty trick that isn't actually legal and only works if your platform uses IEEE754 floats: The binary representation of the float is ordered in the same way as the float value, so you can increment the binary representation:
double x = 1.25;
uint64_t * const p = reinterpret_cast(&x);
++*p; // undefined behaviour! but it gets the next value
// now x has the next value
You can achieve the same effect entirely legally by doing the usual binary copy gymnastics to obtain a proper uint64_t value. Make sure to check for zero, infinity and NaN properly, too.