You are trying to do something unkosher, though if you are sure you are deploying on a i386+ processor and using only IEEE double precision (which you
can configure with Windows compilers, though these days it is a whole new can of worms than it was with the x87 model — FP operations are
very different now), then you can, in fact, make some bitwise guarantees.
Either way, you are also doing something senseless. A floating point is not just an integer, and manipulating its bits is more complicated than messing with an integer’s bits. Bit reversal (of any kind) is useful for some integer operations, but only in very rare contexts for floating point values.
The algorithm you are using (and goofing up at the end of line 10) is called
“
Reverse an N-bit quantity in parallel in 5 * lg(N) operations”, and can be found explained here:
https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel
As written, it modifies a 32-bit value, which is a 32/8 = 4 byte object. Doubles are 8 bytes, unless they get on the FPU stack, when they are 10, or if they are managed via MMX instructions or the like, where you are SOL.
So... what exactly are you trying to accomplish?