






"""simple docstring"""


from math import factorial, pi


def        UpperCAmelCase      (					a__     ,      a__ = 30 ):





						'''simple docstring'''






						if not isinstance(a__     ,      (int, float) ):
												raise ValueError('maclaurin_sin() requires either an int or float for theta' )

						if not isinstance(a__     ,      a__ ) or accuracy <= 0:
												raise ValueError('maclaurin_sin() requires a positive int for accuracy' )

						lowerCAmelCase   :Tuple						=			float(a__ )
						lowerCAmelCase   :int						=			theta // (2 * pi)
						theta -= 2 * div * pi
						return sum(
						    (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1 ) for r in range(a__ ) )


def        UpperCAmelCase      (					a__     ,      a__ = 30 ):





						'''simple docstring'''






						if not isinstance(a__     ,      (int, float) ):
												raise ValueError('maclaurin_cos() requires either an int or float for theta' )

						if not isinstance(a__     ,      a__ ) or accuracy <= 0:
												raise ValueError('maclaurin_cos() requires a positive int for accuracy' )

						lowerCAmelCase   :str						=			float(a__ )
						lowerCAmelCase   :Optional[int]						=			theta // (2 * pi)
						theta -= 2 * div * pi
						return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r ) for r in range(a__ ) )


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		print(maclaurin_sin(10))
		print(maclaurin_sin(-10))
		print(maclaurin_sin(10, 15))
		print(maclaurin_sin(-10, 15))

		print(maclaurin_cos(5))
		print(maclaurin_cos(-5))
		print(maclaurin_cos(10, 15))
		print(maclaurin_cos(-10, 15))







"""simple docstring"""


from math import loga


def        UpperCAmelCase      (					a__ ):





						'''simple docstring'''






						if a < 0:
												raise ValueError('Input value must be a positive integer' )
						elif isinstance(a__     ,      a__ ):
												raise TypeError('Input value must be a \'int\' type' )
						return 0 if (a == 0) else int(loga(a & -a ) )


if __name__ == "__main__":
		import doctest

		doctest.testmod()