# Residue calculator
----
## Idea
- Enter a rectangular domain D, meromorphic function f, and tolerance tol
- Create small brackets on D, use Cauchy's argument principal with some 'rough' numerical contour integral algorithm on f to check for poles on each bracket. If CAP returns number less than -1 in a bracket, recurse this bracketing method on the bracket itself
- find zeros of 1/f using zero finding algorithm adapted to complex plane
- for each zero of 1/f:
        - define circular contour C around the zero (ensuring not to include other zeros)
        - split real and imaginary parts of integral*
        - calculate contour integral of f on C using 'accurate' numerical integration algorithm adapted for contour integration
- return [[zero1,res1],[zero2,res2],...]
## Methods
- balanced numerical differentiation adaptes for complex plane (bracketing method only)
- trapezoidal rule adapted for complex plane (bracketing only)
- Secant method adapted for complex domain
- Gaussian-Legendre quadrature adapted for complex domain

## Assumptions
- Meromorphic on dom
- poles are not close to zeros (hopefully)

## Caveats and mitigations
- Cauchy argument principal fails when an equal amount of zeros and poles fall within the same bracket; so brackets are chosen to be extra refined to hopefully avoid this possibility
- cauchy argument principal can be compitationally expensive (compared to intermediate value theorem); so bracketing procedure uses refined trapezoidal rule since precision is not important

## Advantages
- Cauchy argument principal can detect multiple poles that are closeby; my algorithm leveragea this by 'bracket recursion'

