/* newtontan.c -- Newton's method to solve tan(x) = x. Kincaid and Cheney Computer Exercise 3.2#1 Written October 15, 2012 for Math 701 by Eric Olson */ #include #include #include #define N 100 double phi(double x){ double t=tan(x); double f=t-x; double df=t*t; return x-f/df; } double newton(double x0){ double x[N]; x[0]=x0; int n; for(n=1;n