Universal Journal of Applied Mathematics & Computation (4), 5-46 www.papersciences.com Calculation of Cylindrical Functions using Correction of Asymptotic Epansions G.B. Muravskii Faculty of Civil and Environmental Engineering, Technion, Haifa, Israel gmuravsk@t.technion.ac.il Abstract A new method the method of correction of asymptotic epansions, as it is called, is suggested and applied to cylindrical functions J ν () and Y ν () of a real order ν and a real argument for constructing formulas which improve significantly the precision of the asymptotic epansions whereas the correction itself contains few terms. The method includes a specific interpolation with terms decreasing at infinity for an interval adjacent to the initial point a > where the whole interval (a, ) begins; for the remaining part of the interval, the corrected asymptotic epansion goes more and more closely to the usual asymptotic epansion. The obtained formulas include an eplicit dependence on ν. Mathematics Subject Classification : 4A6, A, A4. Key Word and Phrases Cylindrical functions, Taylor s series, Asymptotic epansions.. Introduction The problem of calculation of cylindrical functions is addressed in large amount of publications. Many effective algorithms are known which are based on applying recurrent relationships and continues fractions [,,,9]; approimations with Chebyshev polynomials [4] or rational approimations [8]. A description of various alternatives and the corresponding bibliography one can find in [, 5, 6, 8,, ]. Among the known methods, rather attractive remain the classical methods: application of Taylor s series for small values of arguments and asymptotic epansions for large argument s values. Overlapping of the corresponding domains could ensure a possibility to perform calculations for all values of arguments. It is important that considering these methods for cylindrical functions we obtain formulas with eplicit dependence on the order ν of the functions (stipulating that values of ν are not large). Note that such a possibility does not eist in the case of the above mentioned algorithms which result in calculations performed for specific values of ν (most freuently for ν =, ). Unfortunately, the higher the reuired precision, the more difficult to ensure the overlapping, especially if we remain in the frame of the double precision arithmetic inherent in common programming languages. For eample the Hankel asymptotic epansions lead to an error less than 5 only for argument values 6 (for order ν = ), however the application of the Taylor series leads to the error of for = 6 (using double precision arithmetic) because of the loss of accuracy. The suggested correction of asymptotic epansions significantly improves the corresponding precision which allows us to apply the corrected epansions beginning from sufficiently small values of argument. As a result achieving the overlapping of the domains of application Taylor series and corrected asymptotic epansions becomes simpler. Emphasize that contrary to previous publications, final formulas which are suggested in the present paper (being rather simple and competitive with known methods regarding the precision and computational work) include the eplicit dependence on the order of cylindrical functions for some interval of ν variation which can be widened using well known recurrent relationships. Note that auiliary high-precision computations needed for constructing our approimations and their testing can be performed using other known methods. In our study the package Wolfram Mathematica has been used.. Description of the Method Let for a function Φ() of the real argument an asymptotic epansion be known which delivers an approimation for > > : 5
( ) A ( ) n n j a (.) Here n denotes the maimal accounted power of in the epansion. Generally the more the value is the more n can be taken for achieving minimal errors of approimation (.). Consider a deviation, φ n (), of the functions Φ() from the corresponding asymptotic epansion. An effective approimation for φ n (), and thus Φ(), can be realized as follows. Let us take s points, < <...< s. Introducing additional parameters, w and λ, we construct the following function G φ () which interpolates the deviation φ n () at the interval [, s ] and etrapolates it for > s : s w j / n n j j w / ( ) ( ) A ( ) G ( ) L ( ) n( j) (.) Here L j () are polynomials of degree s known from Lagrange interpolation method, they are eual to for = j (j =,,...,s) and to for other interpolation points. Calculations show that the optimum value of λ should be an integer greater than n + s ; this leads to a suitable rate of decreasing of the function (.) for > s (faster than the last term in (.) decreases). It is advisable to choose points,,..., s using the geometric progression, j j j h j s (.) j j (,..., ) where h > is an initial step, and > ; actually, good results are achieved also in the case of a constant step ( = ). The parameters h,, λ and w should minimize, wherever possible, the maimum of absolute values of δ φ = φ n () G φ () at the interval, conseuently we obtain rather good approimation, A n () + G φ (), for the function Φ(). As is seen from (.), the auiliary values φ n ( j ) (j =,,s) are needed for constructing the approimation. These values as well the values of the parameters close to optimal can be found employing high precision calculations. As an illustration consider the gamma function Γ(). According to Stirling s formula for ln(γ()): m ( ) ln(γ( )) ( /)ln( ) ln A ( ) (.4) B A ( ) ( m,,...) (.5) m k m k k k(k) where B k are the Bernoulli numbers. Rather simple approimation we obtain taking =, n = 5 (m = in (.4)), s =, λ = 8. The value of λ euals the power of in the net (seventh) term of the asymptotic epansion plus s (degree of Lagrange polynomials). Performing a number of calculations for different values h and w we come to the following nearly optimal values h =.44, w =.9644. Using these parameters and two eact values of φ n ( ) =.48699 and φ n ( ) =.98854 in (.) the following representation for the correction G φ () can be written: Or w w / G ( ) n( ) n( ) (.6) w/ h w/ h G (.6 ( ) 8.8995994 ) 8 ( w /) Applying the well known recurrent relationship for gamma function we obtain the following approimation in the right comple half plane Re(z) : ln(γ( z)) G ( ) ( / ) ln( ) ln 5 u u u u (.8) u 6u u z( z)( z ) where u = z +. The three terms Stirling s epansion is modified by including the correction G φ (u) and the denominator in the last term in (.8) which accounts on the recurrent relationship for going till = Re(z) =. At the real ais the errors of the approimation (.8), (.) are less than.5, which is illustrated by Fig. a where error δ of approimation (.8) is shown as a function of. (.) 6
Without the correction G φ (u) in (.8) the error achieves.4 ; the so successful improvement of the approimation by as low as two term correction is eplained by a suitable form of euation (.): the chosen parameters in the euation have resulted actually in two additional interpolation points (see Fig a). In the whole right comple half-plane the errors are less than 4.5 (the maimum error is achieved at the imaginary ais); this is illustrated in Fig. b where δ as functions of y is shown for z = ξ + iy (ξ =,.,., ). Note that smallness of the function of G φ (u) allows us to consider only 8 significant digits in (.) while ensuring the much higher final precision in (.8). Remember that the error for ln(γ(z)) is very close to the relative error for the gamma function itself..5 5 4 =...5 -.5.... - -.5-4 5 6 8 9 - -8-6 -4 - y 4 6 8 Fig. (a,b) Errors of approimation for ln(γ()) for s =, = at real ais (a) and in right comple halfplane (b): z = ξ + iy (ξ =,.,., ). 8.8 =.6.4. -. 6 5 4...... -.4 -.6 -.8-4 5 6 8 9 4 5 - -8-6 -4-4 6 8 y Fig. (a,b) Errors of approimation for ln(γ()) for s = 5, = 5 at real ais (a) and in right comple halfplane (b): z = ξ + iy (ξ =,.,., ). We present also a high precision approimation for the gamma function taking = 5, s = 5, n = 9, λ = 5. Nearly optimal values of remaining parameters are: w =.6, h =., =.9. Using euation (.) with these parameters and values φ n ( j ) (j =,,s) we obtain after transformations
G ( ) ( w /5) 5 ( 6.58958855.58856 5.6589 4.56854.685545 ) The approimation for ln(γ(z)) in the right comple half plane Re(z) will be (u = z + 5): ln(γ( z)) 5 9 u 6u u 68u 88u (.) G ( u) u( u/)ln( u) ln z ( z )( z )( z )( z4) Now errors at the real ais are less than (see Fig. a) whereas without the correction G φ (u) in (.) the error achieves.5. In the whole right comple half-plane errors are less than 8 (see Fig. b where z = ξ + iy, ξ =,.,., ). Approimations (.8), (.) have an advantage in simplicity and precision over known corresponding approimations; in addition, one can merely drop the correction for large enough values of z going to the pure Stirling approimation. Correction of Asymptotic Epansions for Bessel, Neumann and Hankel Functions As a basis for our considerations we use the following representation [] of cylindrical functions H () ( z ) H () ( z), J ν (z), Y ν (z) of order ν, H () ( z) P(, z) i Q(, z) e i (.a) z () H ( z) P(, z) i Q(, z) e i (.b) z J ( z) P(, z)cos( ) Q(, z)sin( ) (.c) z Y ( z) P(, z)sin( ) Q(, z)cos( ) (.d) z where z 4 (.) For functions P(ν, z), Q(ν, z), the Hankel s asymptotic epansions are known which can be represented in the form []: a a4 P(, z) a... 4 z z ( ( n / ) )( ( n / ) ) a, an an ( n,6,8,...) 4n( n ) (.) b b b5 Q(, z)... 5 z z z / 4 ( ( n / ) )( ( n / ) ) b, bn bn, ( n,5,,...) 4n( n ) (.4) The relationships () i () () i () H ( z) e H ( z), H ( z) e H ( z) (.5) show that P(ν, z) and Q(ν, z) should be even functions of ν; knowing them for ν one is (.9) 8
able, using well known recurrent relationships, to perform easily calculations for other real value of ν. Note that for ν = (k + )/ where k n is an integer the above asymptotic epansions A n (z) give eact representations for P(ν, z), Q(ν, z). In the present paper, formulas are constructed using the suggested correction for function Φ() = P(ν, ) and Φ() = Q(ν, ) at an interval where is a positive value significantly smaller than in the case of direct application of asymptotic epansions (.), (.4). We denote the corresponding deviations of the functions P(ν, ), Q(ν, ) from their asymptotic epansions as p n (ν, ) and m (ν, ): a an pn(, ) P(, )... (,4,...) n n (.6) b b bm m(, ) Q(, )..., ( m,5,...) m The indees n, m define the last accounted term in the brackets. Analogously to (.) we write s p wp j / n p j n j wp / p (, ) G (, ) L ( ) p (, j ) (.) s w j / m j m j w / (, ) G (, ) L ( ) (, j ) (.8) Calculations show that the optimum values are: λ p = s + n + and λ = s + m + (as for gamma function in the previous section). The parameters h, (which can be different for G p, G ) and w p, w (which depend on ν) should minimize, wherever possible, the absolute values of δ p = p n (ν, ) G p (ν, ) and δ = m (ν, ) G (ν, ) at the interval >. In distinction to the case with gamma function, we have now the second argument, ν, entering the considered functions, and our objective is to build simple approimations containing this additional argument.. Function G p (ν, ) for =, s =, n = 4, λ p = 6 Using only one point,, and L () =, we determine previously eact values of p 4 (ν, ) = 8.4854 8, 9.8 8 for ν =,, respectively. The corresponding optimum values of w p we find making a number of calculations; they are.694 and.698 for these values of ν. Thus the correction G p (ν, ) in (.) becomes known for ν =,. An interpolation leads to the following euation for w p : w.694.86 (.9) p which is suitable also beyond the interval ν (see below). Now for determination of the function G p (ν, ) for a value ν only p 4 (ν, ) is needed. Taking the values p 4 (, ), p 4 (, ), p 4 (, ) we, using notations u = ν, u j = ν j, construct the following interpolation with the weight function cos(πν)ep(.685u) at the interval ν :.685( uuj ) j 4 4 j p (,) e cos( )( ) p ( j,) Lj( u) (.) Here ν =, ν =, ν = ; L j (u) are the already mentioned Lagrange polynomials relating to points u j. Remember that for ν = (k + )/ (k =,, ) values p 4 (ν, ) should be zeros; this eplains the application of the cosine function. The parameter in the eponent function,.685, has been selected on basis of a number of calculations for minimization of deviation of function (.) from the corresponding eact values. After transformations, euations (.) can be written in the form.685v 4 9 p4(, ) cos( ) e (84.854.89. 495 ) (.) The absolute value of error δ p occurred at the interval ν when using G p (ν, ) with euations (.9), (.) remains less than.5 which is illustrated by Fig. where the corresponding results are represented for values of ν from the interval [, ] with step. (for ν =.5 the error euals zero). The suitable choice of the parameter w p results practically in appearing 9
of two additional interpolation points (see Fig. ) and the considered one term correction leads to about 5 4 times smaller error compared with the direct application of the corresponding asymptotic epansion (see the given above values of the deviation p 4 (ν, ) for ν =, ). Note that the euations (.9), (.) lead to a rather good approimation at the interval ν with δ p <. Considering the function P(ν, z) we obtain: a w p k P(, ) p k 4(,) (.) k wp / Here euations (.) for a j, (.9) for w p, (.) for p 4 (ν, ) should be applied. In accordance with (.), (.), (.5) the function (.) is an even function of ν. The constructed approimation (.) (when applying it for a specific value of ν) is competitive (regarding precision and computational work) with other methods (see, e.g., results in [8] for ν =, obtained with the rational approimation), an advantage of euation (.) consists in including the eplicit dependence on ν. p.5.5 =.5.5.5 =.5 -.5 -.5 = -.5 - -.5 -.5 = -.5 8 9 4 5 Fig. Errors δ p of approimation for deviation p n (ν, ) with n = 4, s =, =.. Function G (ν, ) for =, s =, m =, λ = 5 Similarly to the previous case we find eact values of (ν, ) = 8.4689 8, 9.84 8 for ν =,, respectively. The corresponding optimum values of w are.696,.68964. Thus the function G (ν, ) in (.8) has been determined for these values of ν. An interpolation of the indicated values of w leads to the following euation: w.696.4 (.) As above (see (.), (.)), the three values of (ν, ) for ν =,, allow us to achieve the following sufficiently accurate interpolation with the weight function cos(πν)ep(.6u):.6 4 9 (, ) cos( ) e (84.689.5. 4985 ) (.4) The absolute value of error δ at the interval ν generated when using G (ν, ) with euations (.) and (.4) remains less than.4 which is illustrated by Fig. 4 where the corresponding results are represented for values of ν from to with step.. The euations (.), (.4) lead also to the approimation at the interval ν with δ < 5.. Considering the function Q(ν, ) itself we obtain: 5 b w k Q(, ) (,) k (.5) k w / Here euations (.4), (.), (.4) should be applied. The function (.5) gives correct results 6 4
also for negative values of ν. Using euations (.), (.), (.5) one can calculate cylindrical functions J ν () and Y ν () for and ν (or even at the wider interval ν with a small loss of precision) and further go to other values of ν applying well known recurrent relationships. As the calculations show, an error for the functions J ν () and Y ν () is less than 6 at the interval ν and less than at the interval ν..5 = =.5 -.5 -.5 -.5 = - = -.5 8 9 4 5 Fig. 4 Errors δ of approimation for deviation m (ν, ) with m =, s =, =.. Function G p (ν, ) for =, s = 4, n = 4, λ p = 9 The increase in the number of interpolation points leads to a significantly higher precision. Instead of.5 (upper estimation for δ p for ν in the case =, s = ) we achieve for s = 4, an error less than 5.4 6. On basis of calculations we chose h =.4, =.9 for the all considered values of ν, the points,, 4 are determined according to (). For two values of ν =, we use reuired four eact values p 4 (ν, ), p 4 (ν, ), p 4 (ν, ), p 4 (ν, 4 ) and further determine optimum values of w p =.86,.49. Interpolating we obtain wp.86. (.6) which ensures reuired precision at interval ν. Now only four values p 4 (ν, ), p 4 (ν, ), p 4 (ν, ), p 4 (ν, 4 ) are reuired to construct the approimation G p (ν, ) for the corresponding value of ν. Instead of eact values of p 4 (ν, j ) (j =, 4), the interpolating functions of ν analogous to (.), (.) can be easily found (as above we use points ν =,, ).68v 4 9 p4(, ) cos( ) e (84.855496.44995.4885 ) (.).69v 4 9 p4(, ) cos( ) e (55.98686.896.64 ) (.8).6v 4 9 p4(, ) cos( ) e (4.9966564.6.564 ) (.9).694v 4 9 p4(, 4) cos( ) e (6.456.9469.45 ) (.) Although the interpolation at the interval ν is applied, a reuired precision is achieved only for the interval ν. These functions along with function (.6) allow us to calculate G p (ν, ) directly for an arbitrary ν from the interval ν without using eact values p 4 (ν, j ). The absolute value of error δ p occurred when using G p (ν, ) with euations (.6) (.) remains less than 5.4 6 which is illustrated by Fig. 5 where the corresponding results are represented for 4
values of ν from to with step.. 6 5 = = 4 p 6.5 - - - -4-5 = = -6 8 9 4 5 6 8 Fig. 5 Errors δ p of approimation for deviation p n (ν, ) with n = 4, s = 4, =. The function P(ν, ) can be written in the form: ak P(, ) G ) k p (, (.a) k 9 4 wp j / 4 j wp / j j Gp(, ) L ( ) p (, ) (.b) Here euations (.), (.6), (.) (.) should be applied. The cubic polynomials L j () have the form: ( )( )( 4) ( )( )( 4) L( ), L( ), ( )( )( 4) ( )( )( 4) (.) ( )( )( 4) ( )( )( ) L( ), L4( ) ( )( )( ) ( )( )( ) 4 4 4 4 In accordance with (.5) the function (.b) is an even function of ν. For a chosen value of ν euation (.b) can be reduced to a cubic polynomial divided by (w p + /) 9, so for ν = we have: 8.6984.9896.9454.545 Gp(, ) 9 (.86 / ) (.) For ν = : 8 4.449.5696.86446.54698 Gp (, ) 9 (.49 / ) (.4) For ν = /: 8 6.8946.45995.556554.586665 Gp ( /, ) 9 (.888889 / ) (.5).4 Function G (ν, ) for =, s = 4, m =, λ = 8 4
The transition from s = to s = 4 in the considered case increases the precision significantly: instead of. (upper estimation for δ for ν in the case =, s = ) errors less than.6 6 occur. On basis of calculations we use h =.46, =.5. For two values of ν =, we use reuired four values (ν, ), (ν, ), (ν, ), (ν, 4 ) and further determine optimum values of w =.8,.. Interpolating we obtain w.8.48 (.6) which ensures reuired precision at the interval ν. Now only four values (ν, ), (ν, ), (ν, ), (ν, 4 ) are reuired to construct the approimation G (ν, ) for the corresponding value of ν. Instead of eact values of (ν, j ) (j =, 4), the interpolating functions analogous to (.) (.) can be easily found:.64v 4 9 (, ) cos( ) e (84.68945.4499.48468 ) (.).9v 4 9 (, ) cos( ) e (4.945.58856.699 ) (.8).54v 4 9 (, ) cos( ) e (9.655.696685.45 ) 4 (.9).6v 4 9 (, ) cos( ) e (.6999..889 ) (.) These functions along with function (.6) allow us to calculate G (ν, ) directly for an arbitrary ν from the considered interval. The absolute value of error δ occurred when using G (ν, ) with euations (.6) and (.) (.) remains less than.6 6 which is illustrated by Fig. 6 where the corresponding results are represented for values of ν from to with step.. The function Q(ν, ) can be written in the form: bk Q(, ) G (, ) k (.a) k 8 4 w j / j w / j j G(, ) L ( ) (, ) (.b) Here euations (.4), (.), (.6), (.) (.) should be applied. In accordance with (.5) the function (.b) is an even function of ν. For a chosen value of ν euation (.b) can be reduced to a cubic polynomial divided by (w + /) 8, so for ν = we have:.654586.8886.9455.49994 For ν = : G For ν = /: G (, ) (, ) 8 G ( /, ) 8 (.8 / ) 8 (.).4656984.99584.964984.599 8 (. / ) (.) 8 5.5984.94995696.456984494.444 8 (.6666 / ) (.4) Using euations (.), (.), (.) one can calculate Bessel and Neumann functions for ν and further go to arbitrary values of ν applying well known recurrent relationships. As calculations show, an error for the functions J ν () and Y ν () is less than.6 6 at the interval ν ; this precision holds when applying the recurrent relationships for cylindrical functions for ν 6. 4
4 = = 6 -.5 - - = = -4 8 9 4 5 6 8 9 Fig. 6 Errors δ of approimation for deviation m (ν, ) with m =, s = 4, =..5 Function G p (ν, ) for =, s =, n = 6, λ p = 8 The approimation for = is less eact than in the case = considered above, however the accuracy is still acceptable for many applications. We present euations analogous to euations (.9), (.).54. (.5) wp 4 4.498 4 5 6(,) cos( )e (( ) 6(,) 6(,)) cos( )e (6.885.8 ) p p e p (.6) where α =.498. Here two interpolation points ν =, ν = are sufficient for approimation p 6 (ν, ). The absolute value of error δ p occurred when using G p (ν,) with euations (.5) and (.6) remains less than 6.5 8 which is illustrated by Fig. where the corresponding results are represented for values of ν from to with step.. p 8 6 = 5 4 =.5 - = - - -4-5 -6 = - 4 5 6 8 9 Fig. Errors δ p of approimation for deviation p n (ν, ) for n = 6, s =, =. Considering the function P(ν, ) itself we obtain the following approimation: 44
a a4 a w 6 p P(, ) p 4 6 6(,) (.) wp / Here euations (.), (.5), (.6) should be applied. In accordance with (.5) the function (.) is an even function of ν..6 Function G (ν, ) for =, s =, m = 5, λ = We present euations analogous to euations (.5), (.6) w.54.8 (.8) 5.68 4 5 (,) cos( )e (6.6.6 ) (.9) The absolute value of error δ occurred when using G (ν, ) with euations (.8) and (.9) remains less than 6 8 which is illustrated by Fig. 8. For the function Q(ν, ) we obtain the following approimation: b b b w 5 Q(, ) 5 5(,) (.4) w / Here euations (.4), (.8), (.9) should be applied. When determining the functions J ν () and Y ν () using (.), (.), (.4) error for the interval ν is less than 8. 8 6 5 4 - - - -4-5 -6 = = =.5 = - 4 5 6 8 9 Fig. 8 Errors δ of approimation for deviation m (ν, ) for m = 5, s =, =. 4. Conclusions The correction of asymptotic epansions suggested in the paper significantly improves the precision and as result one can apply the corrected epansions beginning from significantly smaller values of argument than in the case of usual epansions. For cylindrical functions, the method allows obtaining simple formulas which include eplicit dependence on order s values. Actually the possibility occurs to apply the corrected asymptotic epansions beginning from a small enough value of the argument so that for < the Taylor series can be used. 8 References. Abramowitz M., Stegun I.A., Handbook of Mathematical Functions, National Bureau of Standards, Washington,964. 45
. Amos D.E., Daniel S.L. & Weston M.K., CDC 66 subroutines IBESS and JBESS for Bessel functions I v () and J v (), >, v >, ACM Trans. Math. Software, (9), 6 9.. Amos D.E., Daniel S.L. & Weston M.K., Algorithm 5 CDC 66 subroutines IBESS and JBESS for Bessel functions I v () and J v (), >, v >, ACM Trans. Math. Soft ware, (9), 9 95. 4. Clenshaw C.W., Chebyshev Series for Mathematical Functions, National Physical Laboratory Mathematical Tables, 5, London, 96. 5. Cody W. J., Algorithm 5: SPECFUN A portable FORTRAN package of special function routines and test drivers, ACM Trans. Math. Software 9 (99),. 6. Cuyt A., Brevik Petersen V., Verdonk B., Waadeland H., and Jones W., Handbook of Continued Fractions for Special Functions. Springer Verlag, Berlin, Germany, 8.. Gautschi W., Computational aspects of three-term recurrence relations, SIAM Rev., 9, (96), 4 8. 8. Hart J.F., Cheney E. W., Lawson C.L., Maehly H.J., Mesztenyi C.K, Rice J.R., Thacher H.G., Jr. and Witzgall C., Computer Approimations, SIAM Ser. in Appl. Math., John Wiley & Sons Inc., New York, 968. 9. Miller J.C.P., Bessel Functions, Part II, Functions of Positive Integer Order, Mathematical Tables, Vol., Cambridge University Press, 95.. Olver F.W.J., Lozier D.W., Boisvert R.F., Clark C.W., NIST Handbook of Mathematical Functions, Cambridge University Press,.. Press W.H., Teukolsky S.A., Vetterling W.T., Flannery B.P., Numerical recipes. The Art of Scientific Computing, Cambridge University Press,. 46