*--------------------------------------------------------------------*  
*                            N E W T O N                             * 
*     A function  module to implement the Newton-Raphson method      *
*     for finding roots of equations.                                *  
*                                                                    * 
*     Variables Used:                                                *
*        P1 ....... Initial estimate of the solution                 *  
*        X1 ....... Successive estimates                             * 
*        Corr ..... The correction factor                            *
*        Epsilon... The desired tolerance                            *  
*        F ........ The function to be evaluated                     * 
*        DF ....... The derivative function                          *
*--------------------------------------------------------------------* 
                                                                      
      Real Function Newton( P1, Epsilon, F, DF )              
                                                                   
      Real P1, X1, Epsilon, F, DF, Corr                               
                                                               
      X1 = P1                             
      Corr = 2*Epsilon                     
                                                                    
*     Pass a line through (X1,F(X1)) with slope F'(X1) using the   
*     x intercept to improve the estimate of the zero until the   
*     correction to the zero estimate is less than the tolerance.
                                                                                
      Do While ( ABS(Corr) .GT. Epsilon )
         Corr = F(X1)/DF(X1)     
         X1 = X1 - Corr                 
      End Do                                                      
                                                                                
      Newton = X1                           
      End                                                             
