





from decimal import Decimal, getcontext
from math import ceil, factorial




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     str:

  if not isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('Undefined for non-integers'	)
  elif precision < 1:
    raise ValueError('Undefined for non-natural numbers'	)

  lowercase__			    =						precision
  lowercase__			    =						ceil(precision / 14	)
  lowercase__			    =						426880 * Decimal(10005	).sqrt()
  lowercase__			    =						1
  lowercase__			    =						13591409
  lowercase__			    =						Decimal(_SCREAMING_SNAKE_CASE	)
  for k in range(1	,		_SCREAMING_SNAKE_CASE	):
    lowercase__			    =						factorial(6 * k	) // (factorial(3 * k	) * factorial(_SCREAMING_SNAKE_CASE	) ** 3)
    linear_term += 545140134
    exponential_term *= -262537412640768000
    partial_sum += Decimal(multinomial_term * linear_term	) / exponential_term
  return str(constant_term / partial_sum	)[:-1]


if __name__ == "__main__":
      lowercase_					     =	50
      print(f'''The first {n} digits of pi is: {pi(n)}''')










from __future__ import annotations

import math
from collections.abc import Callable




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE = 100	,		)       ->     float:
  lowercase__			    =						x_start
  lowercase__			    =						fnc(_SCREAMING_SNAKE_CASE	)
  lowercase__			    =						0.0

  for _ in range(_SCREAMING_SNAKE_CASE	):
    # Approximates curve as a sequence of linear lines and sums their length
    lowercase__			    =						(x_end - x_start) / steps + xa
    lowercase__			    =						fnc(_SCREAMING_SNAKE_CASE	)
    length += math.hypot(xa - xa	,		fxa - fxa	)

    # Increment step
    lowercase__			    =						xa
    lowercase__			    =						fxa

  return length


if __name__ == "__main__":




      def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     str:
        return math.sin(10 * x	)

      print("""f(x) = sin(10 * x)""")
      print("""The length of the curve from x = -10 to x = 10 is:""")
      lowercase_					     =	10
      while i <= 100_000:
            print(f'''With {i} steps: {line_length(f, -10, 10, i)}''')
            i *= 10


