You're using Newton's method to find the roots to
f(x) = g(x) → x ⁶ = cos(x)
Recast this as finding the roots to
h(x) = f(x) - g(x) = x ⁶ - cos(x)
First, get the tangent line approximation L(x) to h(x) at an arbitrary starting point x = x₀ ; in a small neighborhood of x₀, we have
h(x) ≈ L(x) = h(x₀) + h'(x₀) (x - x₀)
Find the root to the tangent line function:
0 = h(x₀) + h'(x₀) (x - x₀) → x = x₁ = x₀ - h(x₀)/h'(x₀)
x₁ is the first approximation of a root to h(x). Repeat the process - that is, take the tangent line to h(x) at x₁ to find the next approximation x₂, and so on - until you meet the required condition.
For the smaller root, take x₀ = -π/2 :
x₀ ≈ -1.5708
x₁ = x₀ - h(x₀)/h'(x₀) ≈ -1.31348
x₂ = x₁ - h(x₁)/h'(x₁) ≈ -1.11366
x₃ = x₂ - h(x₂)/h'(x₂) ≈ -0.982446
x₄ = x₃ - h(x₃)/h'(x₃) ≈ -0.928013
x₅ = x₄ - h(x₄)/h'(x₄) ≈ -0.920039
x₆ = x₅ - h(x₅)/h'(x₅) ≈ -0.919887
Stop at x₆ because |x₆ - x₅| ≤ 0.001.
For the larger root, you can start the process over with a different seed for x₀, such as π/2. But since h(x) is an even function and symmetric about the y-axis, the larger root will just be the same root with positive sign, 0.919887.