Let me introduce @12345ieee - guy who is just like me interested in maths and programming. He wrote (with little help of mine) really good version of spec and combine computation software. We're working now on 128-spec for mana gems, next will be (much harder) hopefully more efficient spec and combine for killgems. I'll post all results of our research here.
Below is link to git repository with high quality C code we use. Howto will be provided soon. git repository