
def 		UpperCAmelCase     (      a_		)						->      int:







				"""simple docstring"""



				__A       =					abs(a_		)
				__A       =					0
				while n > 0:
								res += n % 1_0
								n //= 1_0
				return res


def 		UpperCAmelCase     (      a_		)						->      int:







				"""simple docstring"""



				__A       =					abs(a_		)
				return n if n < 1_0 else n % 1_0 + sum_of_digits(n // 1_0		)


def 		UpperCAmelCase     (      a_		)						->      int:







				"""simple docstring"""



				return sum(int(a_		) for c in str(abs(a_		)		)		)


def 		UpperCAmelCase     (      )						->      None:







				"""simple docstring"""



				from collections.abc import Callable
				from timeit import timeit

				def benchmark_a_function(a_						,  a_		) -> None:
								__A       =					F'''{func.__name__}({value})'''
								__A       =					timeit(F'''__main__.{call}'''						,  setup="import __main__"		)
								print(F'''{call:56} = {func(a_		)} -- {timing:.4f} seconds'''		)

				for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
								for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
												benchmark_a_function(a_						,  a_		)
								print()


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					benchmark()






'''simple docstring'''


from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
lowerCAmelCase_      :  List[Any]				     =  2_9979_2458

# Symbols
lowerCAmelCase_     ,   lowerCAmelCase_     ,   lowerCAmelCase_     ,   lowerCAmelCase_      :  Tuple				     =  symbols('ct x y z')



def  _SCREAMING_SNAKE_CASE     (      UpperCamelCase__    :					float				):




     """simple docstring"""


     if velocity > c:
          raise ValueError("""Speed must not exceed light speed 299,792,458 [m/s]!"""				)
     elif velocity < 1:
          # Usually the speed should be much higher than 1 (c order of magnitude)
          raise ValueError("""Speed must be greater than or equal to 1!"""				)

     return velocity / c



def  _SCREAMING_SNAKE_CASE     (      UpperCamelCase__    :					float				):




     """simple docstring"""


     return 1 / sqrt(1 - beta(UpperCamelCase__				) ** 2				)



def  _SCREAMING_SNAKE_CASE     (      UpperCamelCase__    :					float				):




     """simple docstring"""


     return np.array(
         [
             [gamma(UpperCamelCase__				), -gamma(UpperCamelCase__				) * beta(UpperCamelCase__				), 0, 0],
             [-gamma(UpperCamelCase__				) * beta(UpperCamelCase__				), gamma(UpperCamelCase__				), 0, 0],
             [0, 0, 1, 0],
             [0, 0, 0, 1],
         ]				)



def  _SCREAMING_SNAKE_CASE     (      UpperCamelCase__    :					float ,    UpperCamelCase__    :					np.ndarray | None = None				):




     """simple docstring"""


     if event is None:
          a_     :							str     						=  np.array([ct, x, y, z]				)  # Symbolic four vector
     else:
          event[0] *= c  # x0 is ct (speed of light * time)

     return transformation_matrix(UpperCamelCase__				) @ event


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 # Example of symbolic vector:
 lowerCAmelCase_      :  Union[str, Any]				     =  transform(2997_9245)
 print('Example of four vector: ')
 print(f"ct' = {four_vector[0]}")
 print(f"x' = {four_vector[1]}")
 print(f"y' = {four_vector[2]}")
 print(f"z' = {four_vector[3]}")

 # Substitute symbols with numerical values
 lowerCAmelCase_      :  Tuple				     =  {ct: c, x: 1, y: 1, z: 1}
 lowerCAmelCase_      :  Optional[int]				     =  [four_vector[i].subs(sub_dict) for i in range(4)]

 print(f"\n{numerical_vector}")
