


from __future__ import annotations

from collections.abc import Callable
def      UpperCAmelCase__		(UpperCamelCase_				,UpperCamelCase_				,UpperCamelCase_				,UpperCamelCase_ = 1_00				,):



     """simple docstring"""






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


if __name__ == "__main__":
 def      UpperCAmelCase__		(UpperCamelCase_							):



      """simple docstring"""






      return x**3 + x**2

 print("f(x) = x^3 + x^2")
 print("The area between the curve, x = -5, x = 5 and the x axis is:")
 _SCREAMING_SNAKE_CASE     :					Optional[Any]      =       10
 while i <= 10_00_00:
  print(f'''with {i} steps: {trapezoidal_area(f, -5, 5, i)}''')
  i *= 10








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available


_SCREAMING_SNAKE_CASE     :					Optional[int]      =       {"configuration_speech_encoder_decoder": ["SpeechEncoderDecoderConfig"]}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _SCREAMING_SNAKE_CASE     :					Optional[int]      =       ["SpeechEncoderDecoderModel"]

try:
 if not is_flax_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _SCREAMING_SNAKE_CASE     :					Dict      =       ["FlaxSpeechEncoderDecoderModel"]

if TYPE_CHECKING:
 from .configuration_speech_encoder_decoder import SpeechEncoderDecoderConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_speech_encoder_decoder import SpeechEncoderDecoderModel

 try:
  if not is_flax_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_flax_speech_encoder_decoder import FlaxSpeechEncoderDecoderModel

else:
 import sys

 _SCREAMING_SNAKE_CASE     :					List[Any]      =       _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




