Implementation of simpson’s rule for integration
The following uses Newton’s Method to find square root.
It keeps record of how guess changes from one iteration to the next and stops when the change is a very small fraction of the guess.
A continued fraction representation of the tangent using J.H. Lambert’s formula:
where x is in radians.
k specifies the number of terms to compute: