solve x cos x using secant method