I am trying to implement a numerical approximation, but first I need to define the function and its first derivative. This is my code for the first derivative:
It shows a mistake in the definition of y, as "invalid operands to binary expression (double and double)", but I can't really find where the mistake is, because having first defined the original function as:
^ is the XOR operator, not an exponentiation operator.
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.