Metropoli BBS
VIEWER: steff.all MODE: TEXT (ASCII)
                                                                                
     The following finds a solution to g(x) = x given an initial approximation  
p0, using the Steffensen's method.                                              
                                                                                
      'G' - this variable must contain the funtion to be evaluated              
            e.g. 'X^2-2*X+4'                                                    
                                                                                
   stack levels:  3: initial approximation                                      
                  2: tolerance level                                            
                  1: maximum number of iterations before aborting               
                                                                                
'STEFF'  [ A712 ]                                                               
                                                                                
<< 0 -> p0 tol n0 i                                                             
   << WHILE i n0 <= REPEAT                                                      
         p0 'X' STO G EVAL 'p1' STO                                             
         p1 'X' STO G EVAL 'p2' STO                                             
         p0 p1 p0 - DUP * p2 2 p1 * - p0 + / - 'p' STO                          
         IF p p0 - ABS tol < THEN                                               
            p { p X p1 p2 } PURGE ABORT                                         
         END                                                                    
         i 1 + 'i' STO                                                          
         i p p0 - ABS p p 'X' STO G EVAL 4 ->LIST SHON HALT DROP                
         p 'p0' STO                                                             
      END                                                                       
      'F'                                                                       
   >>                                                                           
>>                                                                              
                                                                                
     SHON simply turns shift key on.                                            
SHON                                                                            
                                                                                
  << # 1F8A7h SYSEVAL >>                                                        
                                                                                
     At each halt of the program a list containing                              
       - iteration step                                                         
       - error limit for this guess                                             
       - current solution                                                       
                                                                                
Simply press CONT to go on to next iteration step.                              
********************************************************************            
*       J.J.        *             JJL101@psuvm.bitnet              *            
*                   *    Penn State Center for Academic Computing  *            
*    John Lehett    *          Computational Mathematics           *            
********************************************************************            
[ RETURN TO DIRECTORY ]