



"""simple docstring"""

from math import factorial, pi




def __lowercase			(							_a		,			_a = 30    ):

    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'''    )

    snake_case_ :     Dict				=	float(_a    )
    snake_case_ :     Dict				=	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 __lowercase			(							_a		,			_a = 30    ):

    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'''    )

    snake_case_ :     Dict				=	float(_a    )
    snake_case_ :     str				=	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 functools import lru_cache




@lru_cache
def __lowercase			(							_a    ):
    if num < 0:
        raise ValueError('''Number should not be negative.'''    )

    return 1 if num in (0, 1) else num * factorial(num - 1    )


if __name__ == "__main__":
     import doctest

     doctest.testmod()





