@ned e=mc^2 isn't an algorithm, it's a statement of the relationship between 3 things, regardless of their values. This is separate from C being a constant regardless of your reference frame. You're confusing special and general relativity. One is a mathematical construction atop maxwell's equations, the other is a bunch of statements about the universe we live in.