Math.Pow has a result of type double. In line 218:
v[i] = (float)v2[i] * Math.Pow(factor.relative.linear, exponent);
it propagates to the multiplication, and causes an Argument Exception, since v[i] is of type float in this branch.
The line should be:
v[i] = (float)((float)v2[i] * Math.Pow(factor.relative.linear, exponent));