Artificial intelligent assistant

Brent's algorithm > Use Brent's algorithm to find all real roots of the equation $$9-\sqrt{99+2x-x^2}=\cos(2x),\\\ x\in[-8,10]$$ I am having difficulty understanding Brent's algorithm. I looked at an example in wikipedia and in my book but the examples given isn't the same as this question. Any help will be greatly appreciated.

I would start by looking at the problem and trying to analyze it with other methods.

If we plot these two functions over the indicated range, we have:

!enter image description here

As you can clearly see, there are eight roots.

These are located at:

* x = -3.80962245582300...
* x = -2.08783181165642...
* x = -1.21128304795669...
* x = 1.49277841962787...
* x = 1.67831642586421...
* x = 4.17818286865309...
* x = 5.54381657586530...
* x = 6.64685888158733...



The original _Brent paper_ has the Algo based algorithm.

For Brent's method, of course, you are going to write:

$f(x) = -9 + \sqrt{99+2x-x^2} + \cos 2x , x\in [-8,10]$

Now, you would 'single step' through each line in the algorithm, test the conditional and continue until a root is found.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 8f7d7d46f3c079fffb69c8244ea8bb8f