Sure. First it is important to keep in mind that this is just to discuss the efficiency of the whip. If we spend 30 food to get 60 hammers, at some point during the next 10 turns we need to get back that 30 food to prepare for a subsequent whip. However, excess food may be putting us into an unhappy state which is grossly inefficient and thus may be unwanted.
Therefore, my assumption was that each whip cycle will start and end with the same population level and stored food. If that assumption is met, then the net whipping production plus the tile production (food + hammers -2 for each tile) during the cycle will turn out to be exactly the total hammers produced during the cycle. Similarly when stagnating, since you are balancing your food to make it sum to 0, the total production of the tiles worked (in terms of food + hammers - 2 again) will give exactly the total hammers produced.
So if you are whipping away a couple of plains hills, but have to work grassland farms to regrow the population in time for a new whip cycle, you are losing more than the population-turns as you are sacrificing production efficiency during your regrowth. Your intuition about grassland farms being better than mined plains hills is based on your experience that those tiles are necessary to regrow from a whip which is true. That doesn't mean its a wonderful thing that you are having to sacrifice turns on a mined plains hill to work it.
Let me just do the math both ways on a city that has a grassland pastured pigs, unlimited mined plains hills, unlimited mined grassland hills, and unlimited grassland farms. Happy cap will be 6, population is 5 with 29/30 food stored. The non-whip option will work the pigs and nothing but mines, taking care to grow on the first turn by working enough of the grassland mines and then storing food or stagnating at population 6 either while working pigs and mines exclusively to get a total of 168 "production" (At least one of that production is food).
The whip option will whip 2 population immediately, work one turn of just pigs and farms to grow back to population 4, one turn of pigs, farm, mined plains, mined grassland to grow back to population 5 as efficiently as possible, then will work 7 turns of pigs and only grassland hills to store food while producing efficiently and finally one turn of pigs, a plains hill, and the rest grassland hills to get the last food necessary to complete the cycle, still while working as efficiently as possible. The total production (this one is all in hammers) is 174. So the net result of alot of micromanagement was a gain of 6 hammers. But note though that we did our regrowth in the most efficient way possible, front-loading all our inefficient farm usage to quickly remove lost population-turns, then moving back to mines as soon as possible to avoid further inefficiency. We have gained 6 production, and we can break it down as follows:
33 gained due to slavery (27 food transformed into 60 hammers)
12 population-turns lost (2 on whip turn when population 3 vs 5, 2 on second turn population 4 vs 6, 1 on each subsequent turn population 5 vs 6).
But we were whipping away mines which technically only produce a net gain of 2 per population-turn, so we should only be losing 24 production due to population-turns lost.
Ok, but now we are losing some due to the relative inefficiency of working the grassland farms. Each turn of grassland farm is losing one production compared to the mine we would be working at stagnation, so the three farm turns cost us 3 more production.
33 - 24 - 3 = 6 bingo.
Based on what I've observed, it appears DaveMcW's "rules" are generally applicable; and following them will result in a correct decision a majority of the time. Those kinds of rules make it simpler to comprehend and more likely to be helpful in a game than nearly any formula.
Just to play Devil's Advocate here: This is a city that is not "exceptional" but one that violates this rule of thumb. I think the idea of never whipping away a mined grassland hill with a happy cap of 6 is closer to being always wrong than always right if a city like this is an exception. Even more crazy is the idea that killing off a plains forest is somehow a bad thing at happy cap 6. You would have to work very hard to produce an example where that is true. These rules are based on the idea that these tiles are magical machines that take as input food and give as output hammers when in reality, they take as input population-turns and give as output production. When starting with a flawed assumption, the conclusions are flawed as well.