<s>[INST] import numpy as np

def f(x):
    return np.sin(x)

def g(x):
    return np.cos(x)

def newton_raphson(x0, f, f_prime, tol=1e-2):
    while True:
        x = x0 - f(x0) / f_prime(x0)
        if np.abs(x - x0) < tol:
            return x
        x0 = x
\end{code}

The code snippet is attempting to implement the Newton-Raphson method for root finding. However, there is a mistake in the code. Can you correct it?[/INST]