The formulas I use have never failed me once:
G4 vs. G5:
There are two formulas, one for lower speeds, and one for higher speeds.
Lower clock speeds = 1.0GHz and less
Higher clock speeds = 3.0GHz and more
Between = Your best guess in the middle of the two...
At lower clock speeds, a G4 will beat a G5 by roughly 25%. This is because a G4 is more efficient than a G5 when it comes to actual processor cycles. Also, lower clock speeds tend to negate the G5s superior memory bandwidth.
Lo Clock G4 -> G5 Conversion: 1.0GHz G4 = 1.25GHz G5 (In Theory)
Higher clock speeds favor the G5 by 50%. At this point, data is usually forced to move in and out of memory faster because of the higher clock. Since the G4s memory bus is so much slower, it will start yielding diminishing returns at higher clock speeds. In other words, a 3GHz G4 will usually be much slower than a 3GHz G5 due to memory bandwidth!
Hi Clock G4 -> G5 Conversion: 3.0GHz G4 = 2.0GHz G5 (In Theory)
If you want some proof of this, try overclocking (experts only!) a G4 some time and comparing the speed to a comparably clocked iMac G5. Then you'll see why the G4 wasn't designed for higher clock speeds.
G4 vs. P4:
As jiggie2g and others have already mentioned, yes, a G4 at the same clock speed as a P4 is roughly 50% faster. This has been observed on lots of hardware from my PC using friends, so this formula is the most reliable.
G4 -> P4 Conversion: 1GHz G4 = 1.5GHz P4
So why does the P4 handily beat the G4? Brute force of a higher clock. The G4 is struggling to hit 2.0GHz, while the P4EE is 3.8GHz. But don't feel too bad, G4 users. The P4EE is very expensive, and is seems to be overclocked as it is. Why else would you need overclock quality components to use them?
G5 vs. P4:
For some reason, the G5 doesn't seem to be that much faster than the P4 in terms of raw clock speed. The G5 is fast, but its not THAT fast. It just feels like a 33% speed advantage to the G5.
G5 -> P4 Conversions:
2.0GHz G5 = 2.66GHz P4
2.5GHz G5 = 3.33GHz P4
2.7GHz G5 = 3.6GHz P4
Of course, a Power Mac G5 will naturally be faster in most tasks simply because it uses two processors. Multiprocessing is its main advantage. In other words, don't expect a G5 to beat a PC in games (mostly single-threaded). It won't.
AMD Processors:
The clever marketing gurus at AMD are actually pretty accurate about making their processor ratings, but only if you knock off 5% of their number. Yes, AMD is very clever to knock Intel's marketing back in their face.
4000+ AMD = 3.8GHz P4
3200+ AMD = 3.04GHZ P4
I don't even bother looking at the GHz of an AMD processor, because I consider it a waste of time. Using the P4 speed name -5% is easier and more accurate to me. Also note that the AMD costs much less than the equivalent P4.