if they are both the result of the exact same calculation they should compare absolutely equal.
You shouldn't even count on that.
What happens is that float and double are 32-bit and 64-bit values. But calculations are done in 80-bit registers. Sometimes these values must be stored to memory, in 32 or 64 bit precision, which slightly changes their value. So even though the calculations look the same in source code the resulting values might be a little different depending on whether certain registers were available.
A command such as Print, which also has to call a function to convert numbers to strings, may need to temporarily use some registers. It does look odd that this can affect a calculation before the call to Print. But I suppose the compiler is simplifying things by dealing with blocks of code when deciding what values can stay in registers.