So we tried developing a math class in C# and we did. Comparing results with the original math class for System.Math shows that we are always a little or a lot slower (trig methods particularly).
But the wonder comes when we are using basic methods like absolute value which does not contain loads of code apart from
if(value < 0) return -value;
else return value;
and still we are far behind.
I cannot make this abs method any smaller, using the ternary operator will not help either I guess.
Is it because the System.Math would be written in C? Would it go faster if we write it in native language, though it seems it won't change much I read. Finally, could a dll work faster than a class and if so why and if not… well why too?