


import operator as op


A							:					List[Any]     						=     "scaler.pt"
A							:					int     						=     "pytorch_model"
A							:					str     						=     "random_states"
A							:					int     						=     "optimizer"
A							:					List[Any]     						=     "scheduler"
A							:					Tuple     						=     "pytorch_model.bin"
A							:					Tuple     						=     "pytorch_model.bin.index.json"
A							:					Dict     						=     "model.safetensors"
A							:					List[Any]     						=     "model.safetensors.index.json"
A							:					List[Any]     						=     "1.10.2"
A							:					Optional[Any]     						=     "py38"
A							:					Optional[Any]     						=     "4.17.0"
A							:					List[str]     						=     ["ml.p3.16xlarge", "ml.p3dn.24xlarge", "ml.p4dn.24xlarge"]
A							:					Any     						=     ["FULL_SHARD", "SHARD_GRAD_OP", "NO_SHARD", "HYBRID_SHARD", "HYBRID_SHARD_ZERO2"]
A							:					Union[str, Any]     						=     ["TRANSFORMER_BASED_WRAP", "SIZE_BASED_WRAP", "NO_WRAP"]
A							:					List[str]     						=     ["BACKWARD_PRE", "BACKWARD_POST", "NO_PREFETCH"]
A							:					List[str]     						=     ["FULL_STATE_DICT", "LOCAL_STATE_DICT", "SHARDED_STATE_DICT"]
A							:					Dict     						=     "2.0.1"
A							:					Tuple     						=     ["pdsh", "standard", "openmpi", "mvapich"]
A							:					Dict     						=     ["default", "reduce-overhead", "max-autotune"]

A							:					Optional[int]     						=     {">": op.gt, ">=": op.ge, "==": op.eq, "!=": op.ne, "<=": op.le, "<": op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
A							:					Any     						=     [
    "nnodes",
    "nproc_per_node",
    "rdzv_backend",
    "rdzv_endpoint",
    "rdzv_id",
    "rdzv_conf",
    "standalone",
    "max_restarts",
    "monitor_interval",
    "start_method",
    "role",
    "module",
    "m",
    "no_python",
    "run_path",
    "log_dir",
    "r",
    "redirects",
    "t",
    "tee",
    "node_rank",
    "master_addr",
    "master_port",
]

A							:					Union[str, Any]     						=     ["DEEPSPEED", "MULTI_GPU", "FSDP", "MEGATRON_LM"]
A							:					Any     						=     ["DEEPSPEED", "MULTI_XPU", "FSDP"]









from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff





def 	_lowerCAmelCase       (    _lowerCAmelCase      ,	_lowerCAmelCase      ,	_lowerCAmelCase = 10**-10 )						->	float:


						'''simple docstring'''






						__snake_case				=		a
						while True:
												__snake_case				=		Decimal(_lowerCAmelCase ) - (
												    Decimal(eval(_lowerCAmelCase ) ) / Decimal(eval(str(diff(_lowerCAmelCase ) ) ) )  # noqa: S307
												)
												# This number dictates the accuracy of the answer
												if abs(eval(_lowerCAmelCase ) ) < precision:  # noqa: S307
																		return float(_lowerCAmelCase )


# Let's Execute
if __name__ == "__main__":
	# Find root of trigonometric function
	# Find value of pi
	print(f'''The root of sin(x) = 0 is {newton_raphson("sin(x)", 2)}''')
	# Find root of polynomial
	print(f'''The root of x**2 - 5*x + 2 = 0 is {newton_raphson("x**2 - 5*x + 2", 0.4)}''')
	# Find Square Root of 5
	print(f'''The root of log(x) - 1 = 0 is {newton_raphson("log(x) - 1", 2)}''')
	# Exponential Roots
	print(f'''The root of exp(x) - 1 = 0 is {newton_raphson("exp(x) - 1", 0)}''')





