
'''simple docstring'''

from __future__ import annotations

from collections.abc import Callable


def        UpperCAmelCase_ (  lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_ = 1_0_0      ,			):







 """simple docstring"""


 lowerCAmelCase__     :   Dict     		=	x_start
 lowerCAmelCase__     :   int     		=	fnc(lowerCamelCase_			)
 lowerCAmelCase__     :   str     		=	0.0
 for _ in range(lowerCamelCase_			):
  # Approximates small segments of curve as linear and solve
  # for trapezoidal area
  lowerCAmelCase__     :   Dict     		=	(x_end - x_start) / steps + xa
  lowerCAmelCase__     :   Dict     		=	fnc(lowerCamelCase_			)
  area += abs(fxa + fxa			) * (xa - xa) / 2
  # Increment step
  lowerCAmelCase__     :   Any     		=	xa
  lowerCAmelCase__     :   Union[str, Any]     		=	fxa
 return area


if __name__ == "__main__":


     def        UpperCAmelCase_ (  lowerCamelCase_			):







      """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:""")
     snake_case									=    10
     while i <= 10_00_00:
          print(f'with {i} steps: {trapezoidal_area(f, -5, 5, i)}')
          i *= 10







'''simple docstring'''

import os


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_doctest_list.py
snake_case									=    """."""


if __name__ == "__main__":
     snake_case									=    os.path.join(REPO_PATH, """utils/documentation_tests.txt""")
     snake_case									=    []
     snake_case									=    []
     with open(doctest_file_path) as fp:
          for line in fp:
               snake_case									=    line.strip()
               snake_case									=    os.path.join(REPO_PATH, line)
               if not (os.path.isfile(path) or os.path.isdir(path)):
                    non_existent_paths.append(line)
               all_paths.append(path)
     if len(non_existent_paths) > 0:
          snake_case									=    """\n""".join(non_existent_paths)
          raise ValueError(f'`utils/documentation_tests.txt` contains non-existent paths:\n{non_existent_paths}')
     if all_paths != sorted(all_paths):
          raise ValueError("""Files in `utils/documentation_tests.txt` are not in alphabetical order.""")





