def 					__lowercase						(    lowerCamelCase__			,					lowerCamelCase__ = 10_00       )					->str:

  '''simple docstring'''




  if (not isinstance(lowerCamelCase__			,					lowerCamelCase__       )) or (digit_position <= 0):
    raise ValueError("Digit position must be a positive integer"       )
  elif (not isinstance(lowerCamelCase__			,					lowerCamelCase__       )) or (precision < 0):
    raise ValueError("Precision must be a nonnegative integer"       )

  # compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
  # accurate
  a__  		=  (
      4 * _subsum(lowerCamelCase__			,					1			,					lowerCamelCase__       )
      - 2 * _subsum(lowerCamelCase__			,					4			,					lowerCamelCase__       )
      - _subsum(lowerCamelCase__			,					5			,					lowerCamelCase__       )
      - _subsum(lowerCamelCase__			,					6			,					lowerCamelCase__       )
  )

  # return the first hex digit of the fractional part of the result
  return hex(int((sum_result % 1) * 16       )       )[2:]
def 					__lowercase						(    lowerCamelCase__			,					lowerCamelCase__			,					lowerCamelCase__       )					->float:

  '''simple docstring'''




  a__  		=  0.0
  for sum_index in range(digit_pos_to_extract + precision       ):
    a__  		=  8 * sum_index + denominator_addend
    if sum_index < digit_pos_to_extract:
      # if the exponential term is an integer and we mod it by the denominator
      # before dividing, only the integer part of the sum will change;
      # the fractional part will not
      a__  		=  pow(
          16			,					digit_pos_to_extract - 1 - sum_index			,					lowerCamelCase__       )
    else:
      a__  		=  pow(16			,					digit_pos_to_extract - 1 - sum_index       )
    total += exponential_term / denominator
  return total


if __name__ == "__main__":
     import doctest

     doctest.testmod()


from collections.abc import Callable

_SCREAMING_SNAKE_CASE     =     Callable[[float], float]  # type alias for a real -> real function
def 					__lowercase						(    lowerCamelCase__			,					lowerCamelCase__			,					lowerCamelCase__			,					)					->float:

  '''simple docstring'''




  a__  		=  float(lowerCamelCase__       )
  while True:
    try:
      a__  		=  prev_guess - function(lowerCamelCase__       ) / derivative(lowerCamelCase__       )
    except ZeroDivisionError:
      raise ZeroDivisionError("Could not find root"       ) from None
    if abs(prev_guess - next_guess       ) < 10**-5:
      return next_guess
    a__  		=  next_guess
def 					__lowercase						(    lowerCamelCase__       )					->float:

  '''simple docstring'''




  return (x**3) - (2 * x) - 5
def 					__lowercase						(    lowerCamelCase__       )					->float:

  '''simple docstring'''




  return 3 * (x**2) - 2


if __name__ == "__main__":
     print(newton(f, fa, 3))

