Computing the fixed point for $\cos x$

4.5k Views Asked by At

While studying about Compiler Design I came with the term 'fixed point'.I looked in wikipedia and got the definition of fixed point but couldn't get how fixed point is computed for $\cos x$ as said in fixed point.

It says that the fixed point for $\cos x=x$ using Intermediate Value Theorem.But I couldn't get how they computed the fixed point for $\cos x$.Do anyone know how they computed this?

1

There are 1 best solutions below

0
On BEST ANSWER

You have an equation as:

$$x = \cos x$$

We can write this as an iteration formula:

$$x_{n+1} = \cos x_n$$

We would choose a starting value and iterate it:

  • $x_0 = 0.75$

  • $x_1 = \cos x_0 = \cos(0.75) = 0.731689$

  • $x_2 = \cos x_1 = \cos(0.731689) = 0.744047$

  • $\ldots$

  • We arrive at a repeating sequence with $x = 0.739085$.

  • We would of course do this to whatever precision we needed (if the fixed point exists).

Check

Claim is that $x = \cos x$:

$$\cos(0.739085) = 0.739085$$

You can see more details in these notes that include this very example to high precision.