what's the hard part?!
just "convert" each operator in the form used by the language; e.g. multiplication is often *, division (fractions are divisions) with / .. and so on...
the other thing to care of is the operations order; follows the rules of math and "combine" them with that of the language in use, tipically they "imitate" the math ones.
so: look at the expression: there's a big fraction between a numerator N and denominator D, so first your expression is
f = (N) / (D);
we've written () to be sure of the right order of computation even when we'll "expand" N and D.
now let's do it, let's expand N first
N is 2 * (p/q)^(k-1)
this is straightforward for languages that have ^ (others use **, others pow .......)
it works since operator precedence is what we expect in most languages. in case it is not, we should add a () like
2 * ( (p/q)^(k-1) )
this (or prev one) is N and we can replace it in our "model" f = (N) / (D); the () around k-1 needed since we must delimit the exp, or the interpretation would be
A^k - 1 (the exp being k alone). without () around p/q, it would be read as
p/(q^(k-1)), i.e. a fraction where numerator is p, denominator is q^(k-1), which is wrong for us
D (denominator) is similarly "created" following the math expression
(r - 3*t)^(1/m)
and here too there's no surprise. replace instead of D and you've your f.
note: many langs when dealing with floating point costants prefer it is explicitly given; so numbers like 3 could become 3.0 more correctly; others may "cast" intergers to floating point "automatcally" but it depends on the type of vars like m or t... e.g. if m is integer, a language could compute 1/m as integer division, and likely it yields 0 (for m>1) ... if we say 1.0 instead, we force a floating point division, which is likely what we wanted.
conventions may vary a bit according to the language, but basically many shares the same ideas.