# L-15 MCS 507 Mon 25 Sep 2023 : integral4pi_cdeffun_apply.py

"""
This script applies the composite trapezoidal rule 
to the integral of sqrt(1-x^2) for x from 0 to 1,
to obtain an approximation for pi.
"""

from time import perf_counter
from integral4pi_cdeffun import integral4pi

START_TIME = perf_counter()
APPROX = integral4pi(10**8)
STOP_TIME = perf_counter()
print('pi =', APPROX)
ELAPSED = STOP_TIME - START_TIME
print('elapsed time = %.3f seconds' % ELAPSED)
