
import string


def 							__A(lowerCAmelCase )		->				str:

		"""simple docstring"""






		_UpperCamelCase						    =	""""""
		for i in sequence:
				_UpperCamelCase						    =	ord(lowerCAmelCase )
				if 6_5 <= extract <= 9_0:
						output += chr(1_5_5 - extract )
				elif 9_7 <= extract <= 1_2_2:
						output += chr(2_1_9 - extract )
				else:
						output += i
		return output


def 							__A(lowerCAmelCase )		->				str:

		"""simple docstring"""






		_UpperCamelCase						    =	string.ascii_letters
		_UpperCamelCase						    =	string.ascii_lowercase[::-1] + string.ascii_uppercase[::-1]
		return "".join(
		    letters_reversed[letters.index(lowerCAmelCase )] if c in letters else c for c in sequence )


def 							__A()		->				None:

		"""simple docstring"""






		from timeit import timeit

		print("""Running performance benchmarks...""" )
		_UpperCamelCase						    =	"""from string import printable ; from __main__ import atbash, atbash_slow"""
		print(F'> atbash_slow(): {timeit("atbash_slow(printable)"						,  setup=lowerCAmelCase )} seconds' )
		print(F'>      atbash(): {timeit("atbash(printable)"						,  setup=lowerCAmelCase )} seconds' )


if __name__ == "__main__":
		for example in ("ABCDEFGH", "123GGjj", "testStringtest", "with space"):
				print(F"""{example} encrypted in atbash: {atbash(example)}""")
		benchmark()





from sympy import diff, lambdify, symbols
from sympy.functions import *  # noqa: F403


def 							__A(lowerCAmelCase						,  lowerCAmelCase						,  lowerCAmelCase = "x"						,  lowerCAmelCase = 1_0**-1_0						,  lowerCAmelCase = 1						,  )		->				complex:

		"""simple docstring"""






		_UpperCamelCase						    =	symbols(lowerCAmelCase )
		_UpperCamelCase						    =	lambdify(lowerCAmelCase						,  lowerCAmelCase )
		_UpperCamelCase						    =	lambdify(lowerCAmelCase						,  diff(lowerCAmelCase						,  lowerCAmelCase ) )

		_UpperCamelCase						    =	starting_point

		while True:
				if diff_function(lowerCAmelCase ) != 0:
						_UpperCamelCase						    =	prev_guess - multiplicity * func(lowerCAmelCase ) / diff_function(
						    lowerCAmelCase )
				else:
						raise ZeroDivisionError("""Could not find root""" ) from None

				# Precision is checked by comparing the difference of consecutive guesses
				if abs(next_guess - prev_guess ) < precision:
						return next_guess

				_UpperCamelCase						    =	next_guess


# 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
		# Find fourth Root of 5
		print(F"""The root of x**4 - 5 = 0 is {newton_raphson("x**4 -5", 0.4 +5J)}""")

		# Find value of e
		print(
		    "The root of log(y) - 1 = 0 is ",
		    F"""{newton_raphson("log(y) - 1", 2, variable="y")}""",
		)

		# Exponential Roots
		print(
		    "The root of exp(x) - 1 = 0 is",
		    F"""{newton_raphson("exp(x) - 1", 10, precision=0.0_05)}""",
		)

		# Find root of cos(x)
		print(F"""The root of cos(x) = 0 is {newton_raphson("cos(x)", 0)}""")



