This trick works only in Level 3 (The ice stage). As part of the algorithm to make the level "slippery", Fred's max speed oscillates on a 4-frame pattern: 20, 23, 26, 29, etc. If Fred fires a special weapon (Up + B) on the last frame of the pattern, the pattern is reset. This results in it ramping up from 29: 29, 32, 35, 38. Again, if Fred attempts to throw a special weapon it will reset again. This can be abused for unlimited speed. Note that this works even if Fred simply attempts to throw, he doesn't actually have to throw one.
Unfortunately this speed can not be maintained and he drops back to normal as soon as this trick is stopped. Also, the speed address is signed, so 127 is the maximum speed he can attain, so it has to be reset before this else he will wrap to -127 and fly backwards.