The title is quite self-explanatory, input is given double value, and I want to add/substract the smallest amount possible.
How about:
x += fabs(x) * std::numeric_limits::epsilon();