

'''simple docstring'''



from .hash_table import HashTable
from .number_theory.prime_numbers import is_prime, next_prime







class 		lowerCAmelCase__     (   lowerCAmelCase__      ):



 """simple docstring"""



 def __init__(	self      : List[str]      ,							*__SCREAMING_SNAKE_CASE      : int      ,							**__SCREAMING_SNAKE_CASE      : int    )						->				Union[str, Any]:


      """simple docstring"""




      super().__init__(*lowerCAmelCase_      ,							**lowerCAmelCase_    )
 def    UpperCAmelCase__	(	self      : Tuple      ,							__SCREAMING_SNAKE_CASE      : Optional[int]      ,							__SCREAMING_SNAKE_CASE      : Any    )						->				int:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE						     =   (
          next_prime(value % self.size_table    )
          if not is_prime(value % self.size_table    )
          else value % self.size_table
      )  # gt = bigger than
      return next_prime_gt - (data % next_prime_gt)
 def    UpperCAmelCase__	(	self      : Any      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : int      ,							__SCREAMING_SNAKE_CASE      : List[Any]    )						->				Dict:


      """simple docstring"""




      return (increment * self.__hash_function_a(lowerCAmelCase_      ,							lowerCAmelCase_    )) % self.size_table


 def    UpperCAmelCase__	(	self      : int      ,							__SCREAMING_SNAKE_CASE      : Dict      ,							__SCREAMING_SNAKE_CASE      : Tuple=None    )						->				List[str]:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE						     =   1
      __SCREAMING_SNAKE_CASE						     =   self.hash_function(lowerCAmelCase_    )

      while self.values[new_key] is not None and self.values[new_key] != key:
           __SCREAMING_SNAKE_CASE						     =   (
               self.__hash_double_function(lowerCAmelCase_      ,							lowerCAmelCase_      ,							lowerCAmelCase_    )
               if self.balanced_factor() >= self.lim_charge
               else None
           )
           if new_key is None:
                break
           else:
                i += 1

      return new_key









'''simple docstring'''



from __future__ import annotations

from collections.abc import Callable







def      a__ (						a__   ,					a__   ,					a__   ,					a__ = 1_00   ,					):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE						     =   x_start
     __SCREAMING_SNAKE_CASE						     =   fnc(a__		)
     __SCREAMING_SNAKE_CASE						     =   0.0

     for _ in range(a__		):
          # Approximates small segments of curve as linear and solve
          # for trapezoidal area
          __SCREAMING_SNAKE_CASE						     =   (x_end - x_start) / steps + xa
          __SCREAMING_SNAKE_CASE						     =   fnc(a__		)
          area += abs(fxa + fxa		) * (xa - xa) / 2

          # Increment step
          __SCREAMING_SNAKE_CASE						     =   xa
          __SCREAMING_SNAKE_CASE						     =   fxa
     return area


if __name__ == "__main__":







  def      a__ (						a__		):




       """simple docstring"""


       return x**3

  print('f(x) = x^3')
  print('The area between the curve, x = -10, x = 10 and the x axis is:')
  UpperCAmelCase				: Optional[Any]         =  1_0
  while i <= 1_0_0_0_0_0:
    UpperCAmelCase				: Union[str, Any]         =  trapezoidal_area(f, -5, 5, i)
    print(f"""with {i} steps: {area}""")
    i *= 1_0






