Numerical Analysis Stability or Condition

60 Views Asked by At

Im not sure if its the right place to ask this question since it may be more of an informatics problem and I apologize if its the case:

I want to evaluate a certain function, $\frac{log(cos(x))}{x}$ on the interval $[0;10^{-7}]$ , I know that the function is equivalent to $\frac{1}{2x}log(1-sin^{2}(x))$ but when I draw them on matlab, on this interval, I get thisenter image description here

The red line is the $\frac{1}{2x}log(1-sin^{2}(x))$ form of the function, the blue line the $\frac{log(cos(x))}{x}$ form.

How can one explain this, do I have one form more well-conditionned than the other? Is it a stability problem?