From the source code:
intenergyPerWorkHere=(int)(_energyPerWork*(1-0.2*Math.min(yCoord-_bedrockLevel,128.0)/128.0))
If I read that right, and haven't screwed up my maths as usual, at 128 distance from bedrock you have the best possible discount of 20%, at 64 you have a 10% discount and at 0...