
from __future__ import annotations

from math import pi



def  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__				,    lowerCAmelCase__	):
					'''simple docstring'''

					if (inductance, frequency, reactance).count(0	) != 1:
										raise ValueError('''One and only one argument must be 0'''	)
					if inductance < 0:
										raise ValueError('''Inductance cannot be negative'''	)
					if frequency < 0:
										raise ValueError('''Frequency cannot be negative'''	)
					if reactance < 0:
										raise ValueError('''Inductive reactance cannot be negative'''	)
					if inductance == 0:
										return {"inductance": reactance / (2 * pi * frequency)}
					elif frequency == 0:
										return {"frequency": reactance / (2 * pi * inductance)}
					elif reactance == 0:
										return {"reactance": 2 * pi * frequency * inductance}
					else:
										raise ValueError('''Exactly one argument must be 0'''	)


if __name__ == "__main__":
							import doctest

							doctest.testmod()



from __future__ import annotations

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

from sympy import diff



def  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__				,    lowerCAmelCase__ = 10**-10	):
					'''simple docstring'''
					lowercase					=		a
					while True:
										lowercase					=		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)}')




