def newton_raphson(
    func: str, a: float | Decimal, precision: float = 10**-10
) -> float:
    x = a
    while True:
        x = Decimal(x) - (Decimal(eval(func)) / Decimal(eval(str(diff(func)))))
        # This number dictates the accuracy of the answer
        if abs(eval(func)) < precision:
            return float(x)