






"""simple docstring"""



import doctest
from collections import deque

import numpy as np



class 					a						:



    """simple docstring"""



    def __init__(     self: int       ):






         """simple docstring"""


         A__										=  [2, 1, 2, -1]
         A__										=  [1, 2, 3, 4]





    def 				UpperCamelCase	(     self: List[str]       ):






         """simple docstring"""


         A__										=  len(self.first_signal       )
         A__										=  len(self.second_signal       )

         A__										=  max(A_    ,						A_       )

         # create a zero matrix of max_length x max_length
         A__										=  [[0] * max_length for i in range(A_       )]

         # fills the smaller signal with zeros to make both signals of same length
         if length_first_signal < length_second_signal:
              self.first_signal += [0] * (max_length - length_first_signal)
         elif length_first_signal > length_second_signal:
              self.second_signal += [0] * (max_length - length_second_signal)
         for i in range(A_       ):
              A__										=  deque(self.second_signal       )
              rotated_signal.rotate(A_       )
              for j, item in enumerate(A_       ):
                   matrix[i][j] += item

        # multiply the matrix with the first signal
         A__										=  np.matmul(np.transpose(A_       )    ,						np.transpose(self.first_signal       )       )

         # rounding-off to two decimal places
         return [round(A_    ,						2       ) for i in final_signal]


if __name__ == "__main__":
 doctest.testmod()









"""simple docstring"""



from collections.abc import Callable





def  _snake_case     (    UpperCAmelCase_  :					Callable[[float], float]					,   UpperCAmelCase_  :					float					,   UpperCAmelCase_  :					float			):
     A__										=  a
     A__										=  b
     if function(UpperCAmelCase_			) == 0:  # one of the a or b is a root for the function
          return a
     elif function(UpperCAmelCase_			) == 0:
          return b
     elif (
         function(UpperCAmelCase_			) * function(UpperCAmelCase_			) > 0
     ):  # if none of these are root and they are both positive or negative,
          # then this algorithm can't find the root
          raise ValueError("""could not find root in given interval."""			)
     else:
          A__										=  start + (end - start) / 2.0
          while abs(start - mid			) > 10**-7:  # until precisely equals to 10^-7
               if function(UpperCAmelCase_			) == 0:
                    return mid
               elif function(UpperCAmelCase_			) * function(UpperCAmelCase_			) < 0:
                    A__										=  mid
               else:
                    A__										=  mid
               A__										=  start + (end - start) / 2.0
          return mid





def  _snake_case     (    UpperCAmelCase_  :					float			):
     return x**3 - 2 * x - 5


if __name__ == "__main__":
 print(bisection(f, 1, 1_0_0_0))

 import doctest

 doctest.testmod()






