I searched Stack Overflow for the pros/cons of function-like macros v. inline functions.
I found the following discussion: Pros and Cons of Different macro function
It's the calls to pow() you want to eliminate. This function takes general floating point exponents and is inefficient for raising to integral exponents. Replacing these calls with e.g.
inline double cube(double x)
{
return x * x * x;
}
is the only thing which will make a significant difference to your performance here.