From: JJL101@psuvm.psu.edu (J.J. Lehett)
Newsgroups: comp.sys.handhelds
Subject: Fixed Point Alg. (HP28)
Date: 28 Jan 90 01:08:50 GMT
Organization: Penn State University


      The following program gives you approximations of the roots of an
equation using the fixed point algorithm.....  if you have any questions
concerning this, just forward them to me.
      It takes as input an initial approximation, tolerance level, and a
maximum number of iterations until we stop the loop.
      Prior to executing the program, you must also store the function
to be evaluated in terms of X in variable G.
      Once run, the program will halt and output the iteration number,
upper bound on current error, and the current approximation.  It will
then turn on the shift key , enabling the user to hit one button to
CONTinue the program.

     Sample:

 '.5*(10-X:3):.5' 'G' STO Put function in variable G

 1.5        [ENTER]
 .00001     [ENTER]
 10         [ENTER]

 will turn out the next ten approximations of the function's roots, and
end with "Failed" since it did not find a root to within the tolerance
requested.

    Yes, you could just use SOLVE and come out with a quicker more exact
but just in case you need successively closer approximations...well ,
you be the judge of it usefulness.

FXPT    [643D]

<< 1 -> p0 tol n0 i
   << WHILE i n0 <= REPEAT p0 'X' STO
      G EVAL 'p' STO
      IF p p0 - ABS tol < THEN
         p { p X } PURGE ABORT
      END
      i 1 + 'i' STO
      i p0 p - ABS G EVAL
      3 ->LIST SHON HALT DROP
      p 'p0' STO
      END
      'Failed'
      { p X } PURGE
   >>
>>


SHON                       ; turn shift indicator on.

  << # 1F8A7h SYSEVAL >>
-------
-------
********************************************************************
*       J.J.        *             JJL101@psuvm.bitnet              *
*                   *    Penn State Center for Academic Computing  *
*    John Lehett    *          Computational Mathematics           *
********************************************************************
