It'd probably be better to use the highest layer spawned as a function of rarity. Then, multiply that by the amount required for a recipe.
For example:
Coal Spawns highest at 70 (ish) layer
Copper spawns highest at 70 layer
Tin Spawns highest at 40 layer
Iron spawns at highest at 61 layer
Redstone spawns highest at 16 layer (but drops at least 4 units per ore)
Rubber spawns highest at layer 64 (sea level or higher pending biome), but has to be smelted/extracted before hand
Cobble/Sand/Glass is negligible due to cobblestone generation (thus equals 0)
So, layer 70 would become (1-.7) due to rarity. We can assume 1 in this sense because dirt/stone generation does not exceed layer 100 (and even when it does, it will not contain valuable materials in reference to the rarity calculation)...
Then, after taking rarity into consideration, you then multiply the amounts needed in order to craft, and add those into a sum..
So a Battery would be:
4 Tin (.6) + 1 copper cable (1/2 copper (.3)+ 1 Rubber (.36)) + 2 Redstone (.84/2) = 3.33 rarity
Keep in mind that this is taken from vMC tech level, as IC tech can easily skew the numbers quite a bit with ore duplication, dust crafting, and other means of eliminating cost of production. Also, Nether ores are NOT included into this calculation, as it's better to treat glowdust from its recipe form for rarity rather than it's Nether spawn frequency (this is due to how 'easy' it is to access the Nether for experienced players)...
Then a Generator would be Battery + 8 Refined Iron + Funance, |OR| 3.33 + 8*.39 + 0 = 6.45 rarity
Divive EU yield per tick by rarity, and you get 1.55 effectiveness for materials acquired. This, ofc, is not including materials consumed in the manufacturing of Refine Iron or the smelting of dust/ores, as those factors are changed in accordance to energy/tech production.