How can I avoid using a loop if I have to raise a power to all elements in a vector?

vector[N] x;

vector[N] y;

real a;

y = pow(x, a) // does not work as pow takes only two real numbers

y = x^a // doesn’t work either

y = exp(a * log(x)) // may fail as some x are not always positive.