Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap2_198111 - decus/20-0026/teul.doc
There are 2 other files named teul.doc in the archive. Click here to see a list.
SUBROUTINE TEUL

PURPOSE
   COMPUTE THE SUM OF FCT(K) FOR K FROM ONE UP TO INFINITY.

USAGE
   CALL TEUL(FCT,SUM,MAX,EPS,IER)
   PARAMETER FCT REQUIRES AN EXTERNAL STATEMENT.

DESCRIPTION OF PARAMETERS
   FCT	  - NAME OF AN EXTERNAL FUNCTION SUBPROGRAM USED.
	    IT COMPUTES THE K-TH TERM OF THE SERIES TO ANY
	    GIVEN INDEX K.
   SUM	  - RESULTANT VALUE CONTAINING ON RETURN THE SUM OF
	    THE GIVEN SERIES.
   MAX	  - INPUT VALUE, WHICH SPECIFIES THE MAXIMAL NUMBER
	    OF TERMS OF THE SERIES THAT ARE RESPECTED.
   EPS	  - INPUT VALUE, WHICH SPECIFIES THE UPPER BOUND OF
	    THE RELATIVE ERROR.
	    SUMMATION IS STOPPED AS SOON AS FIVE TIMES IN
	    SUCCESSION THE ABSOLUTE VALUE OF THE TERMS OF THE
	    TRANSFORMED SERIES ARE FOUND TO BE LESS THAN
	    EPS*(ABSOLUTE VALUE OF CURRENT SUM).
   IER	  - RESULTANT ERROR PARAMETER CODED IN THE FOLLOWING
	    FORM
	     IER=0  - NO ERROR
	     IER=1  - REQUIRED ACCURACY NOT REACHED WITH
		      MAXIMAL NUMBER OF TERMS
	     IER=-1 - THE INTEGER MAX IS LESS THAN ONE.

REMARKS
   NO ACTION BESIDES ERROR MESSAGE IN CASE MAX LESS THAN ONE.

SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
   THE EXTERNAL FUNCTION SUBPROGRAM FCT(K) MUST BE FURNISHED
   BY THE USER.

METHOD
   EVALUATION IS DONE BY MEANS OF A SUITABLY REFINED EULER
   TRANSFORMATION. FOR REFERENCE, SEE
   F.B.HILDEBRAND, INTRODUCTION TO NUMERICAL ANALYSIS,
   MCGRAW/HILL, NEW YORK/TORONTO/LONDON, 1956, PP.155-160, AND
   P. NAUR, REPORT ON THE ALGORITHMIC LANGUAGE ALGOL 60,
   CACM, VOL.3, ISS.5 (1960), PP.311.