How can I implement the following function in C#?
double F = 440.0 * Math.Pow(2.0, (n-49.0)/12.0);
440 * Math.Pow(Math.Pow(2, 1.0/12), n - 49)
440 * 12th root of 2 raised to n-49
= 440 * (2 ^ 1/12) ^(n-49)
= 440 * 2^(n/12) / 2^(49/12)
= 440 * 2^(n/12) / (2^4 * 2^1/12)
= 440 * ( 1 / 2^4 ) * 2^((n-1) /12)
= 8 * 55 * ( 1/16 ) * 2^((n-1) /12)
= 27.5 * 2^((n-1) /12)
so ....
double d = 27.5 * Math.Pow(2, (n-1) / 12.0)
And since 12th root of 2 = 1.0594630943592952645618252949463, then
double d = 27.5 * Math.Pow(1.0594630943592952645618252949463, (n-1))
so...
double d = 27.5 * Math.Pow(1.059463094359295, (n-1));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With