Apart from growing to work more tiles, food is much better for production than hammers as well, because of slavery. You can turn 1 pop to 30 hammers with a whip, or 2 pop to 60 hammers. If city is size 5 and you whip it down to size 3 to gain 60 hammers, it takes 27 food to grow back to size 5 (with granary). So there you just got 60 hammers for 27 food, or in other words, 1>2
.
You're not completely wrong, but it's a little more nuanced than that. It'll depend on what your citizens would have been working during the time they're regrowing, and how long that regrowth time is.
Slavery will be better when you have a high growth rate, and the productivity of the tiles you're giving up is low. You also have to consider whether you're giving up commerce. Using slavery in a city that is working gems or towns will come with a large commerce cost. So the ideal situation in which to use slavery is when your growth rate is really high, and you don't have good production or commerce tiles to work with the people you're giving up.
Details are below, step-by-step in spoilers, but overall I'd say: If your growth is poor (like <4 growth overall) and the tiles you're working are good (I'd say each tile given up sum of food+production+(1/2 commerce) >4), use slavery less or not at all. Earliest example of this would be if you're working a bunch of river mines or all the tiles you're working have resources on them. If you're food rich and production + commerce poor, use slavery more. Another nuance that's not included below is if the upkeep cost of the city is high. This will favor slavery as well since lower populations have lower upkeep.
And it goes without saying to whip away angry or starving citizens.
Details below:
You get 2 hammers per food in a high growth, medium production situation (giving up grassy mines while working corn and flood plains). Obviously if you're giving up river tiles, this will come with some economic cost too.
Overall: We spend 20 food and 7 commerce to get 39 hammers.
Details of this example:
Spoiler :
So in our 5 pop analysis, let's say you have 1 river corn, 1 flood plains, 3 grassy hill mines next to a river. So at that point you were growing 6+2-1-1-1=+5... producing an extra 5 commerce, and total production is 1+0+0+3+3+3=10.
Let's say you hurry something and get 60 hammers. You want to regrow fast so you give up two mines.... I play on a different speed than you but I'm guessing it's 13 to get back to 4, then 14 more to get to 5.
So your new growth is +7, and it'll be 2 turns at pop 3. So you lose 12 hammers, lose 4 commerce, and gain 4 food (since you're no longer working people who need to be fed).
Next phase, you're working two out of three of the mines again, so you're growing at 6 with one excess from previous growth. 3 turns to grow back to 5. This time you lose 9 hammers, lose 3 commerce, and gain 3 food, and you're back to where you started except you've had whatever you whipped that whole time.
So we spend population from 27 food to get 60 hammers now, gain 7 food back over the next 5 turns, lose 21 hammers over the next 5 turns, and lose 7 commerce over the next 5 turns in this situation.
Overall: We spent 20 food and 7 commerce to get 39 hammers.
Let's say you hurry something and get 60 hammers. You want to regrow fast so you give up two mines.... I play on a different speed than you but I'm guessing it's 13 to get back to 4, then 14 more to get to 5.
So your new growth is +7, and it'll be 2 turns at pop 3. So you lose 12 hammers, lose 4 commerce, and gain 4 food (since you're no longer working people who need to be fed).
Next phase, you're working two out of three of the mines again, so you're growing at 6 with one excess from previous growth. 3 turns to grow back to 5. This time you lose 9 hammers, lose 3 commerce, and gain 3 food, and you're back to where you started except you've had whatever you whipped that whole time.
So we spend population from 27 food to get 60 hammers now, gain 7 food back over the next 5 turns, lose 21 hammers over the next 5 turns, and lose 7 commerce over the next 5 turns in this situation.
Overall: We spent 20 food and 7 commerce to get 39 hammers.
Now what if we were growing slowly? Let's say we had just one flood plain and one grassland farm? Overall: Spent 15 food and 12 commerce to get 24 hammers. So we get 1.6 hammers per food, while also spending 0.5 commerce per hammer. If you consider each commerce worth half as much as a hammer, and food to be worth at least as much as a hammer, then this would be a small net gain in this situation of 3 hammers, and represents the break point for slavery being useful.
Spoiler :
Growth starts out at +4 since we're working 1 mine, a flood plains, and a grassy farm.
Pop 3: 4 turns x 2 tiles (x 3 production x 1 commerce x gain 1 food). = - 24 production, - 8 commerce, + 8 food.
Now the growth is +3, and we're 16/27
Pop 4: 4 turns x 1 tile (x 3 production x 1 commerce x gain 1 food) = -12 production, -4 commerce, +4 food.
Overall: Spent 15 food and 12 commerce to get 24 hammers.
Pop 3: 4 turns x 2 tiles (x 3 production x 1 commerce x gain 1 food). = - 24 production, - 8 commerce, + 8 food.
Now the growth is +3, and we're 16/27
Pop 4: 4 turns x 1 tile (x 3 production x 1 commerce x gain 1 food) = -12 production, -4 commerce, +4 food.
Overall: Spent 15 food and 12 commerce to get 24 hammers.
Let's consider an extreme example. What if we had two copper plains hills by a river, one flood plains, two grassy farms (a food poor, production rich example): Overall: Spent 9 food and 9 commerce to gain 6 production. So this would be a particularly bad situation to use slavery, unless it's an emergency of some kind.
Spoiler :
Growth is now 6: 6, 12, 18
Pop 3: 3 turns x 2 tiles (x 6 production x 1 commerce x gain 2 food) = - 36 production, - 6 commerce, + 12 food
Growth is now 4: 22, 26, 30
Pop 4: 3 turns x 1 tile (x 6 production x 1 commerce x gain 2 food) = -18 production - 3 commerce, + 6 food.
Overall: Spent 9 food and 9 commerce to gain 6 production.
Pop 3: 3 turns x 2 tiles (x 6 production x 1 commerce x gain 2 food) = - 36 production, - 6 commerce, + 12 food
Growth is now 4: 22, 26, 30
Pop 4: 3 turns x 1 tile (x 6 production x 1 commerce x gain 2 food) = -18 production - 3 commerce, + 6 food.
Overall: Spent 9 food and 9 commerce to gain 6 production.
Finally a simple example at the other end of the spectrum: Give up 2 forested grassland with three corn resources. Now we spend 27 food for 57 hammers, for a ratio that actually is above 2 with no commerce lost (unless it made a difference in trade routes).
Spoiler :
Growth is 14 throughout
Pop 3: 1 turn losing 2 hammers.
Pop 4: 1 turn losing 1 hammer.
Pop 3: 1 turn losing 2 hammers.
Pop 4: 1 turn losing 1 hammer.