The formula for FPS is:
gametics / realtics * 35
So 2134 / 15115 * 35 = 4.94 FPS
(well, for the DOS version anyway. I assume the amiga version treats timedemos the same way)
A timedemo renders every frame in the demo and tells you how long it took (in realtics). Number of gametics will always stay the same for each demo file. During normal gameplay doom will skip frames to keep the speed up, this is why the timedemo is much slower than the actual game.