Ah, maybe. But are you sure that the sum of:
f() + 3*g()
is enough to make the loop terminate?