You are on page 1of 60
MoN Il SC-¥~69-336 BES: A ROUTINE FOR THE EVALUATION OF CYLINDRICAL BESSEL FUNCTIONS R. D. Halbgewachs, 9422 Sandia Laboratories, Albuquerque October 1969 ABSTRACT BES evaluates the Bessel functions J,(x), ¥,(x), I(x), and K(x) for real arguments and integer orders. The functions J,(x) and I, (x) may have positive or negative arguments, while the functions Y,(x) and K,(®) are restricted to positive arguments. The order for each of che functions may be positive or negative. In addition, the Hankel func- cions (1) (x) and H(2)(x) may be determined through the use of this routine. 1-2 FOREWORD ‘The Sandia Laboratories Mathematical Program Library consists of a number of dependable, high-quality, general-purpose, mathematical couputing routines. The standatds established for the library require that these routines be mathematically sound, effectively implemented, extensively tested, and thoroughly documented. This report documents one such routine. ‘The library emphasizes the effective coverage of various distinct mathematical areas with a minimum number of routines. Nevertheless, it may contain other routines similar in nature but complementary to the one described here. Additional information on the mathematical program library, a description of the standard format for documenting these routines, and a guide to other routines in the library are contained in SC-M-69-337. ‘his report is also identified within Sandia Laboratories as Computing Publication 4.0004/ALL. The routine was originally documented in July 1968. ‘This report and its corresponding Library routine are expected to be available from COSMIC shortly after publication. CONTENTS Page _ ieee 5 et Goctgromd 5 1.2 Applicable Programming Languages and Gomputer Systems ve ee ee te OS 1.3 Considerations Regarding Use ...-. +... ee eee 6 2. Usage 2c ee ee ee ee ee we eee eee ew rete bs - cS a ee area eee = 2.2 Description of ‘Arguments Se 7 2.3. Restrictions Between Arguments ... ++... ee 9 2.4 Principal Uses with Examples ....--..--+- 9 2.5 Library Routines Explicitly Required .......- 10 2.6 User-Supplied Routines Required... - 222222 10 2:7 Cautions and Restrictions... 1.27700 2272 10 2.8 Error Conditions, Messages, and Codes. ......-+ UL 3. Mathematical Methods... 6 ee et ee ee ee eee ee 1D 3.1 Statement of Problem .. 1.2222 ee veeeee 1 BE?) MachodeiUsed gg | io 313 Mathematical Range and Domain» > 122 220 ay 3.4 Equations and Discussion ...... ++ ++eee ee 1 3.5 Error Analysis, Bounds, and Estimates. .......- 18 OG) pees © Ss. Space, Time, and Accuracy Considerations ..--...+++ 19 | Testing Methods 2 80 G1 General + 20 6.2 Kinds of Tests Used |‘ a 6.3 Normal Cases Tested . * 22 6.4 Difficult Cases Tested 22 6:5 Range, Error, and Fault +23 Z| fee ee el Sil Cereiticatton fg Reforaiees ee APPENDIX A ~~ The BES Listing 2. --- + eee eee ee eee 25 APPENDIX B ~~ Control Data 3600 Version of BES... -+...-+ 37 APPENDIX C -- Control Data 6600 Version of BES. ..---.-- 49 APPENDIX D -- Control Cards for Using BES on the CDC 3600 ... 61 . APPENDIX E -- Control Cards for Using BES on the CDC 6600... 65 BES: A ROUTINE FOR THE EVALUATION OF BESSEL FUNCTIONS 1. Introduction 1.1 Background Each of the routines previously used at Sandia for the computation of Bessel functions for real arguments and integer orders had certain drawbacks. Some were limited to orders of zero and one, some were vague about ranges of application, and some did not indicate the accuracy of the functions; none of them organized the most commonly used functions into one routine. BES was developed to provide an accurate, clearly defined, multifunction routine. ‘The routine by Gilbert and Baker, although it was limited to evaluating J,(x) and 1,,(x) and had several drawbacks, did serve as the basis to begin writing the essentially new BES routine. Some of the ideas used by Gilbert and Baker were incorporated during the programming. 1.2 Applicable Programming Languages and Computer Systems ‘The programming language is a common subset of Control Data 3600 FORTRAN and Control Data 6600 FORTRAN. Applicable computing systems are the Control Data 3600 Tape SCOPE and Control Data 6600 SCOPE. In each of these systems the BES routine is maintained in a library file for the convenience of the user. ‘The routine is accessible by means of a few machine-dependent control cards which are described in Appen- dices D and E. 1.3 Considerations Regarding Use When discussing Bessel functions, there are two variables that must be considered. Using the notation £, (x) to represent a Bessel function, we refer co x as the argunent of the function f and n as the order of the function. The routine BES is designed to make function evaluations for one argument at a time. For each argument, however, the user cart request that the routine return values for either a single, particular order or a range of orders, For example, suppose we wish to evaluate a function of argument x for all integer orders between 0 and n. By providing che routine with the largest order needed, in this case, n, then the values oO)» € G0. s..5 fy) will be recumed in an array of the calling sequence. Let the array be named Tl. In this array we would then have TLC) = fo(x), TL(2) = £,(x), «++, That) = £,(x). At the same time, the array element Tl(n+1) is equated to anocher member of the calling sequence, say RSLT1, and this value is returned also. This provides the user with. the feature of requesting a function value for a single order and having that value returned directly into his variable nane in the calling sequence. Hence, the user can avoid the problem of equating a particular variable name to an array element later in his own roucine. To help clarify this point, suppose we request a value be returned for a function of argument x and a specific order k, Then the value k would be entered in the calling sequence as the maximum order needed and the returned value for £. (x) would be in RSLT1. (Note that this value could also be found in che array element Tl(k+1) and furrhermore, all integer orders between 0 and k would also be available in the array Tl.) This routine is restricted to real arguments and integer orders (positive, zero, or negative) and cannot be used for arguments or orders beyond these restrictions. For the functions ¥, (x) and K,(x), negative arguments may produce complex results. Since the output of BES is assumed to be real, negative argutents for these two functions are not permitted. A complex Bessel function routine (BESSEL) has been devel- oped for the Sandia Mathematical Program Library and will soon be released. By using J, (x) and ¥,(x), che Hankel functions #1) (x) and (2) Gx) may also be calculated by the user (see Section 3). 2. Usage 2.1 Entry The calling sequence is: CALL BES(X,NO,KODE,RSLT1,RSLT2,T1,T2,IERR) 2.2 Description of Arguments, In the following discussion we will refer to an argument which must be preset to some value by the caliing program prior to the call of the subroutine as an input argumenc. An argument which will return with a value determined in the called subroutine is referred to as an output argument. BES does not have any dual purpose arguments, i.e., input data becomes replaced by output data. Each of the input arguments can appear as either a variable name, a constant, or an expression, but an output argument can only appear as a variable name (includes array names). Examples of calling sequences are given in Section 2.4. X + input, type real, the Bessel function argument. Specific restrictions on the argument ranges for each of the func- tions are machine dependent and are described in Appen- dices B and C. NO - input, integer order of the function desired for a single value to be returned, or the maximum order desired if an array of values is to be returned. Restrictions on the magnitude of the order are dependent upon the magnitude of the argument, X, and are described in Appendices B and C. KODE - input, an integer indicator for the particular function (Eunctions) to be computed. KODE function J,,(x) only function Y, (x) only Jy (x) and Y, (x) function I, (x) only function K, (x) only T(x) and K(x) RSLT1 - output, type real, contains the function value for J,(x) or I(x) corresponding to the order NO and argument X supplied, depending on the KODE value. I£ KODE = 11 or 21, RSLT1 contains no computed results. RSLT2 - output, type real, contains the function value of : Yq (x) or K(x) corresponding to the order NO and argument X supplied, depending on the KODE value. : If KODE = 10 or 20, RSLT2 contains no computed results. TL - output, type real, is a work area within BES which will return with the array of function values for J,.(x) or I, (x) of orders zero through NO. Tl must be dimen- sioned in the calling program and aust contain at least M cells of storage where Mos max [INO/, int (21x1)} + 51. * Upon return from the subroutine, T1(1) = value for O function of order zero, ..., T1(NO+1) = value for function of order NO. 12 = output, type real, is similar to Tl for the functions ¥,(*) and K, (x). An exception is that if T2 is not to be used (only J,,(x) or I, (x) called), then T2 may have a dimension of 1 since the parameter must still appear in the calling sequence. Otherwise, T2 must be dimen- sioned at least M. TERR - output, an integer indicator to the calling program that an error condition exists. IERR normally has the value 1, and a value greater than 1 indicates an error condition. Error codes and descriptions are listed in Section 2.8. 2.3 Restrictions Between Arguments The bounds on the maximum absolute order, Int, that can be re- quested for a function evaluation are interrelated to the magnitude of the argument for that function, These interrelated restrictions on order and argument ranges are provided in Appendices B and C. The re- strictions shown in these appendices are checked by the routine and any violation will cause an error condition. In this routine, it ts necessary that each of the output argu- ments be distinct from any of the other arguments. 2.4 Principal Uses with Examples (a) Problem: Given an argument x and order n, find J, (x). Example: Consider n= 2, x = 1.5. We must define the dimension of Tl to be at least M= 54 and T2 will have a dimension of 1. DIMENSION T1(54), T2(1) X= 1.5 CALL BES(X,2,10,RSLTL, RSLT2,T1,12, IERR) Then RSLTL = Jy(1.5). (b) Problem: Given an argument x and largest order N, find Ig (x), 11 (x) s+--sTy(x)- Example: Consider N= 20, x = -40.0. We must define the dimension of Tl to be at least M= 131 and 12 will have a dimension of 1. DIMENSION T1(131), T2(1) No = 20 CALL BES(-40.0, NO, 20,RSLT1,RSLT2,T1,T2,1ERR) Then TL(L) = Ig (-40.0),-..,TL(2L) = Ty9(-40.0)- (c) Problem: Given an argument x and largest negative order ON, find Jy) and YC)» Yay 6) 90 Yi Ge) Example: Consider N = 30 and x = 4.6. Suppose that the parameter KODE takes on different values in the calling program according to different sections of the program. In this particular instance we have KODE = 12. We must dimension both Tl and T2 with at least M = 81. DIMENSION T1(81), T2(81) X= 4.6 CALL BES (X,-30,KODE,RSLT1,RSLT2,T1,72,IERR) Then RSLTL = J_y9(4.6) and T2(1) = ¥p(4.8),-++,T2(31) = ¥_go(4-8). 2.5 Library Routines Explicitly Required The standard Fortran subroutines used are LABS, ABS, IFIX, EXP, ALOG, and SQRT. In addition, the mathematical library routine ERRCHK? is used to process error codes and messages. 2.6 =Suppli wired BES does not require any user supplied subroutines. 2.7 ions a iction: The error conditions are tested in the routine prior to any major computation, and therefore the output arguments do not contain meaning- ful results upon an error return. In addition, failure to provide sufficient core storage in the dimensioning of the arrays Tl and T2 is not checked by the routine and should this problem arise, the routine will execute improperly. 10 2.8 01 ditions, Mes. ode Error conditions except improperly dimensioned arrays (Tl and T2) are reflected in the parameter IERR of the calling sequence. Error messages are processed by the error routine ERRCHK” and unless preset by the user by a call to the routine ERRSET, messages are printed, and all error conditions checked are considered fatal. If the user desires, error conditions may be preset as nonfatal and an error checked by examining IERR. For example, prior to any calls to the subroutine the user could have the statement CALL ERRSET(100,0). In this case, any errors encountered are set as nonfatal and up to 100 error messages could be printed. Should more than 100 errors occur (say, during a repeated loop of calls) additional messages would no longer be printed, but execution would continue. Input parameters to BES are not altered and are returned to the calling program as originally supplied. If the nonfatal option is chosen and an error condition occurs, the user may wish to print out the input parameters of the calling sequence. Values for IERR and the corresponding messages are = 1, normal - no errors, no message printed = 2, ARGUMENT IS OUT OF RANGE (for 3(x) and ¥(x)) = 3, ORDER REQUESTED WAS TOO LARGE FOR GIVEN ARGUMENT = 4, ARGUMENT TOO LARGE FOR I(K) AND K(X) = 5, NEGATIVE ARGUMENTS FOR ¥(X) OR K(X) MAY PRODUCE COMPLEX RESULTS (negative argument for these two functions is not allowed) = 6, PARAMETER KODE INCORRECT FOR CALL (if KODE has any value other than 10, 11, 12, 20, 21, or 22). n Vy 3. Mathematical Methods 3.1 of Probl To evaluate the Bessel functions J,(x), ¥,(x)» Iy(x), and K(x) for real arguments, x, and integer orders, n. 3.2 ods Used The primary method used in the evaluation of these functions is that of repeated application of the recurrence relations described in Section 3.4, There is, however, quite a distinction between the ways in which the recurrence relations are used for each of the individual functions. For the functions of the first kind, J,(x) and I(x), the recurrence relations are utilized in a backwards direction. These techniques were first introduced by Miller? and thea carried further in the development by Goldstein and Thaler.’ For the functions of the second kind, ¥,,(x) and K,(x), the recurrence relations are used in the "normal," forward direction. | Although discussed in more detail in Section 3.4, we note here Oo that in the backwards technique, a correction to calculated values is nade after the recurrence takes place. However, in the forward recur- rence, the initial values of the functions must be calculated to within some given degree of accuracy to start the recurrence. This problem introduces the other mathematical methods used in the routines. In the evaluation of Yq (x) and K,(x), the initial values used for starting the recurrence are the zero and first order values. A simple equation to obtain these starting values is not readily available. Instead, more complex equations are necessary. To determine Yo(x), a series expres~ sion involving the Jy) functions is used and Ky (x) is determined from polynomial approximations. For both functions, the first order values are determined by utilizing Wronskian relations. Special treatment is given to the functions of the first kind when Ix] < 1.0. Using the largest order requested, N, we calculate Jy)> Iyuz)> TyGo> and Ty.1(x)- For these small arguments, x, ascending series are used for the evaluation since convergence is very 12 fast. Using these true values, the recurrence relations are then used to determine the remaining orders. This method is used in preference to the backwards recurrence algorithm since the results produced are more accurate for this particular range of arguments. It should be noted that there are various other approaches that can be used in evaluating these functions. The treatise by Watson? covers many aspects of Bessel functions, including various series defi- nitions, asymptotic forms, properties about the zeros of the functions, ete. The reason for using the particular equations and techniques dis~ cussed here and in Section 3.4 is a combination of two factors: (1) the methods provide results with as much or more accuracy as results using other approaches, and (2) the methods provide results as fast or faster than other approaches. 3.3 Mathematical Range and Domain The routine is restricted to real arguments and integer orders, and the function values returned are real. Specific computer range restrictions of the variables are described in Appendices B and C. 3.4 Equations and Discussion In discussing the methods used in BES, we fitst describe the general recurrence relations and then elaborate on the backwards recur- rence techniques. Furthermore, the series used to evaluate the func- tions of the first kind for |x| < 1.0 are shown. Keeping in mind that recurrence relations are used in the forward direction for functions of the second kind, we then describe the starting methods for these functions. General recurrence relations: Let £,(x) represent either J, (x) or ¥,(x)- Then the recurrence relations for these two functions is Fy.) +f) = 2 £G) . @ 13 For the function 1,(x) we have Op 2 Ty-1 > Ty) = 1G) 2) and for K,(x) we have 2 Kar) > Kyape) = 22 KG). @) Backwards recurrence techniques: By Miller's technique of backward recurrence,> we determine the values of J,(x) and I, (x). Given an argument, x, and some order N (largest order desired for an array of function values), let M = max (IN|, int(2Ix!)} + 51. @) Then let SGD = TyGO = 0.0 Jy) = e™ (1g) = 6 where € is a very small value, depends on the computer used, and is defined specifically in Appendices B and C. Then by applying equation (1), recur to Jg(x). Since recurrence relations remain valid when a constant is multiplied through the rela~ tions, we can consider e* as a constant and apply equation (2) in recurring down to e “(Ig(x)). These values determined are not the true function values desired, but they do have the important property of being properly related in the same scale. Because of this, we need only determine what the scale : adjustment factors, a, and a2, are such that Jo) = ayJ§@)s +--+ Jy) = ayJRG) and Tg (x) = ay e™* (1g), Iy(x) = ag e™ (Tg(x)} « O 14 From Abramowitz and Stegun® we have the associated series Jy) + 257 Iq (0) = 1, and kel Tg) +2 D0 1x) =e. tet Let uf 81 = IB) +2) IHG, 6) 1 and { M Bp =e Tale) + 2S) TRG? ) fet Since the multiplying factors a, and a, occur for each function value in making the corrections, we can define the factors by using (5) and (6) so that a, ™ 1/8; and a = e%/39 - a” The final step in the process is to make the necessary corrections to the calculated values J4(x) and I¢(x) by the factors determined in (7). Series for functions of the first kind, Ix! < 1.0: For arguments in the range 0,0 < |x| < 1.0, J,(x) and I, (x) for orders NO and NO-1 are evaluated by using the ascending series ~ 2k 5,00 = 0/2" DD eae, ana @) 1s = 2 yyk Ty (x) = («/2" & weer - O} ks From these values, the recurrence relations (1) and (2) are used to determine the lower ordered functions. Evaluation of functions of the second kind: As previously mentioned, the recurrence relations (1) and (3), respectively, are used to evaluate ¥,(x) and K(x). Before this is done, however, we must first calculate the starting values for these functions. For Yo(x) we use the equation ; AEG Jaye) Yd ~ 2 (in&/2) +¥) Jo) + $9 CoE AE, ao) k=l where Y is Euler's constant (=0.577215665.. By using this value for Yo(x) we can determine Yj (x) from the Wronskian relation WIAD, YLG0) = Jy YG) = ILO => qu where we let n = Since the J, (x) fonctions are necessary in evaluating (10) and (21), the routine will compute these functions even if they have not been requested via KODE. The user must not assume, however, that the 4,00 function values will be present in the array Tl unless so requested by KODE. To determine the value of Kp(x) we use the polynomial approxi- mations given in Abramowitz and Stegun. 16 For 0 Ky GO = K(x) Jg(X) = CD? Jy (x) , Tx) = (1)? 1.) « It should be noted that the above relations are true for integer orders but are not necessarily true for functions of noninteger orders. As mentioned earlier in Section 1.3, by using this routine the Hankel functions H(}) (x) and x{2) (x) may also be determined since 1; HO) (x) = 33) + 1Y, 6) and HO) (x) = IAG) ~ 1X) 3.5 13 jounds, and Estimate: Much of the error study conducted on BES is machine dependent and hence, is also discussed in Appendices B and C. Theoretical error analyses of Miller's recurrence algorithm have been made by Olver’ and Gautschi.® In these papers, they show that with appropriate starting conditions and recurrence relations, and provided the starting order M is large enough, the functions can be computed to any desired accuracy. By examining the testing results and studies made, it can be seen that for the functions J, (x), ¥,(x)» and I,(x), accuracy is Limited by the precision of the particular computer used. For K,(x) we see from equations (12) and (13) that ©) and ¢) are very close estimates to the "worst" deviations that can be encountered. IE we consider Kx(x) to be the value obtained from the polynomial approximation, then we can write le [ky @) - RBG) | = J eGO] 19686 CONTROL DATA 6600 VERSION ABSTRACT THIS ROUTINE CALCULATES THE BESSEL FUNCTIONS J(X)sY(X)s TO» OR KO FOR REAL ARGUMENTS AND INTEGER ORDERS. DESCRIPTION OF PARAMETERS X = INPUT»REAL ARGUMENT OF THE BESSEL FUNCTIONs THE ARGUMENT MAY BE POSITIVE sZEROy OR NEGATIVE (NEG. ARGs FOR YX! OR Kix) PRODUCES ERROR MESSAGE SINCE RESULTS MAY BE COMPLEX«) RESTRICTION ON RANGE IS FOR J(X)» 110040 «LE» X sLEs 1100.0 FOR Y(X}s 000 sLEs X sLE+ 110040 FOR I(X}» -600.0 «LE X +LEe 600.0 FOR KIX} 000 «LEs X #LE+ 600.0 NO = INPUTsINTEGER ORDER OF FUNCTION DESIRED FOR A SINGLE VALUE TO BE RETURNED» OR THE MAXIMUM ORDER DESIRED (+ OR -) IF AN ARRAY OF VALUES IS TO BE RETURNED. LET XX = ABS(X)+ THEN BOUNDS ON ORDERS ARE Le FOR 040 sLEe XX LE. 060254 ABS(NO) «LEe INT(GOQ0#XX + 7040) Ze FOR 04025 sLTs XX eLE+ 0420+ ABS(NO) sLEs INT(140+0#Xx + 8340) Be FOR 0420 aLT+ XX sLEe 1604 ABS(NO) LEs INT(42s0#KX + 10240) Me FOR 120 oT XX oLEs 20005 ABS(NO) LEs INT(OsO2*XX*#3 - O686¥XXxHE2 + L7e15#XX + 12440) Se FOR 2060 oLTe XX #LE« 100404 ABS(NO) «LE INT(2e75*XX + 22840) 6+ FOR 100.0 sLTs XxX «LE+ 4000+ ABS(NO) sLEs INT(1e67*XX + 33640) Te FOR 40060 GLTs XX «LE. 110060» ABS(NO) LEs INT(1633#XX + 470.0) KODE = INPUTsINTEGER INDICATOR FOR THE PARTICULAR 28, Bes Bes Bes BES BES BES BES Bes Bes Bes Bes Bes BES Bes BES Bes BES Bes BES Bes Bes Bes BES BES BES BES BES Bes. Bes Bes BES Bes Bes Bes BES Bes BES BES Bes Bes BES BES Bes BES Bes Bes BES Bes Bes. Bes BES BES BES Bes. 10 20 30 40 50 60 70 80 30 100 Lo 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 430 500 510 520 530 540 ana ananananaananananaananananaannanaaaaaananann FUNCTION TO BE COMPUTED. BES BFS KODE = 10 -- FUNCTION J(x) ONLY BES =u YOO ONLY BES 212 JOO AND YOR) BES BES = 20 100) ONLY BES. = 21 KOO ONLY BES = 22 TOO AND KO) BES BES RSLT1 = OUTPUTSCONTAINS THE REAL FUNCTION VALUE FOR J(X) BES OR 1(X) CORRESPONDING TO THE ORDER AND ARGUMENT SES SUPPLIED» DEPENDING ON THE KODE VALUE~ THIS BES PARAMETER WOULD CONTAIN THE RESULT IF ONLY ONE BES FUNCTION VALUE I$ TO BE RETURNED. BES BES RSLT2 = OUTPUTSCONTAINS THE REAL FUNCTION VALUE FOR Y(X) BES OR K(X) IN A MANNER SIMILAR TO RSLT1« BES Bes T1 = OUTPUT+A WORK AREA WHICH WILL CONTAIN THE ARRAY OFSES. REAL FUNCTION VALUES FOR J(X) OR I(X) OF ORDERS BES ZERO THROUGH NO» DEPENDING ON KODE. BES TL MUST BE DIMENSIONED IN THE CALLING PROGRAM AND BES MUST CONTAIN AT LEAST M CELLS OF STORAGE» WHERE BES BES M = MAX(ABS(NO) sINT(2*ABS(XI}) + 51 BES BES IN USING THE ARRAY» T1(1) = FUNCTION OF ORDER 0+ BES. =a TL(NO#1) = FUNCTION OF ORDER NO, BES BES T2 = OUTPUTsSIMILAR TO T1 FOR THE FUNCTIONS Y(X) OR BES. KOQ)« AN EXCEPTION IS THAT IF ONLY J(X) OR I(x) BES ARE CALLED» THEN T2 NEEDS NO DIMENSION IN THE BES CALLING PROGRAM» BUT THE PARAMETER MUST STILL Bes APPEAR IN THE CALLING SEQUENCE. OTHERWISE> T2 BES MUST BE DIMENSIONED AT LEAST Me Bes BES TERR = OUTPUT+ERROR FLAG FOR THE CONDITIONS BES. BES 1s NORMAL ~ NO ERRORS BES 2+ ARGUMENT OUT OF RANGE BES 53, ORDER TOO LARGE FOR ARGUMENT SUPPLIED BES, 4, ARGUMENT TOO LARGE FOR I(X) AND K(X) BES =5, NEGATIVE ARGUMENTS FOR Y{X) OR K(X) BES =6s INCORRECT PARAMETER KODE BES BES - -= BES nann-=-=- BES DOUBLE PRFCISION AO Bes DIMENSION T1(1) +1201) 6807) 9B(7) 9C(7) BES. DIMENSION NERR1(4) »NERR2(6) +NERR3(5) »NERRG(B) »NERRS(5) Bes DATA (P1=3+14159265358979) » (EULER=0-577215664901533) BES DATA ( (CUI) 1=1¢7120+ 36746691 90460559366 +-0+74350384 20425300117» BES 1-0+0426121440400427916 »=0+00024846) BES 29 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 300 810 820 830, 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000 1010 1020 1030 1040 1050 1060 1070 1080 arana aaa DATA ( (ACI) 9121 47]20057721506 +0 +4227842090423069756 405034885904 10+00262698 +0.0001075040-00000740) +( (BII) 12147) #142533 161%, Bes Bes. 20407832358 10+02189568 40401062446 40400587872 +0400251540+0+000532081BES DATA (NERRI= 2y25HARGUMCNT IS CUT OF RANGE+)s(NERR2= 3,49HORDER REBES LQUESTED WAS TOD LARGE FOR GIVEN ARGUMENT«}(NERR3= 4,37HARGUMENT TBES 200 LARGE FOR [(X1 AND K(X)el s(NERR4® 5s64HNEGATIVE ARGUMENTS FOR YBES 30) OR KUX} MAY PRODUCE COMPLEX RESULTS] »(NERRS= 6, 34HPARAMETER KEES ODE INCORRECT FOR CALL.) TERR=1 IF (KOME*LT+10) GO TO 600 SIGN = 1-0 RO = 1ABSINO) + 4 XSOFR = 0+25¢x*x BES. Bes Bes Bes. Bes BES BES INITIAL CHECK OF ORDER-ARGUMENT RANGE TO DETERMINE IF ORDER I$ OUTBES OF RANGE FOR THE GIVEN ARGUMENT. TF OX) 392793 3XCHK = ABS(X) TF (XCHK=1100.0) 49184608 4 TF (XCHK=04025) 59596 5 LARGOR = IFIK(600.0#XCHK + 7040) Go To 26 6 TF (XCHK=0620)_ 79798 7 LARGOR = IFIX(14000#XCHK + 83.0) Go To 24 IF (XCHK-1.01 949910 LARGOR = LFIX(G2eO#XCHK + 10240) Go TO 2% 10 IF (XCHK-2040) 31911912 11 LARGOR = TFIX(((0402*XCHK=0+86)*XCHK#1 7015) #XCHK+12660 Go To 24 12 TF (XCHK=100.0) 13413414 13 LARGOR = IFIX(2«75*XCHK + 228.03 GO TO 24 14 TF (X¢HK-400.0) 16916518 16 LARGOR = IFIX(1+67#XCHK + 326.0) Go To 24 UA LARGOR = TFIX(1334XCHK + 47060) 24 TF (TABS(NO)=LARGOR} 254254606 vo 27 MASKL > KODE/10 IF (MASKI~2) 30+31+600 30 MASK2 = KODE-10 GO TO 32 31 MASK2 = KODE-20 32 IF (MASK2=2) 345365600 34 IF (MASK2) 00037 +42 CHECK FUNCTIONS J(X) AND I(X) FOR ZERO ARGUMENTe 30 BES Bes Bes BES BES BES. BES BES BES Bes. BES Bes Bes Bes BES BES BES. Bes BES BES. Bes BES BES BES BES BES BES Bes BES Bes Bes Bes Bes BES. Bes BES. BES BES BES 1090 1190 lio 1120 1130 1140 Lise 1160 1170 1180 1190 1200 1220 1220 1230 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 1340 1350 1360 1370 1380 1390 1400 1410 1420 1430 1440 1450 1460 1470 1980 1490 1500 1510 1520 1530 1540 1550 1560 1570 1580 1590 1600 4610 1620 36 3 3 sa 42 4a 48 30 52 ana 54 56 59 t 60 anna 6 62 63 IF (X) 604538459 TF (X) 58938659 TF (NO) 54440454 TLL = 100 RSLTL = 130 IF (MASK2«E040) RETURN CHECK FUNCTIONS Y(X) AND K(X) FOR ZERO ARGUMENT. TF (X) 606046959 IF (MASK1.EQ42) GO TO 50 DO 48 TK=14KO T2CIK) = -1,08322 RSUt2 = 1.08322 RETURN DO $2. IK=1+KO T2(1k) = 1.06322 RSLT2 = 1.06322 RETURN FILL OUT ARRAY FOR J(X) OR I(X) WHEN (NO*NE4O)+ 00 56 Ik=2+KO TUUIKI = 06 RSLTI = 040 TH) = 120 IF (MASK24EQ40) RETURN 60 10 44. . X= ABSOX) Mo = TABS(NO) IMO = MO TF (X-140) 60471471 IF (MASK1.EQ+2) GO TO 175 USE SERIES TO DETERMINE JiN) AND J(N-1) WHEN ARGUMENT IS SMALL» THEN USE RECURRENCE TO DETERMINE REMAINING FUNCTION VALUES. IF (MO«GT+3) GO TO 62 ax = 1.0 Al = 160 XORD = "MO 1LOOP = 1 Go To 63 40 = 140000 TEND = Mo-1 DO 62 IK=1+ TEND AO = AOFOBLE(FLOAT(IK)) CONTINUE: Al = 1,0000/40 AX = 140000/(A0#MO} TLooP = 1 XORD = MO ‘SUMIN = AX Bes BES. BES Bes Bes Bes. BES BES Bes BES BES BES BES BES Bes BES BES BES BES BES BES BES BES BES Bes BES aes Bes BES BES BES BES BES aes Bes BES aes Bes Bes Bes Bes Bes Bes BES Bes BES aes Bes Bes Bes Bes Bes BES BES 1630 1640 1650 1660 1670 1680 1690 1700 1710 1720 1730 1740 1750 1760 1770 1780 1790 1800 1810 1820 1830 1840 1850 1860, 1870 1880 1890 1900 1910 1920 1930 1940 1950 1960 1970 1980 1990 2000 2010 2020 2030 2040 2050 2080 2070 2080 2090 2100 2110 2120 2130 2140 2150 2160 31 naan ano 64 65 66 67 68 69 n 72 73 1! 75 7 78 9 DO 66 Ik=14200 xk 2 Ik 1 FA = -XSQFR/((XK+140) #(XORD#XK+1407) TERM = AX#FA SUMIN = SUMJN + TERM TF_(SUMIN ~ 040) 6496566 CKSUM = ABSCTERM/SUMJN) IF (CKSUM = 160E=11) 67467965 AX = TERM CONTINUE IF (1LOOP.6T«1) Go To 6B T1(KO) = SUMINE(X/2.60)*#MO fF (M04EQ.0) GO TO 83 TLooP = 2 ax = AL XORD = MO-1 GO To 63 TL(KO=1) = SUMINA(X/240)##(MOM1 IF (KOsLE+2) GO To 83 1END = KO-2 DO 69 IK=1yTEND NK = KO-IK TLENK=1) = 200*(NK=LI*TLONK)/X — TLONK#L) CONTINUE GO TO 83 IF {MASK24E040) GO TO 76 DETERMINE STARTING LOCATION OF RECURRENCE IF Y(X) OR K(X) ARE TO BE FOUND. YO = 2*TFIXIX IF (IMO = JO) 72973973 Io = Jo Imo = IMO + 51 60 To 78 DETERMINE STARTING LOCATION FOR RECURRENCE OF JIX)« JO = 2IFIKCK) IF (10 = JO) 75476476 Io = JO IMO = IMO + 11 INITIALIZE VALUES FOR J¢X) AND YIX) TL{IMO} = 040 T1UIMO=1) = 1406-200 IF (MASK1.EQ«2) GO TO 151 Fo= 2*(IMO-1) IMO = IMO = 12 = IMO. Fer = 2.0 RECURRENCE USED FOR FUNCTION VALUES~ 32 Bes BES BES BES Bes Bes Bes. BES Bes BES BES Bes Bes BES BES Bes. BES BES BES BES Bes Bes BES BES Bes Bes BES BES BES BES. BES BES Bes BES aes Bes BES BES Bes BES. BES Bes BES BES Bes BES BES BES BES BES. BES BES BES. bes 2170 2180 2190 2200 2210 2220 2230 2240 2250 2260 2270 2280 2290 2300 2310 2320 2330 2340 2350 2360 2370 2380 2390 2400 2410 2420 2430 2480 2450, 2460 2470 2480 2490 2500 2510 2520 2530 2540 2550 2560 2570 2580 2590 2600 2610 2620 2630 2640 2650 2660 2670 2680 2690 2700 ann aan 80 8 82 83 8a 86 90 92 93 94 95 96 97 98 151 152 153 134 155 170 im 172 173, 175 VARIABLE SUM IS USEO TO DETERMINE ADJUSTMENT FACTOR ON RECURRED VALUES. TL2$1) = F/xeT1 (1242) = 111243) IF (12) 80+81,80 12 = 12-1 60 To 79 SuM = TLC) DO 82 J=3+1M0+2 SUM = SUM'+ 2.08T1(J) F = 140/SuM IF (NO) 8698486 TF (Xx) 90432492 IF (Xx) 92932490 SIGN = =SIGN IF (MASK2«EQ40) GO TO 93 Go To 300 TF (UX = 140) 96496496 DO 95 J=1+Ko. TL) = TLE IF (M04E0.0) GO To 98 DO 97 J=14KO02z TL(J+1) = TI(J#1)#S16N RSLT1 = T1(KO) X= xXx RETURN INITIALIZE STARTING VALUES FOR I(X) AND K(X) RECURRENCE™ IF (X=600.0) 15291529602 Fos 2#¢IMO-1) ~ IMO = INO — 12 = IMO T1241) = F/XATL L242) + T1243) IF (12) 15441554154 12 = 12-1 FeF-2+ Go T0153 SuM = TLC, DO.170 J=2+1Mo SUM = SUM + 2.08T1(J) F = 1e0/SUM*EXPIX) IF (XX) 17149324172 SIGN = -SIGN DO 173 J=19k002 T1tJ) = TLE TLQG+1) = TEFL AF HSIGN RSLTL = T1(KO) IPF (MASK24NE«9) GO TO 400 X= xx RETURN IF (MOeGT+1) GO 10 177 AK AL = 1.0 Bes BES BES Bes BES Bes Bes Bes Bes Bes Bes BES BES BES Bes BES BES BES BES BES BES Bes Bes. Bes Bes Bes Bes BES Bes BES BES BES Bes BES BES BES Bes BES. BES Bes BES Bes BES Bes Bes BES BES Bes Bes. Bes Bes. BES Bes Bes 2710 2720 2730 2740 2750 2760 2770 2780 2790 2800 2810 2820 2830 2840 2850 2860 2870 2880 2890 2900 2910 2920 2930 2980 2950 2960 2970 2980 2990 3000 3010 3020 3030 3040 3050 3060 3070 3080 3090 3100 3110 3120 3130 3140 3150 3160 3170 3180 3190 3200 3210 3220 3230 3240 33 aaa XORD = MO ees TLOOP = 1 rs GO To 180 Bes 177 a0 = 1-0000 BES TEND = MO = 1 Bes DO 178 Ik=1+ END BES AO = AOFOBLE(FLOATIIK)) BES 178 CONTINUE BES Al = 1,0000/40 BES AX = 140000/1A0"0) BES XORD = "MO BES TLooP = 1 BES 180 SUMIN = AX BES. DO 182 1K=1,200 BES. XK = IK-1 Bes FA = XSOFR/((XK+1.014(XORD#XK#160)) BES. TERM = AX#FA Bes SUMIN = SUMIN + TERM Bes. CKSUM = ABS(TERM/SUMINT BES TF (CKSUM ~140E-11) 184)184y181 Bes 181 AX = TERM Bes. 182 CONTINUE BES 184 IF (ILOOP.GT«1) Go To 185 BES TL(KO) = SUMIN®(X/2.40)**HO BES IF (MO.EQ.0) GO TO 188 Bes TLooP = 2 BES AX = AL BES XORD, + 40-1 BES To 180 Bes 185 TH(KOW1) = SUMIN®(X/240)44(MO=1) BES IF (KO+LE+2) GO TO 188 BES TEND = KO-2 Bes 187_Tk=1sTEND Bes Kk = KO-1K BES TLINK=1) = 2408 (NK=LIATLINKI/X + TLONK#1) Bes 187 CONTINUE Bes 188 IF (XX) 1894324190 Bes 189 SIGN = -SIGN Bes 190 IF (MO.E.0) GO TO 194 BES RO 192 J=1+KO+2 Bes 192 T1tJ#1) = TLL) #S16N BES 194 RSLTL = T1(KO) Bes IF (MASK2.NE«0) GO TO 400 BES X= xx BES RETURN BES aan=-=-n- BES EVALUATE YO AND Y1 TO START RECURRENCE. aes sa----=- Bes 300 IF (X-1-0) 32043015301 BES 320 xOVTWO = x/240 Bes XOVTHR = X/3.0 BES T2(1) = (2400/P1)*ALOG(XOVTWOIATIOL) # CCL) Bes AA = XOVTHR #XOVTHR BES SUM = CCC UC(CUT)#AAD4CL 6) HAASE (SD) FAASC( 4) FAACCE3] )FAAPCI2) AA BES 34 3250 3260 3270 3280 3290 3300 3310 3320 3330 3340 3350 3360 3370 3380 3390 3400 3410 3420 3430, 3480 3450 3460 3470 3480 3490 3500 3510 3520 3530 3540 3550 3560 3570 3580 3590 3600 3610 3620 3630 3640 3650 3660 3670 3680 3690 3700 3710 3720 3730, 3740 3750 3760 3770 3780 I 301 302 303 304 305 306 307 308 321 309 310 311 312 313 a5 400 401 402 211) = T201) + SUM GO To 321 DO 302 J=1s1Ko T1tJ) = TL ee SUMJI = 040 SUMJ2 = 0.0 IF (IMOsLE*80) Go To 305 IF (KO = JO) 30393044306 KEND = JO/2 GO TO 306 KEND = KO/2 GO TO 306 KEND = 1MO/2 00 307 N=1+kENDs2 XN EN SUMJ1_= SUMJ1 + T1(2#N#1)/XN DO 308 N=2+KENDs2 XN = ON SUMJ2 = SUMJ2 + TL(2*N#1) /XN SUMJN = 2.0*(SUNJ2-SUMJ1) T21) = 2e0/PI¥(TICLI#UALOG(X/240) * EULER) ~ SUMJN) IF (MOs6T.0} GO TO 309 RSLTL = TIC) RSLT2 = T2(1) X= XX RETURN 22) = (TLC2I#T2UL) = 2eO/CP LEKI /TLOL IF (M0-€0-1) GC TO 311 NORD = KO-1 DO 310 N=2+NORD XN = NOI T2INSL) = (2eO#XNI/X#TZEN) = T2(NAL) CONTINUE DO 312 J=29K0%2 T2(J) = T2(J)*SIGN RSLT2 = T2(KO) IF (MASK2sEQ+1) GO TO 315 DO 313 J=1sKO%2 T1(Je1) = TLL) #STGN RSLT1 = T1(KO) X= xx RETURN TF (X=240) 4019401402 XOVTWO = x/240 T2t1) = -(ALOG(xOvTWODFTICL) + AULD) A= XOVTHO*XOVTWO Bes BES BES BES BES Bes BES BES BES BES Bes Bes BES BES BES BES BES BES BES. BES BES Bes BES BES. Bes BES BES BES Bes Bes BES BES Bes BES BES BES BES BES BES BES BES BES BES BES Bes BES SUM = CCUCC(ACT DPA) BRAGA (6) J FAAER(S))*AAHA(G))FAAHAL3)) FAAHA( ZI) BES, aa Tal) = T2¢1)+suM GO TO 403) BB = 240/x Taq) = B(1) BES BES BES Bes BES SUM = CC UC{(8(7) #88) *B8-B (6) 17884815) )*8B-B( 4) 148848131) *88-B2)) #BES 188 Bes 3790 3800, 3810, 3820 3830, 3840 3850 3860, 3870 3880 3890 3900 3910 3920 3930, 3940 3950, 3960 3970 3980 3990 4000 4010 4020 4030 4040 4050 4060 4070 4080 4090 4100 4110 4120 4130 4140 4150 4160 4170 4180 4190 4200 4210 4220 4230 4240 4250 4260 4270 4280 4290 4300 4310 4320 35 403 405 600 602 606 606 608 relay = cracayesumy /¢saRr xy EXPO) 122) = sore = Tata ZIT NORD = KO 2 00/405 N=2yNoRD XN = N-1 T2tNe1) = (2608xND/xETZIND + TRENDY CONTINUE Rstr2 x t XX 2(K0! CALL ERRCHK( 344NERRS) TERR = 6 RETURN CALL ERRCHK(37»NERR3) TERR = 5 RETURN CALL ERRCHK(49 sNERR2) TFRR = 3 RETURN CALL ERRCHK(25>NERRI) TERR = 2 RETURN u x Foxx TERR = 6 RETURN CALL ERRCHK( 64 5NERR4) 36) BES Bes Bes BES BES BES BES BES Bes Bes BES. BES BES BES BES BES BES BES Bes BES BES BES BES Bes BES Bes BES 4330 4340 4350 4360 4370 4380 4390 4400 4410 4420 4430 4460 4450 4460 4470 4480 4490 4500 4510 4520 4530 4540 4550 4560 4570 4580 4590 APPENDIX B Control Data 3600 Version of BES 37-38 APPENDIX B Control Data 3600 Version of BES Subroutine BES for this machine is a single precision routine. Due to the large exponent range (107207 < jw} < 10707) and mantissa (36 bits) this provides sufficient accuracy for the range of arguments and orders shown. The range restrictions on the argument (discussed in Section 2.2) for the CDC 3600 are: for Jy(X), -=1200 < x < 1200 YqCx) O 3)8715775-a11 417557887 -031~ 6,3641977237-93 7357837-011 “6, $661977253-3935 157157732012 3661977237-303 417357837 -a11 * ,56819772580293° 14785 7857-911” 6,5661977235-493 d,coorcaorgad —~6,3861977255-303 “oyoGacoqg+909— 6,366197725¢-393 6,5461977254-293 —,3001977235-903 65661977235. 3651977255 1561977234 6,3681977235-003 785743 7-611 17357837 -g11 '3661977257-303 4) 7857497-021 $3861977237-203 -4173573a7-911-~ 6, $601977235~-303 Sy oocvccascag ‘Dyonocosasaad — 1,0000050+90 igoddanaron 7857387-011 “Gy d0Aand+on0 2 6619772522003, 4578872011 he $7$861977255-993 —yavonond=000— 22. 613661977235-993__oyanocoageong $661977253-293 661977237-093 01977237-195 3661977235-003 3661977255-993 337297750021 17357837 -011, ija57an7snit 9,0000000+090 ‘O,0d00gqg+aq0 3661977235-005_ fagonong+oag 13601977233-103 $15715773-911 30 1566197 7253-093 315715773-911 1566197 7253-933" ‘ ant 615961977253-203 S1571577S-a1t__ ~" 6,$591977233-393" ——3,57135775-011 6,3861977253-205 315715775-011 * 613061977235-03 315715775011 6.566197 7233-033 5713773-011 “6,3661977234-003 ~~~ 1,7857837-011 6, 3601977231-903 714431547-011__ ,3601977251-303 742431567 =011— 6,3601977251-093 $661977251-003 1661977231 -993 6,3681977232-705 ah 13661977231-993 661977253-903 | 741432567 -011, ¥]9289434-011 11431547 -911 711431547011 5,337S6s0-011 _ 613661977253-035 315725773-011 6,3661977251-203 7414315¢7-011 6,3661977282-093 5, 35736s0-011 71577 $-911 TABLE IT (C) Wronskian Test for J(x) and ¥(x) Argument = 1,2000000+003, Wronskian Value = 5,3051647698-004 HRT OST 5.3051647592-996 5130516475 93-726 315051667593-936 $13051647593-396°—— 5,$051647495-0%6 5, $0510473932096" 313051647709-906 5,3n51667599-035 31 4n51547593-008 Fo — 5395154 7599-904 20 5130516677)9-994 cabot 9" 5130516475 99-996° 32 5, $951047599-396 15 5,3951667599-394 51 s051647769-015 ——5,3n3i6¢75992308-— 31395164 7599-004 “51 $0316¢75932098" 51305164 7593-994 '5.9051667599=03 1595166 7595-29 815988809 2339a8 ——9 greased Byo7ss9 30084, 5,$051667595-09 3, 3051687593-00 154505 16475992094 5,5031667599=19 5,3031647599-024 5. $0566 7592-004 5,3051647595-136 5,3051647593-106~ (5189916475992994 5,805 1667999-998 _$1$951647599-934. 51305104 7593-026 5,5951067595-126 $159316¢7599-026 5, 3951947599-994 1$931667595-994 54395166 /593-994 _ 5) $051947599-936— 3, $051647599-304 ‘5,405 1547593-096 513051667593-794 513951647593-194 5,3051647595 549051667595 $,3051667595. 13051647595 513951547595. 4h, ‘AA STRELT By a7B883 9,090s900+009 2) 0000900+000 ;00gdd0d+cna 3433736s9-011 > 2ie7eouso-oat 9,0900099+003 “oyovgoangsang ~ 3/o7on090 +009 ‘vyd00ng09-000~ 216785830-011— 5)3573¢s0-a11 2fe7asasc-a11 © 738330-011 513573680 1h “Bye7ekasazait— 2 390000004000 4 78sa3oeo1s iagoonsoeong 2 218785839 216786835 Deo4angDo=909 2,4786830-013 o.ad0a0n0-008 2)8786830-911_ “Bisrasasc-atr 236785930011, 0¢aa000n: 9,0909090+00 2ie7esasa-a1t 2)67858320-081 0,0d0dan0+gn9 2,678S839-011__ “216785850-022— 21o7asaso-atL 0,0902000+009, oyaa0caa+0n9 Q,onggnngen9 216735830-911 216 7asd3-uit 2)6786830-032 216785850-011 2,6786830-g11 0337 oO TABLE II (D) Wronskian Test for I(x) and K(x) Argument = 1.0000000-003, Wronskian Value = 1.0000000000+003, 2,000n0900006903 Livaanaaono+s03 Longnoagoo+au3 4, ongcaaaon04003 2 onanagaauasa03 Lionacgoaco+cas Ljonononaoon.303 2jooeavo0ng12303 1, on0000a5094203 —a}oono0ca000+903 —— 4, 000occa0a1-703 agogooad1+203 dyongnog0091+003 jogacnonai.903 14 tooonanonore303___ is Tyononggang4.395— 2i0ogo000901-003 t,a000000000+003 “Mya9oaasi-o1 0,00000n0+0n0 Oyoognga0+o0y 9,0n00000+000 4147034a5-941_ 1.49at1si-ait” Qyao0rgo0.an0 5i96046e5-012 Llasotiet-o11 2)9s02322-911 7,4305896-011, 4505805-011 1920929-913 19604645-024 ~ 3)9s046e5-o11 5 eseees-ott 5) 9sasesseait “447034345011 ~ t,Goondogon1~103 71450580 ~Lyoogacognai-a03“~""S, 980863018 © dooocoon0s-903_ 5,95086452021,_ 4, da0000g001~303 940s9s7o0i1 -teOoangaao91+903 4yosscat3-o10._ Liaooo0cg01~303 ‘g19406947-011 .2,d000000001+303, 4119209297010 dyaonoooao0t~303 111920929-019 A,ano0do0001¢003_ 1,000000000%+903 940695 7-011. ‘4, 000n000001~203 9405957-G11 .A,9ngog0a001+003 o43ag13-010 | ‘AeOngooogoar+n03 yadsoai3-o19 2,00gcd0agat-903 111920929-016 “Lfoovagcaoor-905 ~~ 10430813-a10 _2,aooononot~o03 ____4,1920929-010__ ‘dyaounocanat+303 Liodsoais-o80 LiOngnoannor-903 __8,9408957~012,_ tyanooodaa1~103 7,4505806-011 a dagodcsoa1+203 1i04S0813-000 vonongaonar-n03 81 9406957-011 AiGocacoonar-ao3 __ayg4ni0

You might also like