Determining whether a function is exponential