Why should i do something like this:
inline double square (double x) { return x*x;}
instead of
double square (double x) {
The inline function, if the compiler complies, will include the inline function in the code in which it was called as if no function was called (as though you had put the logic in the calling function) and avoid the function call overhead.