Magic Gem % formula
From Helbreath Portal
Average of the purities of the ingredients multiplied by 0.8 (80%).
For example, if you used a 100% crystalware, 89% diamondware, 67% diamondware, and a 100% Merien Stone (they are always 100%). Then your final completion would be 71% (71.2 rounded down)
or.... {(100 + 89 + 67 + 100 ) / 4 }* 0.8 = 71.2
Since this formula (taken from hbint's website) only allows for making items up to 80%, I believe that from 80% to 100% is done randomly.
Hint: Since Merien Stones are so expensive/rare and gems are free if you mine them, it is best to use only high % Gemwares when makeing Magic Gems and only 100% Crystalwares