You might start by translating one of the formulas so it uses only .NET operators: [
^].
And, examine the functions in the System.Math .NET library to find equivalents to your use of [] and log_2: [
^]. If there is no .NET, or System.Math library, equivalent to the use of brackets in the formulas, then you'll have to find an equivalent, write one, or, perhaps, someone here can help.