Special Functions for the HP48S/SX/G/GX


Overview


 1°) Gamma Function
 2°) Digamma Function
 3°) Polygamma Function

 4°) Zeta Function
 5°) Kummer's Function
 6°) Gauss Hypergeometric Functions
 7°) Regularized Hypergeometric Functions
 8°) Hypergeometric Function U
 9°) Generalized Hypergeometric Functions

10°) Appell Hypergeometric Functions

   a)  
Appell Function F1
   b)  Appell Function F2
   c)  Appell Function F3
   d)  Appell Function F4

11°) Kampé de Fériet Functions

12°) Lauricella Functions


   a)  
Lauricella Function FA
   b)  Lauricella Function FB
   c)  Lauricella Function FC
   d)  Lauricella Function FD

13°)  Srivastava Functions
14°)  Associated Legendre Functions
15°)  Bessel Functions


   a)  Bessel & Modified Bessel functions of the 1st & 2nd kind
   b)  Spherical Bessel Functions
   c)  Kelvin Functions


16°)  Orthogonal Polynomials & Functions

   a)  Laguerre Polynomials
   b)  Generalized Laguerre Polynomials & Functions
   c)  Legendre Polynomials
   d)  Jacobi Polynomials & Functions
   e)  Hermite Polynomials & Functions
   f)  Chebyshev
Polynomials & Functions
  g)  Ultraspherical Polynomials & Functions

17°)  Elliptic Functions

   a)  Weierstrass Elliptic Functions
   b)  Jacobian Elliptic Functions
   c)  Carlson Elliptic Integrals
   d)  Surface Area of an Ellipsoid
 

18°)  Miscellaneous

   a)  Airy
   b)  Anger & Weber
   c)  Dawson Integrals
   d)  Exponential Integral En
   e)  Exponential Integral Ei
   f)  Sine & Cosine Integrals
   g)  Hyperbolic Sine & Cosine Integrals
   h)  Catalan Functions
   i)  Fresnel Integrals
   j)  Debye Function
   k)  Parabolic Cylinder Functions
   l)  Error Function

  m)
  Fibonacci Functions
  n)  Struve Functions
  o)  Lommel's Functions
  p)  PolyLogarithm
  q)  Incomplete Beta
  r)  Incomplete Gamma
  s)  
Lerch Transcendent Functions
  t)  
Coulomb Wave Functions
  u)
  Whittaker's Functions
  v)  
Toronto Functions
 
19°)  SpheroidalWave Functions
20°)  Ellipsoidal Wave Functions
21°)  Euler Gamma Constant
22°)
 Asymptotic Expansions

  a)  Airy Functions
  b)  Coulomb Wave
  c)  Parabolic Cylinder
  d)  Exponential Integrals En
  e)  Struve Function Hn
  f)  Bessel Functions J & Y & K

 
23
°)  Fractional-Integro Differentiation

  a)  Exponential
  b)  Logarithm
  c)  FClog
  d)  Cosine
  e)  Sine
  f)  Hyperbolic Cosine
  g)  Hyperbolic Sine
  h)  Airy Functions
  i)  Error Function
  j)  Hermite Function
  k)  Kummer's Function
  l)  Generalized Laguerre's Function
  m) Bessel Functions
  n)  Fresnel Integrals
  o)  Exponential Integrals & Related Functions

24
°)  Non-Linear Equations

  a)  Secant Method
  b)  Newton's Method

25°)  Continued Fractions



-Most of these programs work with complex arguments


1°)  Gamma Function


 "GAM"  employs        Gam(x) = [ x^(x-1/2) ] sqrt(2.Pi) exp [ -x + ( 1/12 )/( x + ( 1/30 )/( x + ( 53/210)/( x + (195/371)/( x + ...  )))) ]

  and the reccrence relation:   Gam(x+n) = (x+n-1) (x+n-2) ...... (x+1) x Gam(x)



           STACK           INPUT         OUTPUT
           Level 1                x         Gamma(x)


Example:

 
  3.14  GAM  ->   2.28448063382


Note:

-This program also works with complex numbers:

  (1,2)  GAM  ->   (.151904002671,1.98048801618E-2)

-So  Gam ( 1+2.i ) = 0.151904002671 + 0.0198048801618 i


2°)  Digamma Function


 PSI  uses the asymptotic expansion:     Psi(x) = ln x - 1/(2x) -1/(12x2) + 1/(120x4) - 1/(252x6) + 1/(240x8) + .......
 
 together with the property:  Psi(x+1) = Psi(x) + 1/x




           STACK           INPUT         OUTPUT
           Level 1                x            Psi(x)


Examples:

 
  3.14   PSI   ->   .97661709147
 (1,2)   PSI   ->   (.71459151538,1.32080728265)


3°)  Polygamma Functions


 PSIN calculates the nth derivative of the Psi function   ( n = 0 ; 1 ; 2 ; ..... )

  Psi'(x) = the Trigamma function ,  Psi''(x) = the Tetragamma function ... etc ...
 The asymptotic expansion of the Psi-function is derived n times and the recurrence relation  Psi(n)(x+1) = Psi(n)(x) + (-1)nn! x-n-1  is used.




           STACK           INPUTS         OUTPUTS
           Level 2                 n                /
           Level 1                 x           Psi(n)(x)


Examples:

 
    1     ENTER
  3.14  PSIN    ->   .374464556478      ( Trigamma )

    3     ENTER
 (1,2)   PSIN    ->   ( -0.18478233339 , 0.175169315188 )               ( Pentagamma )


4°)  Zeta Function


  ZETA  employs Borwein algorithm  ( cf reference [4] )  if Re(z) > 0.5
  and the formula:  Zeta(z) = Zeta(1-z)  Pi z-1/2  Gamma((1-z)/2) / Gamma(z/2)


           STACK            INPUT         OUTPUT
           Level 1                 x           Zeta(x)


Example:

 
    -7.49    ZETA   ->    Zeta(-7.49)  = 3.31204016904 E-3
     (1,2)    ZETA   ->    Zeta( 1+2i ) = 0.598165569763 - 0.351854745218 i

5°)  Kummer's Functions


-Kummer's function  M(a,b,x) is defined by

      M(a;b;x) = 1 +  (a)1/(b)1. x1/1! + ............. +  (a)n/(b)n . xn/n! + ..........  where (a)n = a(a+1)(a+2) ...... (a+n-1)


           STACK           INPUTS         OUTPUTS
           Level 3                a                /
           Level 2                b                /
           Level 1                x          M(a,b,x)


Example:
    Compute  M(2;3;-Pi)

   2 
   3 
  PI   CHS   KUM  yields  0.166374561777

 KUM also works with complex numbers, for example:

 KUM ( 2 , 3 ;  1+2i )  =  0.22245799696 + 1.80488317429 i

Notes:

 a)   2x (Pi)-1/2 M(1/2;3/2;-x2) = erf(x) = error function
 b)        (x/2)n  M(n+1/2;2n+1;2x) = Gamma(1+n) ex In(x)        where     In  = a modified Bessel function
 c)       (xa/a)   M(a;a+1;-x)  =  incgam(a;x)  = §0x e-t ta-1 dt                ( incgam = incomplete gamma function )

and many other functions are related to Kummer's functions.

-Kummer functions are in fact a special case of the hypergeometric functions
 
  

6°)  Gauss Hypergeometric Functions


Formulas:      F(a,b;c;x) = 1 +  (a)1(b)1/(c)1. x1/1! + ............. +  (a)n(b)n/(c)n . xn/n! + ..........  where (a)n = a(a+1)(a+2) ...... (a+n-1)    and     | x | < 1


-We also have the folowing properties:

     c-a-b > 0  ->  F(a;b;c;1) = Gam(c).Gam(c-a-b)/(Gam(c-a).Gam(c-b))

    F(a;b;b;x) = F(b;a;b;x) = 1/(1-x)a

   If  x < 0     F(a,b,c,x) =  ( 1 - x ) -a  F(a,c-b,c,-x/(1-x))

   If  x > 1    F(a,b,c,x) = [ Gam(c) Gam(b-a) / Gam(b) / Gam(c-a) ] (-x) -a  F(a,1+a-c,1+a-b,1/x)
                                   + [ Gam(c) Gam(a-b) / Gam(a) / Gam(c-b) ] (-x) -b  F(b,1+b-c,1+b-a,1/x)       which may be a complex number


           STACK           INPUTS         OUTPUTS
           Level 4                a                /
           Level 3                b                /
           Level 2                c                /
           Level 1                x         F(a,b;c;x)


Examples:
       Calculate  F(0.3 , -0.7 ; 0.4 ; 0.49)

   0.3    ENTER
  -0.7   ENTER
   0.4    ENTER
  0.49   HGF         ->     F(0.3 , -0.7 ; 0.4 ; 0.49) =  0.720164355556


-Likewise, we find:

   F(1;2;7;1)   = 1.5
   F(2;3;3;0.7) = 11.1111111111

   F(1.2,2.3;3.7;-3)  =  0.309850660994
   F(1.2,2.3;3.7;4)   =  -0.804024119422 - 0.105379848361 i  


Note:  

 HGF  also works with complex arguments

7°)  Regularized Hypergeometric Functions


Formula:

    F~( a , b ; c ; x ) =  SUMk=0,1,2,.....    [ (a)k(b)k ] / [ Gam(k+c) ] . xk/k!



           STACK           INPUTS         OUTPUTS
           Level 4                a                /
           Level 3                b                /
           Level 2                c                /
           Level 1                x       F~( a , b ; c ; x )


Examples:
    Calculate  F~(0.3 , -0.7 ; 0.4 ; 0.49)

   0.3    ENTER
  -0.7   ENTER
   0.4    ENTER
  0.49   RHGF         ->     F~(0.3 , -0.7 ; 0.4 ; 0.49) =  0.324667518882              it's simply     F(0.3 , -0.7 ; 0.4 ; 0.49)  /  Gamma ( 0.4 )


-Likewise,   F~(0.3 , -0.7 ; -2 ; 0.49) =  -0.0168034752793


8°)  Hypergeometric Function  U


 U(a,b;x)  = [ Gam(b-1) / Gam(a) ] x1-b  1F1(a-b+1;2-b;x)  + [ Gam(1-b) / Gam(a-b+1) ] 1F1(a;b;x)    if b is not an integer

 U(a;n;x)  = [(-1)n/Gam(a-n+1)] [ Ln(x) / (n-1) !  1F1(a;n;x)  + Sumk=0,1,.....  { (a)k ( Psi(a+k) - Psi(k+1) - Psi(k+n) ) xk / (k+n-1)! / k! } - Sumk=1,...,n-1 { (k-1)! x-k / (1-a)k /(n-k-1)! } ]    if b = n = positive integer

 U(a;1-n;x) = xn U(a+n;1+n;x)   

 U(a,a+n;x)  = x-a SUMk=0,.....,n-1 Comb(n-1;n-k-1) (a)k x-k     if  n is a positive integer


           STACK           INPUTS         OUTPUTS
           Level 3                a                /
           Level 2                b                /
           Level 1                x                /


Examples:
   

   U(1.2;2.3;3.4) =  0.23681859297

   U(1.2;3;1/Pi)  =  13.303479155

   U(1.2;-3;1/Pi)  =  0.163974005823

   U(2;7;3.14) =  1.16985623465

  

9°)  Generalized Hypergeometric Functions


-The definition of  F(a,b,c;x) may be generalized as follows:    given 2 non-negative integers  m & p  ( at least one of them positive )

        mFp( a1,a2,....,am ; b1,b2,....,bp ; x ) =  SUMk=0,1,2,.....    [(a1)k(a2)k.....(am)k] / [(b1)k(b2)k.....(bp)k] . xk/k!

           where (ai)k = ai(ai+1)(ai+2) ...... (ai+k-1)   &  (ai)0 = 1    ,    likewise for  (bj)k


-The regularized generalized hypergeometric function F tilde is defined by

      mF~p( a1,a2,....,am ; b1,b2,....,bp ; x ) =  SUMk=0,1,2,.....    [ (a1)k(a2)k.....(am)k ] / [Gam(k+b1) Gam(k+b2).....Gam(k+bp)] . xk/k!

-If no bj is a negative integer, we simply divide F by the product    Gam(b1) Gam(b2).....Gam(bp)
-Otherwise,  the calculation is more complicated.
 
  GHGF  calculates  F or F tilde  according to the sign of level2-input.


-All the coefficients must be placed in the stack



           STACK           INPUTS         OUTPUTS
            ...........
               a1
               /
            ...........
            ..........
               /
            ...........
               am
               /
           ............
               b1
               /
           ............
            .........
               /
           Level 4                bp                /
           Level 3                m                /
           Level 2              +/-p                /
           Level 1                x                /


Example1:
    3F4( 1 , 4 , 7 ; 2 , 3 , 6 , 5 ; Pi )  =  ?


       1  ENTER
       4  ENTER
       7  ENTER
       2  ENTER
       3  ENTER
       6  ENTER
       5  ENTER
       3  ENTER
       4  ENTER

      Pi  GHGF       ->      3F4( 1 , 4 , 7 ; 2 , 3 , 6 , 5 ; Pi )  =  1.63101964329

Example2:     3F~4( 1 , 4 , 7 ; 2 , 3 , 6 , 5 ; Pi )  =  ?


       1  ENTER
       4  ENTER
       7  ENTER
       2  ENTER
       3  ENTER
       6  ENTER
       5  ENTER
       3  ENTER
      -4  ENTER

      Pi  GHGF       ->      3F~4( 1 , 4 , 7 ; 2 , 3 , 6 , 5 ; Pi )  = 0.000283163132516

Notes:

-If m = p = 0  GHGF  returns exp(x)
 
-The program doesn't check if the series are convergent or not.
-Even when they are convergent, execution time may be very long !


10°)  Appell Functions


       a) Appell Function F1


-The Appell hypergeometric function F1 is defined by:

   F1( a , b , b' , c ; x , y ) = Summ,n=0 to infinity   [ (a)m+n (b)m (b')n / (c)m+n ]  ( xm / m! ) ( yn /n! )

   where  (a)k = a(a+1)(a+2).....(a+k-1)   if  k > 0  and  (a)0 = 1       ( Pochhammer symbol )



           STACK           INPUTS         OUTPUTS
           Level 6
               a
               /
           Level 5
               b
               /
           Level 4                b'                /
           Level 3                c                /
           Level 2                x                /
           Level 1                y      F1(a,b,b',c;x,y)


Example:

 
    2    ENTER
    3    ENTER
    4    ENTER
    7    ENTER
   0.1  ENTER
   0.2   APL1      ->         F1( 2 , 3 , 4 , 7 , 0.1 , 0.2 )  = 1.40945520741

Note:

-The series is convergent if   Max { | x | , | y | }  <  1


       b) Appell Function F2


-The Appell hypergeometric function F2 is defined by:

   F2( a , b , b' , c , c' ; x , y ) = Summ,n=0 to infinity   [ (a)m+n (b)m (b')n / (c)m (c')n ]  ( xm / m! ) ( yn /n! )


           STACK           INPUTS         OUTPUTS
           Level 7
               a
               /
           Level 6
               b
               /
           Level 5
               b'
               /
           Level 4                c                /
           Level 3                c'                /
           Level 2                x                /
           Level 1                y     F2(a,b,b',c,c';x,y)


Example:

 
    2    ENTER
    3    ENTER
    4    ENTER
    6    ENTER
    7    ENTER
   0.1  ENTER
   0.2   APL2      ->        F2( 2 , 3 , 4 , 6 , 7 , 0.1 , 0.2 )  =   1.44155353037

Note:

-The series is convergent if    | x | + | y |  <  1


       c) Appell Function F3


-The Appell hypergeometric function F3 is defined by:

   F3( a , a' , b , b' , c ; x , y ) = Summ,n=0 to infinity   [ (a)m (a')n (b)m (b')n / (c)m+n ]  ( xm / m! ) ( yn /n! )


           STACK           INPUTS         OUTPUTS
           Level 7
               a
               /
           Level 6
               a'
               /
           Level 5
               b
               /
           Level 4                b'                /
           Level 3                c                /
           Level 2                x                /
           Level 1                y     F3(a,b,b',c,c';x,y)


Example:

 
    2    ENTER
    3    ENTER
    4    ENTER
    6    ENTER
    7    ENTER
   0.1  ENTER
   0.2   APL3      ->        F3( 2 , 3 , 4 , 6 , 7 , 0.1 , 0.2 )  =   1.97231096375


Note:

-The series is convergent if    Max { | x | , | y | }  <  1


       d) Appell Function F4


-The Appell hypergeometric function F4 is defined by:

   F4( a , b , c , c' ; x , y ) = Summ,n=0 to infinity   [ (a)m+n (b)m+n / ( (c)m (c')n) ]  ( xm / m! ) ( yn /n! )


           STACK           INPUTS         OUTPUTS
           Level 6
               a
               /
           Level 5
               b
               /
           Level 4                c                /
           Level 3                c'                /
           Level 2                x                /
           Level 1                y      F1(a,b,b',c;x,y)


Example:

 
    2    ENTER
    3    ENTER
    4    ENTER
    7    ENTER
   0.1  ENTER
   0.2   APL4      ->         F4( 2 , 3 , 4 , 7 , 0.1 , 0.2 )  =  1.45948287121

Notes:

-The series is convergent if    | x |1/2 + | y |1/2  <  1

-All these double series are special cases of "Kampé de Fériet" functions and may be computed by KdF


11°)  Kampé de Fériet Functions

   
-In KAMP sub-directory, we have KdF functions

-Kampé de Fériet function is the generalized hypergeometric function of 2 variables.
-Given 6 non-negative integers:  A , B , C , P , Q , S ,  it is defined by the double series:
 

           A B C   /    a1 ,........, aA ;  b1 ,........, bB ;  c1 ,........, cC ;              \
        FP Q S   |                                                                             x , y    |      =    SUMm=0,1,2,...  SUMn=0,1,2,..    Km,n  xm yn / ( m! n! )
                      \    p1 ,........, pP ;  q1 ,........, qQ ;  s1 ,........, sS ;               /
 

      where      Km,n  =  [ (a1)m+n ......... (aA)m+n  (b1)m ......... (bB)m  (c1)n ......... (cC)n ] /  [ (p1)m+n ......... (pP)m+n  (q1)m ......... (qQ)m  (s1)n ......... (sS)n ]
 

       and    (a)n = Pochhammer's symbol:     (a)0 = 1
                                                                  (a)n = a(a+1)(a+2) ...... (a+n-1)    if  n > 0



           STACK           INPUTS         OUTPUTS
           Level 2                x                /
           Level 1                y          KdF(x,y)


Example:

  
           A = 2   B = 3   C = 2                  a1 = 1.2    a2 = 2.3  ,   b1 = 1.1   b2 = 0.7   b3 = 1.4   ,   c1 = 1.6   c2 = 1.5

           P = 3   Q = 2   S = 4            p1 = 2    p2 =  3   p3 =  4  ,  q1 = 5   q2 = 6  ,  s1 = 7    s2 = 8   s3 = 9   s4 =  10.1

-Calculate  F(5,7)

1°)  Store the 6 constants A , B , C , P , Q , S  in the corresponding variables
2°)  Store the 16 other constants as a vector in'V' variables
3°)
        5  ENTER
        7   KdF      ->    F(5;7) =  1.02246670867
 

Note:

-This program doesn't check if the series is convergent ( press ON to stop the loops if they are infinte... or too slow ! )


12°)  Lauricella Functions


       a) Lauricella Function FA


-This function is defined by

  FA( a ; b1 , b2 , b3 ; c1 , c2 , c3 ; x , y , z ) = SUMm,n,p=0 to infinity   (a)m+n+p (b1)m (b2)n (b3)p / ((c1)m (c2)n (c3)p)  xmynzp / (m! n! p!)

  where   (a)k = a(a+1)(a+2) ....... (a+k-1)   if  k > 0   and   (a)0 =  1    ( Pochhammer symbol )


           STACK           INPUTS         OUTPUTS
           Level 10
               a
               /
           Level 9
               b1
               /
           Level 8
               b2
               /
           Level 7
               b3
               /
           Level 6
               c1
               /
           Level 5
               c2
               /
           Level 4                c3                /
           Level 3                x                /
           Level 2                y                /
           Level 1                z          FA(x,y,z)


Example:
     With   a = 0.7 ,  b1 = 0.1  b2 = 0.2  b3 = 0.3 ,  c1 = 2.4  c2 = 2.5  c3 = 2.6 ,  

   FA( 0.11 , 0.12 , 0.13 ) = ?
 
  0.7  ENTER
  0.1  ENTER
  0.2  ENTER
  0.3  ENTER
  2.4  ENTER
  2.5  ENTER
  2.6  ENTER

  0.11  ENTER
  0.12  ENTER
  0.13   LCFA    ->  FA( 0.11 , 0.12 , 0.13 ) = 1.02157159441
 

Notes:

-With an HP48GX, execution time = 16 seconds
-The series is convergent if  | x | + | y | + | z |  <  1


       b) Lauricella Function FB


-This function is defined by

  FB( a1 , a2 , a3 ; b1 , b2 , b3 ; c ; x , y , z ) = SUMm,n,p=0 to infinity    (a1)m (a2)n (a3)p (b1)m (b2)n (b3)p / (c)m+n+p   xmynzp / (m! n! p!)


           STACK           INPUTS         OUTPUTS
           Level 10
               a1
               /
           Level 9
               a2
               /
           Level 8
               a3
               /
           Level 7
               b1
               /
           Level 6
               b2
               /
           Level 5
               b3
               /
           Level 4                c                /
           Level 3                x                /
           Level 2                y                /
           Level 1                z          FB(x,y,z)


Example:
     With   a1 = 0.1  a2 = 0.2  a3 = 0.3 ,  b1 = 0.4  b2 = 0.5  b3 = 0.6 ,  c = 2.7

    FB( 0.41 , 0.42 , 0.43 ) = ?

    0.1  ENTER
    0.2  ENTER
    0.3  ENTER
    0.4  ENTER
    0.5  ENTER
    0.6  ENTER
    2.7  ENTER

   0.41  ENTER
   0.42  ENTER
   0.43   LCFB       ->     FB( 0.41 , 0.42 , 0.43 ) = 1.05774803114

Note:

-The series is convergent if   Max { | x | , | y | , | z |  }  <  1


       c) Lauricella Function FC

-This function is defined by

  FC( a ; b ; c1 , c2 , c3 ;  x , y , z ) = SUMm,n,p=0 to infinity    (a)m+n+p (b)m+n+p  / ( (c1)m(c2)n(c3)p )  xmynzp / (m! n! p!)


           STACK           INPUTS         OUTPUTS
           Level 8
               a
               /
           Level 7
               b
               /
           Level 6
               c1
               /
           Level 5
               c2
               /
           Level 4                c3                /
           Level 3                x                /
           Level 2                y                /
           Level 1                z          FC(x,y,z)


Example:
     With   a = 0.1 , b = 0.2 ,  c1 = 2.7   c2 = 2.8   c3 = 2.9

   FC( 0.10 , 0.11 , 0.12 ) = ?

   0.1   ENTER
   0.2   ENTER
   2.7   ENTER
   2.8   ENTER
   2.9   ENTER

  0.10  ENTER
  0.11  ENTER
  0.12   LCFC     ->    FC( 0.10 , 0.11 , 0.12 ) =  1.00255428904


Note:

-The series is convergent if     | x |1/2 + | y |1/2 + | z |1/2   <  1


       d) Lauricella Function FD

-This function is defined by

  FD( a ; b1 , b2 , b3 ; c ;  x , y , z ) = SUMm,n,p=0 to infinity    (a)m+n+p (b1)m (b2)n (b3)p  /  (c)m+n+p   xmynzp / (m! n! p!)



           STACK           INPUTS         OUTPUTS
           Level 8
               a
               /
           Level 7
               b1
               /
           Level 6
               b2
               /
           Level 5
               b3
               /
           Level 4                c                /
           Level 3                x                /
           Level 2                y                /
           Level 1                z          FD(x,y,z)


Example:
     With   a = 0.1 ,  b1 = 0.2   b2 = 0.3   b3 = 0.4 ,  c = 2.7

   FD( 0.21 , 0.31 , 0.41 ) = ?

   0.1   ENTER
   0.2   ENTER
   0.3   ENTER
   0.4   ENTER
   2.7   ENTER

  0.21  ENTER
  0.31  ENTER
  0.41   LCFD     ->    FD( 0.21 , 0.31 , 0.41 ) =  1.01234537728

Notes:

-The series is convergent if    Max { | x | , | y | , | z |  }  <  1
-All these triple series are special cases of a generalized hypergeometric series of 3 variables:  Srivastava functions


13°)  Srivastava Functions

-Srivastava's Functions generalize the hypergeometric functions of 3 variables  x , y , z.

-Given 14 non-negative integers  A  B  C  D  E  F  G  H  I  J  K  L  M  N   and

 A numbers  a1 ..... aA   B  numbers  b1 ..... bB  C  numbers  c1 ... cC  D  numbers  d1 .... dD  E numbers  e1 .... eE  F numbers  f1 ....  fF    G numbers g1....gG
 H numbers  h1 ..... hH    I  numbers   i1  .....  iI   J   numbers   j1 ...  jJ   K numbers   k1 .... kK  L numbers  l1 ....  lL  M numbers m1 ... mM N numbers n1 ... nN

 the following program computes

      F AHBICJDKELFMGN(a1 ... aA ;h1 ... hH ; b1 ... bB ;i1 ... iI ; c1 ... cC ;j1 ... jJ ; d1 ... dD ;k1 ... kK ; e1 ... eE ;l1 ...lL ; f1 ... fF ;m1 ... mM ; g1... gG ;n1 ... nN  ;  x , y , z  )

      =  SUMp,q,r=0 to infinity    up,q,r  xp yq zr / ( p! q! r! )

where   up,q,r  = [ (a1)p+q+r ...... (aA)p+q+r (b1)p+q ...... (bB)p+q (c1)q+r ...... (cC)q+r (d1)p+r ...... (dD)p+r (e1)p ...... (eE)p (f1)q ......   (fF)q  (g1)r ...... (gG)r ] /
                         [ (h1)p+q+r ...... (hH)p+q+r  (i1)p+q ......  (iI)p+q   (j1)q+r ......  (jJ)q+r  (k1)p+r ...... (kK)p+r  (l1)p ......  (lL)p (m1)q ...... (mM)q (n1)r ...... (nN)r ]

   and    (t)n = Pochhammer's symbol:

                      (t)0 = 1
                      (t)n = t(t+1)(t+2) ...... (t+n-1)    if  n > 0



           STACK           INPUTS         OUTPUTS
           Level 3                x                /
           Level 2                y                /
           Level 1                z          F(x,y,z)


Example:
      With  A = B = ........................... = M = 1  &  N = 2   

          a1 = sqrt(2)   b1 = sqrt(3)   c1 = sqrt(5)   d1 = sqrt(6)    e1 = sqrt(7)    f1  = sqrt(8)    g1 = sqrt(10)               
          h1 = sqrt(11)  i1 = sqrt(12)  j1 = sqrt(13)  k1 = sqrt(14)  l1 = sqrt(15)  m1 = sqrt(17)  n1 = sqrt(18)    n2 = sqrt(19)     

  and   x = 0.1   y = 0.2   z = 0.3

1°)  Store 1 in all the 14 variables 'A'  'B'  .......  'N'
2°)  Place the 15 constants  sqrt(2)  sqrt(3)  .....  sqrt(19)   in the stack & 15  ->ARRY  and store this vector in 'V' variable
3°)  

  0.1   ENTER
  0.2   ENTER
  0.3    SHRI        ->        F( 0.1 , 0.2 , 0.3 ) = 1.03769933592
 

Notes:

-With an HP48GX, execution time = 37 seconds in the example above
-This program does not check if the series is convergent or not.


14°)  Associated Legendre Functions


ALF1  ALF3  ALF5  compute the associated Legendre functions of the 1st kind  Pnm(x)

  ALF1  if  | x | < 1
  ALF3  if  | 1-x | < 2
  ALF5  if  | x | > 1

-If  | x | < 1 ,  they use what is called "Associated Legendre function of the first kind of type 2" in reference [2]
-If  | x | > 1  ,  ---------------------- "Associated Legendre function of the first kind of type 3  ---------------
-Cf  http://functions.wolfram.com/ to see all the formullae...

-Likewise,  ALF2  ALF4  ALF6  compute the associated Legendre functions of the 2nd kind  Qnm(x)

  ALF2  if  | x | < 1
  ALF4  if  | 1-x | < 2
  ALF6  if  | x | > 1


           STACK           INPUTS         OUTPUTS
           Level 3                m                /
           Level 2                n                /
           Level 1                x   Pnm(x ) or  Qnm(x)


Examples:

 
   1.2  ENTER
   2.3  ENTER
   0.7   ALF1      ->    P2.31.2(0.7) = -1.87245992968

   1.2  ENTER
   2.3  ENTER
   0.7   ALF2      ->    Q2.31.2(0.7) = 1.17884238034

   1.2  ENTER
   2.3  ENTER
   1.4   ALF3      ->    P2.31.2(1.4) = 6.13299598995

   1.2  ENTER
   2.3  ENTER
   1.4   ALF4      ->    Q2.31.2(1.4) = -0.238771340462 - 0.173477533315 i     ( complex number )

   1.2  ENTER
   2.3  ENTER
   2.4   ALF5      ->    P2.31.2(2.4) = 29.6468224384

   1.2  ENTER
   2.3  ENTER
   2.4   ALF6      ->    Q2.31.2(1.4) = -0.0243521404172 - 0.0176928656611 i   ( complex number )

    1   ENTER
    2   ENTER
    3    ALF6       ->    Q21(3) = -0.016511473615

-If the m & n-values are integers,  with  0 <= m <= n  we can use the following formulae, employed by PMN:

     (n-m) Pnm(x) = x (2n-1) Pn-1m(x) - (n+m-1) Pn-2m(x)

              Pmm(x) = (-1)m (2m-1)!!  ( 1-x2 )m/2   if  | x | < 1                   where (2m-1)!! = (2m-1)(2m-3)(2m-5).......5.3.1
              Pmm(x) =   (2m-1)!!  ( x2-1 )m/2          if  | x | > 1

-If  m = 0 , we have Legendre polynomials


Example:  

   4  ENTER
   7  ENTER
   3   PMN     ->    P74(3) =  37920960


-We also have the relations used by PQMN

      Pnm(x) = ( x2-1 )m/2 dmPn(x)/dxm  if  | x | > 1           Pnm(x) = (-1)m ( 1- x2 )m/2 dmPn(x)/dxm  if  | x | < 1
      Qnm(x) = ( x2-1 )m/2 dmQn(x)/dxm  if  | x | > 1         Qnm(x) = (-1)m ( 1- x2 )m/2 dmQn(x)/dxm  if  | x | < 1

-if  m = 0   Pnm(x) = Pn(x) = Legendre polynomials
        and   Qnm(x) = Qn(x)  with  Q0(x) = 0.5 Ln | (1+x)/(1-x) |  ;  Q1(x) = x/2 Ln | (1+x)/(1-x) | - 1  and   n.Qn(x) = (2n-1).x.Qn-1(x) - (n-1).Qn-2(x)

-We have employed the recurrence relations:   Pnm+1(x) = | x2-1 |-1/2 [ (n-m).x. Pnm(x) - (n+m). Pn-1m(x) ]   ( the same relation holds for Qnm(x) )

Important note:

-If | x | is significantly greater than 1 , Qnm(x) is obtained very inaccurately   ( the recurrence relation is unstable in this case )


           STACK           INPUTS         OUTPUTS
           Level 3                m                /
           Level 2                n            Pnm(x )
           Level 1                x            Qnm(x)


Examples:


    4      ENTER
    7      ENTER             P74(0.6) = 715.309056
  0.6     PQMN  yields   Q74(0.6) = -1011.1718046


-Similarly:      P74(1.2) = 6327.21196829   &   Q74(1.2) = 82.1210783385

-With  x = 1.2   Q74(x)  is still acceptable ( ALF6 produces  82.1210783254 )
  but for x = 3 , the errors are too large and ALF6 is much better


15°)  Bessel Functions


       a)  Bessel & modified Bessel Functions of the 1st & 2nd kind


 JNX  computes Bessel function of the 1st kind  Jn(x) = (x/2)n [ 1/Gam(n+1)  +  (-x2/4)1/ (1! Gam(n+2) )  + .... + (-x2/4)k/ (k! Gam(n+k+1) ) + ....  ]



           STACK           INPUTS         OUTPUTS
           Level 2                n                /
           Level 1                x             Jn(x)


Example:


   0.7   ENTER
   1.9     JNX   yields   J0.7(1.9) = 0.584978103022


  YNX  returns Bessel function of the 2nd kind:    Yn(x) = ( Jn(x) cos(n(pi)) - J-n(x) ) / sin(n(pi))   


           STACK           INPUTS         OUTPUTS
           Level 2                n                /
           Level 1                x             Yn(x)


Example:


    1.2   ENTER
    1.4    YNX   ->  Y1.2(1.4) = -0.593492008383

Note:

  YNX1  may also be used instead of YNX
  It calls UABX as a subroutine


 INX  gives the modified Bessel function of the 1st kind    In(x) = (x/2)n [ 1/Gam(n+1)  +  (x2/4)1/ (1! Gam(n+2) )  + .... + (x2/4)k/ (k! Gam(n+k+1) ) + ....  ]


           STACK           INPUTS         OUTPUTS
           Level 2                n                /
           Level 1                x             In(x)


Example:


   0.7   ENTER
   1.9     INX   yields   I0.7(1.9) = 1.72763060315


  KNX  calculates the modified Bessel function of the 2nd kind     Kn(x) = (pi/2) ( I-n(x) - In(x) ) / sin(n(pi)) 


           STACK           INPUTS         OUTPUTS
           Level 2                n                /
           Level 1                x             Kn(x)


Example:


    1.2   ENTER
    1.4    KNX   ->  K1.2(1.4) =  0.361241917679

Note:

  KNX1  may also be used instead of KNX
  It calls UABX as a subroutine

-The programs above also work with complex arguments.
-They employ the hypergeometric functions
-So, the precision is not very good for large x-values ( it may even become meaningless results )

-The following program JYNX  employs a continued fraction
-They also work well with large x-values, but the arguments must remain real

Formulae:

 With   p + i.q = -1/(2x) + i + (i/x) [ ( 0.52 - n2 )/( 2x + 2i + ( 1.52 - n2 )/( 2x + 4i + ..... ) ) ]
  and      gn =  -1/(((2n + 2)/x) - 1/(((2n + 4)/x) - ..... ))

   Jn(x)  =  sign(D) [ ( 2q/(x.Pi) ) / ( q2 + ( p - gn - n/x )2 ) ] 1/2    where  D = the denominator of the second continued fraction
   Yn(x) =  [ ( p - gn - n/x )/q ] Jn(x)



           STACK           INPUTS         OUTPUTS
           Level 2                n             Jn(x)
           Level 1                x             Yn(x)


Example:


    3.14  ENTER          J3.14(100) =  0.079535723253
    100   JYNX   ->     Y3.14(100) =  0.00658232732688653


  ITJ  computes the integral  §0x Jn(t).dt = 2 ( Jn+1(x) + Jn+3(x) + Jn+5(x) + ........ )



           STACK           INPUTS         OUTPUTS
           Level 2                n                /
           Level 1                x        §0x Jn(t).dt


Example:


     1  ENTER
     3    ITJ     ->       §03  J1(x).dx = 1.2600519549


       b)  Spherical Bessel Functions


-Spherical Bessel functions of the first kind are defined by   jn(x) = (Pi/(2x))1/2 Jn+1/2(x)   where n is an integer
-We can also compute them by the following formula:

             jn-1(x) =  jn(x) (2n+1)/x - jn+1(x)   this recurrence relation is used , starting with  jm(x) = 1 , jm+1(x) = 0  for some large m

-Then, the results are normalized by the sum     1 j02(x) + 3 j12(x) + 5 j22(x) + ....... = 1


           STACK           INPUTS         OUTPUTS
           Level 2              n > 0                /
           Level 1                x             jn(x)


Example:


  2   PI   SB1   yields  j2(Pi) =  0.303963550927

-Spherical Bessel functions of the second kind are defined by    yn(x) = (Pi/(2x))1/2 Yn+1/2(x)   where n is an integer
-We also have::
 
      yn+1(x) =  yn(x) (2n+1)/x - yn-1(x)                         

       y0(x) = -(cos x)/x  ,  y1(x) = -(cos x)/x2 - (sin x)/x


           STACK           INPUTS         OUTPUTS
           Level 2              n > 0                /
           Level 1                x             yn(x)


Example:


  2   PI   SB2   ->   -0.221555282885


       c)  Kelvin Functions


-Kelvin functions of the 1st kind are defined by:

     bern(x)  =  (x/2)n  Sumk=0,1,2,...... cos ((3n/4+k/2)180°) (x2/4)k / ( k! Gam(n+k+1) )            where  Gam = Euler's Gamma function

     bein(x)  =  (x/2)n  Sumk=0,1,2,...... sin ((3n/4+k/2)180°) (x2/4)k / ( k! Gam(n+k+1) )


           STACK           INPUTS         OUTPUTS
           Level 2                n            bern(x)
           Level 1                x            bein(x)


Example:


   2   SQRT              bersqrt(2)(PI) = -0.674095952864     
  PI   KLV1    ->      beisqrt(2)(PI) = -1.59735721106      
                            
-Kelvin functions of the 2nd kind are defined by:

     kern(x) = - (PI/2) [ bein(x) - (ber-n(x)/sin(n.180°)) + (bern(x)/tan(n.180°)) ]            ( cf reference [2] for other formulae if n is an integer )

    kein(x)  =   (PI/2) [ bern(x) + (bei-n(x)/sin(n.180°)) - (bein(x)/tan(n.180°)) ]


           STACK           INPUTS         OUTPUTS
           Level 2                n            kern(x)
           Level 1                x            kein(x)


Example:


   2   SQRT              kersqrt(2)(PI) = 0.0259018942636     
  PI   KLV2    ->      keisqrt(2)(PI) = 0.089242864903


Note:

 S1 & S2 are subroutines called by the Bessel function programs

16°)  Orthogonal Polynomials & Functions


       a)  Laguerre Polynomial

Formulae:      Ln(x) = (2n-1-x).Ln-1(x) - (n-1)2.Ln-2(x)  ;  L0(x) = 1  ;  L1(x) = 1 - x


           STACK           INPUTS         OUTPUTS
           Level 2              n >= 0                /
           Level 1                x             Ln(x)


Example:


    7     ENTER
  3.14  LAG     ->     L7 (3.14) =   -4932.43994869

Note:

-Some authors divide Ln (x) by  n!  

       b)  Generalized Laguerre Polynomials & Functions


Formulae:
      L0(a) (x) = 1  ;   L1(a) (x) = a+1-x   ;    n.Ln(a) (x) = (2.n+a-1-x).Ln-1(a) (x) - (n+a-1).Ln-2(a) (x)


           STACK           INPUTS         OUTPUTS
           Level 3
               a
               /
           Level 2             n >= 0                /
           Level 1                x             Lna(x)


Example:

  1.4  ENTER
   7    ENTER
  PI   PANX    ->     L7(1.4)(Pi) = 1.68889351366

-For a non integer n-value, we can use   Ln(a)(x) = [ Gam(n+a+1) / Gam(n+1) / Gam(a+1) ] M(-n,a+1,x)

   where  Gam = Gamma function
     and      M  = Kummer's function


           STACK           INPUTS         OUTPUTS
           Level 3
               a
               /
           Level 2                n                 /
           Level 1                x             Lna(x)


Example:


  2   SQRT
  7   SQRT
 PI  1/X  LANX    ->     Lsqrt(7)(sqrt(2))(1/PI) =  3.62560918475


       c)  Legendre Polynomials


Formulae:      n.Pn(x) = (2n-1).x.Pn-1(x) - (n-1).Pn-2(x)  ;  P0(x) = 1  ;  P1(x) = x


           STACK           INPUTS         OUTPUTS
           Level 2              n >= 0                /
           Level 1                x             Pn(x)


Example:


    7     ENTER
  3.14  LEG     ->      P7(3.14) = 68076.394314


       d)  Jacobi Polynomials & Functions

Formulae:      P0(a;b) (x) = 1  ;   P1(a;b) (x) = (a-b)/2 + x.(a+b+2)/2

        2n(n+a+b)(2n+a+b-2).Pn(a;b) (x) = [ (2n+a+b-1).(a2-b2) + x.(2n+a+b-2)(2n+a+b-1)(2n+a+b) ] Pn-1(a;b) (x)
                                                              - 2(n+a-1)(n+b-1)(2n+a+b) Pn-2(a;b) (x)


           STACK           INPUTS         OUTPUTS
           Level 4
               a
               /
           Level 3
               b
               /
           Level 2             n >= 0                /
           Level 1                x          Pn(a;b) (x)


Example:


  1.4  ENTER
  1.7  ENTER
   7    ENTER
  PI   1/X  JCP    ->      P7(1.4;1.7)(1/Pi) = -0.32223442011

Note:

-The hypergeometric function also allows to evaluate Jacobi's functions even when n is not an integer:

    Pn(a;b) (x) = [ Gam(a+n+1) / Gam(a+1) / Gam(n+1) ]   F ( -n , a+b+n+1 , a+1 , (1-x)/2 )


           STACK           INPUTS         OUTPUTS
           Level 4
               a
               /
           Level 3
               b
               /
           Level 2                n                 /
           Level 1                x          Pn(a;b) (x)


Example:


   2  SQRT
   3  SQRT
   7  SQRT
  PI  1/X   JCF    ->     Psqrt(7)(sqrt(2),sqrt(3))(1/PI) = -0.887945297368


       e)  Hermite Polynomials & Functions


-Hermite polynomials are defined by:

      Hn(x) = 2x.Hn-1(x) - 2(n-1).Hn-2(x)  ;  H0(x) = 1  ;  H1(x) = 2x


           STACK           INPUTS         OUTPUTS
           Level 2                n                  /
           Level 1                x             Pn(x)


Example:


    7     ENTER
  3.14   HMT       ->      H7 (3.14) =   73726.2432426

Note:

-With non-integer n-values, we have   Hn(x) = 2n sqrt(PI) [ (1/Gam((1-n)/2))  M(-n/2,1/2,x2) - ( 2.x / Gam(-n/2) ) M((1-n)/2,3/2,x2) ]

     where  Gam = Gamma function
       and      M  = Kummer's function


           STACK           INPUTS         OUTPUTS
           Level 2                n                 /
           Level 1                x             Pn(x)


Example:



   0.4   ENTER
    PI   1/X   HMTF     ->      H0.4(1/PI) = 1.01032199692


       f)  Chebyshev Polynomials & Functions


-Chebyshev polynomials are defined by:


Formulae:    Tn(x) = 2x.Tn-1(x) - Tn-2(x)  ;  T0(x) = 1  ;  T1(x) = x         ( first kind ) 

                    Un(x) = 2x.Un-1(x) - Un-2(x)  ;  U0(x) = 1  ;  U1(x) = 2x    ( second kind )



           STACK           INPUTS         OUTPUTS
           Level 2            n >= 0             Tn(x)
           Level 1                x             Un(x)


Examples:


     7       ENTER          T7 (0.314) =  -0.786900700394
  0.314    CHB      ->   U7 (0.314) =  -0.582815680411


-If n is not an integer, we can also use:   Tn(x) = Cos ( n Cos-1 x )   &  Un(x) = Sin ( (n+1) Cos-1 x ) / sqrt ( 1-x2 )



           STACK           INPUTS         OUTPUTS
           Level 2                n                /
           Level 1                x      Tn(x) or Un(x)


Examples:


   7.12    ENTER
  0.314    TNX      ->   T7.12 (0.314) =  -0.870362214734

   7.12    ENTER
  0.314    UNX      ->   U7.12 (0.314) =  -0.707508162579


       g)  Ultraspherical Polynomials & Functions


-The polynomials are defined by:

   C0(a) (x) = 1  ;   C1(a) (x) = 2.a.x   ;    (n+1).Cn+1(a) (x) = 2.(n+a).x.Cn(a) (x) - (n+2a-1).Cn-1(a) (x)      if  a # 0      Cn(0) (x) = (2/n).Tn(x)


           STACK           INPUTS         OUTPUTS
           Level 3
               a
               /
           Level 2             n >= 0                /
           Level 1                x            Cn(a)(x)


Example:

  1.5  ENTER^
   7    PI   1/X   USP    ->      C7(1.5)(1/Pi)  =  -0.989046385317
 

Notes:

-If n is not an integer, Ultraspherical functions are defined as:

   Cn(0)(x) = (2/n) Tn(x)   where  Tn(x) = Chebyshev function, first kind    and if  a#0:
   Cn(a)(x) = [ Gam(n+2a) / Gam(n+1) / Gam(2a) ]  F( -n , n+2a , n+1/2 , (1-x)/2 )   where  F is the hypergeometric function and Gam = Gamma function


           STACK           INPUTS         OUTPUTS
           Level 3
               a
               /
           Level 2                n                 /
           Level 1                x            Cn(a)(x)


Example:


  2  SQRT
  7  SQRT
 PI  1/X  USF     ->      Csqrt(7)(sqrt(2))(1/PI) = -1.57546640046


17°)  Elliptic Functions


       a)  WeierStrass


-The Weierstrass Elliptic Function  P(x;g2;g3)  satisfies the differential equation:   (P')2 = 4.P3 - g2.P - g3
-WEF calculates  P(x;g2;g3) by a Laurent series:

      P(x;g2;g3) = x-2 + c2.x2 + c3.x4 + ...... + cn.x2n-2 + ....

  where   c2 = g2/20  ;   c3 = g3/28  and   cn =  3 ( c2. cn-2 + c3. cn-3 + ....... + cn-2. c2 ) / (( 2n+1 )( n-3 ))      ( n > 3 )


           STACK           INPUT         OUTPUT
           Level 1                x        P(x;g2;g3)


Example:         Calculate  P(x;g2;g3)  for  x = 0.6   g2 = 0.9  g3 = 1.4

-First, store   g2 & g3  in the corresponding variables:   0.9  'G2'  STO    1.4  'G3'  STO

  0.6  WEF    ->   P( 0.6 ; 0.9 ; 1.4 ) = 2.8005007841
   

Duplication Formula:

     P(2x) = -2 P(x) + ( 6 P2(x) - g2/2 )2 / ( 4 ( 4 P3(x) - g2 P(x) - g3 ) )
-This formula is used recursively ( n times ) to obtain  P(2nx) if we know  P(x)     ( n = 1 ; 2 ; 3 ; ..... )


           STACK           INPUTS         OUTPUTS
           Level 2              P(x)                /
           Level 1             n > 0           P(2nx)


Example:
    Calculate   P(x;g2;g3)  for  x = 4.8   g2 = 0.9  g3 = 1.4

-The Laurent series diverges for these arguments but  4.8 = 23* 0.6  and we have already found  that P(0.6;0.9;1.4) = 2.8005007841 , thus:

  ( without changing 'G2' & 'G3' )

   2.8005007841   ENTER
              3             DUPW      ->     P(4.8;0.9;1.4) = 1.9547041716


       b)  Jacobian Elliptic Functions


   JEF calculates sn ( u | m ) , cn ( u | m ) & dn ( u | m )


          STACK       INPUTS    OUTPUTS
          Level 3            /     sn ( u | m )
          Level 2            u     cn ( u | m )
          Level 1            m     dn ( u | m )

 

Examples:

1- Evaluate  sn ( 0.7 | 0.3 )     cn ( 0.7 | 0.3 )     dn ( 0.7 | 0.3 )

                                          sn ( 0.7 | 0.3 )  = 0.63230477631
       0.3 ENTER                cn ( 0.7 | 0.3 ) = 0.774719736327
       0.7   JEF         ->        dn ( 0.7 | 0.3 ) = 0.938113639679

2-Likewise,

                sn ( 0.7 | 1 ) = 0.604367777117          sn ( 0.7 | 2 ) = 0.564297007561        sn ( 0.7 | -3 ) = 0.759113420483
                cn ( 0.7 | 1 ) = 0.796705459993          cn ( 0.7 | 2 ) = 0.825571854710        cn ( 0.7 | -3 ) = 0.650958381789
                dn ( 0.7 | 1 ) = 0.796705459993          dn ( 0.7 | 2 ) = 0.602609139091        dn ( 0.7 | -3 ) =1.65189574594 

Note:

 JEF also works with complex numbers.


       c) Carlson Elliptic Integrals 


  RC is defined by

  RC(x;y) = RF(x;y;y)                          if y > 0
  RC(x;y) = (x/(x-y))1/2 RC(x-y;-y)      if y < 0


           STACK           INPUTS         OUTPUTS
           Level 2                x                /
           Level 1                y           RC(x;y)


Examples:

      1  ENTER
      3    RC         ->       RC(1;3) = 0.675510858854

      1   ENTER
     -3    RC         ->      RC(1;-3) = 0.274653072166

Notes:

 RC also works with complex arguments
 It's actually a degenerate form of RF:

-Carlson has given a new definition of a standard elliptic integral of the first kind:

       RF(x;y;z) =  (1/2) §0infinity  ( ( t + x ).( t + y ).( t + z ) ) -1/2 dt             with  x , y , z  non-negative and at most one is zero

  RF uses the following property:

      RF(x;y;z) = RF((x+L)/4;(y+L)/4;(z+L)/4)  where  L = x1/2y1/2 + x1/2z1/2 + y1/2z1/2

-This transformation is performed until  x , y , z are close enough to apply  RF(x;y;z) = µ -1/2   with  µ = (x+y+z)/3     ( we have  RF(x;x;x) = x -1/2 )
 


           STACK           INPUTS         OUTPUTS
           Level 3
               x
               /
           Level 2                y                /
           Level 1                z         RF(x;y;z)


Example:


    2  ENTER
    3  ENTER
    4     RF       ->      RF(2;3;4) = 0.584082841671

Note:

 RC also works with complex arguments


-The elliptic integral of the third kind RJ is defined by

   RJ(x;y;z;p) =  (3/2)  §0infinity  ( t + p ) -1  ( ( t + x ).( t + y ).( t + z ) ) -1/2  dt        with  x , y , z  non-negative and at most one is zero    p > 0

-We have  RJ(x,x,x,x) = x -3/2 

  RJ applies  RJ(x;y;z;p) = 3 Sumn=0,1,2,....,k  RF(an,bn,bn)/4n + 1/(4k+1µ 3/2)

  where   x0 = x , y0 = y , z0 = z , p0 = p        ;      xn+1 = ( xn+ Ln )/4 , yn+1 = ( yn+ Ln )/4 , zn+1 = ( zn + Ln )/4 , pn+1 = ( pn +Ln )/4

    with    Ln = xn1/2yn1/2 + xn1/2zn1/2 + yn1/2zn1/2
               an = ( pn( xn1/2 + yn1/2 + zn1/2 ) + ( xnynzn )1/2 )2    ;   bn = pn ( pn + Ln )2

    and    µ = (xk+1+yk+1+zk+1+2pk+1)/5

-The iterations stop when  xn , yn , zn , pn  are close enough to produce a good accuracy.
-This program also computes the Cauchy principal value of the integral if  p < 0



           STACK           INPUTS         OUTPUTS
           Level 4
               x
               /
           Level 3
               y
               /
           Level 2                z                /
           Level 1             p # 0         RJ(x;y;z;p)


Examples:


     1  ENTER
     2  ENTER
     3  ENTER
     4     RJ       ->      RJ(1;2;3;4) = 0.239848099749
 

     1  ENTER
     2  ENTER
     3  ENTER
    -4    RJ        >>>>  RJ(1;2;3;-4) =  -0.23786769473

Notes:

 RJ also work if x , y , z  are complex numbers  if p > 0
 But if p < 0 , x , y , z must be real numbers

 RFZ computes  RF( a ; b+i.c ; b-i.c )  where  a , b , c  are real numbers  



           STACK           INPUTS         OUTPUTS
           Level 3
               a
               /
           Level 2                b                /
           Level 1                c     RF(a;b+i.c;b-i.c)


Example:


      2  ENTER
      3  ENTER
      4    RFZ    ->     RF ( 2 , 3+4i , 3-4i ) = 0.543421944621


-This result could be obtained by RF but more slowly
-Likewise, RJZ calculates RJ( a ; b+i.c ; b-i.c ; p )  where  a , b , c , p  are real numbers   ( p # 0 )



           STACK           INPUTS         OUTPUTS
           Level 4
               a
               /
           Level 3
               b
               /
           Level 2                c                /
           Level 1             p # 0     RJ(a;b+i.c;b-i.c;p)


Example:


    1  ENTER
    2  ENTER
    3  ENTER
    4    RJZ          ->       RJ ( 1 , 2+3i , 2-3i , 4 ) = 0.20564414055

Note:

-Unfortunately, RJZ doesn't always work if p < 0
-A formula is used to change p into a positive number but it sometimes fails:

    RJ ( 2 , 3+4i , 3-4i , -7 ) = -0.0939148073957  is correctly computed

 but with  RJ ( 2 , 3+4i , 3-4i , -6 ) , -6  becomes  -0.125  so we cannot use RJZ  ( the HP48 displays "Bad Argument Value" )

-Carlson has also defined a  symmetric Elliptic Integral of the second kind:

  RG(x;y;z) =  (1/4)  §0infinity  ( ( t + x ).( t + y ).( t + z ) ) -1/2 .( x/(t+x) + y/(t+y) + z/(t+z) )  t.dt

And we have:  2.RG(x;y;z) = z.RF(x;y;z) - (x-z)(y-z)/3 RD(x;y;z) + ( x.y/z )1/2


           STACK           INPUTS         OUTPUTS
           Level 3
               x
               /
           Level 2                y                /
           Level 1                z         RG(x;y;z)


Example:


    2  ENTER
    3  ENTER
    4     RG       ->      RG(2;3;4) = 1.72550302806


       d) Surface Area of an Ellipsoid


-The symmetric elliptic integral of the second kind may also be used to compute the area of an ellipsoid:

  Equation of an ellipsoid:     x2/a2 + y2/b2 +x2/c2 = 1 

  Area = 4.PI.RG( a2b2 , a2c2 , b2c2 )


           STACK           INPUTS         OUTPUTS
           Level 3
               a
               /
           Level 2                b                /
           Level 1                c            Area


Example:


    2  ENTER
    4  ENTER
    9    SAE        ->       Area =  283.427384268


Note:

-Variable 'eps'  contains a small number to stop the iterations for computing elliptic integrals ( eps = 10-11 )


18°)  Miscellaneous Functions


       a)  Airy Functions


-They are defined by

    Ai(x) =   f(x) - g(x)                             with            f(x) = [ 3 -2/3 / Gamma(2/3) ] [ 1 + x3/3! + ( 1 . 4 x6 )/6! + ( 1 . 4 . 7 x9 )/9! + .....  ]
    Bi(x) = [ f(x) + g(x) ] sqrt(3)               and            g(x) = [ 3 -1/3 / Gamma(1/3) ] [ x + 2 x4/4! + ( 2 . 5 x7 )/7! + ( 2 . 5 . 8 x10 )/10! + .....  ]

-We can also use Hypergeometric functions


           STACK           INPUTS         OUTPUTS
           Level 2                /             Ai(x)
           Level 1                x             Bi(x)


Example:


                            Ai(0.4) = 0.254742354289
  0.4  AIBI    ->   Bi(0.4) = 0.801773000017
                    

       b)  Anger & Weber Functions

Formulae:

   Jn(x) = + (x/2) sin ( 90°n )  1F2( 1 ; (3-n)/2 , (3+n)/2 ; -x2/4 ) / Gam((3-n)/2) / Gam ((3+n)/2)        ( Anger )
               + cos ( 90°n ) 1F2( 1 ; (2-n)/2 , (2+n)/2 ; -x2/4 ) / Gam((2-n)/2) / Gam ((2+n)/2)

   En(x) = - (x/2) cos ( 90°n )  1F2( 1 ; (3-n)/2 , (3+n)/2 ; -x2/4 ) / Gam((3-n)/2) / Gam ((3+n)/2)       ( Weber )
               + sin ( 90°n ) 1F2( 1 ; (2-n)/2 , (2+n)/2 ; -x2/4 ) / Gam((2-n)/2) / Gam ((2+n)/2)


           STACK           INPUTS         OUTPUTS
           Level 2                n             Jn(x)
           Level 1                x             En(x)


Example:


   2   SQRT                 Jsqrt(2)(PI) =  0.366086558358
  PI  ANWEB    ->     Esqrt(2)(PI) = -0.315594384965
                    

       c)  Dawson Integral


-It is defined by    F(x) = e -x^2 §0x  et^2 dt 

 DAW  employs a continued fraction


           STACK             INPUT         OUTPUT
           Level 1                 x             F(x)


Examples:  

  
1.94  DAW     ->    F( 1.94 ) =  0.314057165471
    100  DAW     ->     F(100)   =  0.0050002500375
                    

       d)  Exponential Integrals En

-We have  En(x) = §1+infinity  t -n e -x.t dt        ( x > 0 ;  n = a positive integer )

     En(x) = (-x)n-1 ( -Ln x - gamma + Sumk=1,...,n-1 1/k ) / (n-1)!  - Sumk#n-1 (-x)k / (k-n+1) / k!        where  gamma = Euler's Constant = 0.5772156649...

-It may also be computed by a continued fraction 

     En(x) = exp (-x) ( 1/(x+n-1.n/(x+n+2-2(n+1)/(x+n+4- .... ))) )

-We also have:   E0(x) = (1/x).exp(-x)  and   En(0) = 1/(n-1)  if  n > 1


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x             En(x)


Examples:

       0    ENTER
     1.4    ENX      ->  E0(1.4) = 0.17614068853

       2    ENTER
     1.4    ENX    ->  E2(1.4) = 0.0838899263411    

    100  ENTER
     1.4   ENX     ->  E100(1.4) = 0.00245580064836
                    

       e)  Exponential Integrals Ei


    Ei(x) = §-infinityx  et/t dt  =     Ei(x)  = C + ln(x) + Sumn=1,2,.....  xn/(n.n!)      where  C = 0.577215664902   is Euler's constant.


           STACK           INPUTS         OUTPUTS
           Level 1                x             Ei(x)


Example:


   1.4   EI     ->     Ei(1.4) =  3.00720746416

Note:

 Logarithmic Integral = Li(x) = Ei(Ln(x))    ( x > 1 )
                    

       f) Sine & Cosine  Integrals


  Si(x) = §0x sin(t)/t dt      ;      Ci(x) = C + Ln(x) + §0x (cos(t)-1)/t dt

   Si(x)  = Sumn=0,1,2,..... (-1)n x2n+1/((2n+1).(2n+1)!)
  Ci(x)  = C + ln(x) + Sumn=1,2,..... (-1)n x2n/(2n.(2n)!)                 where  C = 0.577215664902  is Euler's constant.


           STACK           INPUTS         OUTPUTS
           Level 1                x        Ci(x) or Si(x)

Example:

   1.4   SI     ->     Si(1.4) =  1.25622673278
   1.4   CI    ->     Ci(1.4) =  0.462006585095


Note:

-It also work with complex x-values
-But for large numbers, the precision becomes very small

-If x > 2 , it's preferable to use the following continued fraction:

     -Ci(x) + i.Si(x) - i.pi/2 = exp(-i.x) ( 1/(1+i.x-12/(3+i.x-22/(5+i.x-32/(7+i.x- ..... )))) )


           STACK           INPUTS         OUTPUTS
           Level 3
               /
        Si(x) - Pi/2
           Level 2
               /
             Ci(x)
           Level 1                x               Si(x)

Examples:

                  Si(3)-pi/2  = 0.27785620121
                        Ci(3)  = 0.119629786002
  3   CISI    ->   Si(3)  = 1.84865252801

                  Si(100)-pi/2  = -0.00857085990583
                         Ci(100)  = -0.0051488251426
 100  CISI  ->   Si(100)  =   1.56222546689

Note:      x must be a real number


       g) Hyperbolic Sine & Cosine  Integrals


Definition:             Shi(x) = §0x sinh(t)/t dt      ;      Chi(x) = C + Ln(x) + §0x (cosh(t)-1)/t dt

  Shi(x) = Sumn=0,1,2,.....  x2n+1/((2n+1).(2n+1)!)
  Chi(x)= C + ln(x) + Sumn=1,2,.....  x2n/(2n.(2n)!)        where  C = 0.577215664902   is Euler's constant.


           STACK           INPUTS         OUTPUTS
           Level 1                x        Ci(x) or Si(x)

Example:

   1.4   SHI     ->     Shi(1.4) =  1.56171338837
   1.4   CHI    ->     Chi(1.4) =  1.44549407579


       h) Catalan Function


-Catalan numbers may be generalized to real ( or even complex ) arguments via the formula:

   Cx = 4x Gam(x+1/2) / [ sqrt(PI) Gam(x+2) ]


           STACK           INPUTS         OUTPUTS
           Level 1                x              Cx

Example:

  PI   CAT   ->    CPI = 5.75308575086

-Likewise  Cat (1+2.i) = 0.0452586883297 + 0.518182561743 i


       i) Fresnel  Integrals

-Fresnel integrals are defined by:    S(x) = §0x  sin(pi.t2/2).dt      and      C(x) = §0x  cos(pi.t2/2).dt

Formulae:

     S(x) = SUMn=0,1,2,.....  (-1)n (pi/2)2n+1 x4n+3 / ((2n+1)!(4n+3))

     C(x) = SUMn=0,1,2,.....  (-1)n (pi/2)2n x4n+1 / ((2n)!(4n+1))

-A complex continued fraction is also employed if  x > sqrt(Pi)

          C(x) + i.S(x) = ((1+i)/2) erf z   with   z = (1-i).(x/2).(pi)1/2

 and   ( 1 - erf z ) exp z2 =  (pi) -1/2 ( 1/(z+0.5/(z+1/(z+1.5/(z+2/(z+ .... ))))) )



           STACK           INPUTS         OUTPUTS
           Level 2                /             C(x)
           Level 1                x             S(x)


Examples:


                             C(1.5) = 0.445261176033
   1.5  CSX   ->     S(1.5) = 0.697504960084

                             C(4) = 0.498426033044
    4    CSX   ->     S(4) = 0.420515754248


       j) Debye Function


Definition:   db(x;n) = §x+infinity  tn/(et-1).dt      where   n is a positive integer  and  x > 0

Formula:     db(x;n) = Sum k>0  e-k.x [ xn/k + n.xn-1/k2 + ..... + n!/kn+1 ]



           STACK           INPUTS         OUTPUTS
           Level 2                x               /
           Level 1                n           db(x;n)


Example:


  0.7  ENTER
   3    DBXN     ->    db( 0.7 ; 3 ) = 6.40683359558


       k) Parabolic Cylinder Function


Formula:

    Dn(x) = 2n/2 Pi1/2 exp(-x2/4) [ 1/Gam((1-n)/2) M( -n/2 , 1/2 , x2/2 ) - 21/2 ( x / Gam(-n/2) ) M [ (1-n)/2 , 3/2 , x2/2 ]


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x            Dn(x)


Example:


   0.4   ENTER
   1.8    DNX      ->     D0.4(1.8) = 0.579579486208


       l) Error Function


Definition:

     erf x =  (2/pi1/2)  §0x  e-t^2 dt

Formula:

     erf x = (2x/Pi1/2) exp(-x2)  M( 1 , 3/2 , x2 )



           STACK           INPUT         OUTPUT
           Level 1                x             erf(x)

Example:

  2    ERF     ->     erf (2) = 0.995322265031


       m)  Fibonacci Functions


 Fn(x) = [ 2-n ( x + sqrt( x2 +4 ) )n  -  Cos ( n.Pi )  2n ( x + sqrt( x2 +4 ) )-n ] / sqrt ( x2 +4 )


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x            Fn(x)


Example:


  1.2  ENTER
  3.7    FIB        ->     F1.2(3.7) = 1.27417856357


       n) Struve Functions


-The Struve function is defined by    Hn(x) = (x/2)n+1 1F~2( 1 ; 3/2 , n + 3/2 ; - x2/4 )           where  1F~2  is a regularized hypergeometric function.
 and the modified Struve function:    Ln(x) =  (x/2)n+1 1F~2( 1 ; 3/2 , n + 3/2 ;  x2/4 )


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x      Hn(x) or Ln(x)


Example:


   1.2  ENTER  
   3.4    HNX       ->      H1.2 ( 3.4 ) = 1.11337265756

   1.2  ENTER
   3.4    LNX       ->       L1.2 ( 3.4 ) = 4.64912946473


       o) Lommel Functions

-"LOM1" & "LOM2" calculate the Lommel functions of the 1st & 2nd kind.
-They use the formulae:
 

    s(1)m,n(x)  = xm+1 / [ (m+1)2 - n21F2 ( 1 ; (m-n+3)/2 , (m+n+3)/2 ; -x2/4 )

    s(2)m,n(x)  = xm+1 / [ (m+1)2 - n21F2 ( 1 ; (m-n+3)/2 , (m+n+3)/2 ; x2/4 )
                      + 2m+n-1 Gam(n) Gam((m+n+1)/2) x -n / Gam((-m+n+1)/2)  0F1 ( ; 1-n ; -x2/4 )
                      + 2m-n-1 Gam(-n) Gam((m-n+1)/2) xn / Gam((-m-n+1)/2)  0F1 ( ; 1+n ; -x2/4 )

   where  pFq is the generalized hypergeometric function and Gam is Euler Gamma function.


           STACK           INPUTS         OUTPUTS
           Level 3
               m
              /
           Level 2                n               /
           Level 1                x  s(1)m,n(x) or s(2)m,n(x)


Example:

   2   SQRT
   3   SQRT
  PI  LOM1           ->               s(1)sqrt(2),sqrt(3)(PI) = 3.0030603835      

   2   SQRT
   3   SQRT
  PI  LOM2          ->                s(2)sqrt(2),sqrt(3)(PI) = 9.04879866075


       p)  Polylogarithm


Definition:              Lin(x) = SUMk=1,2,...  xk/kn


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x           Lin(x)


Example:


        3   ENTER
      0.7    LIN          ->       Li3(0.7) = 0.780063934258


       q)  Incomplete Beta Function


-The incomplete Beta function is defined by   Bx(a,b) = §0x  ta-1 (1-t)b-1 dt       ( a , b > 0 )
-We have also  Bx(a,b) = (xa/a) (1-x)b F(1,a+b,a+1,x)   where  F is the hypergeometric function



           STACK           INPUTS         OUTPUTS
           Level 3
               x
              /
           Level 2                a               /
           Level 1                b         Bx(a,b)


Example:


    0.7   ENTER
    PI    ENTER
1   E^X  IBF        ->      B0.7(Pi,e) =  0.0296230460336


       r)  Incomplete Gamma Function


-The incomplete gamma function is defind by    igam(a,x) =  §0x  e -t ta-1 dt

  IGF  employs:      igam(a,x) =  (xa/a).M(a,a+1,-x)         ( M = Kummer's Function )


           STACK           INPUTS         OUTPUTS
           Level 2                a               /
           Level 1                x         igam(a,x)


Example:


     1.2   ENTER
     1.7   IGAM       ->      igam(1.2,1.7) =  0.697290896826


       s)  Lerch Transcendent Function


-Lerch transcendent function is defined by    PHI( x , s , a ) = SUM k=0,1,2,....   xk / ( a + k )s    


           STACK           INPUTS         OUTPUTS
           Level 3
               x
              /
           Level 2                s               /
           Level 1                a     PHI( x , s , a )


Example:


   0.7   ENTER
    PI   ENTER
   0.6  LERCH      ->     F( 0.7 ; PI ; 0.6 ) = 5.1706011314     

-Likewise,        PHI( 0.3 + 0.4 i  , 3 + 4 i , 1 + 2 i ) =  7.65815909509 - 1.51511436459 i

Notes:

-Here, we assume that  a # 0 , -1 , -2 , .....
-Execution time tends to infinity as | x | tends to 1.


       t)  Coulomb Wave  Functions

-The regular Coulomb wave function  FL(n,r)  and the irregular Coulomb wave function GL(n,r) are 2 independant solutions  of the differential equation:

           d2y/dr2 + [ 1 - 2n/r - L(L+1)/r2 ] y = 0

Formula:      

    FL(n,r) = 2L rL+1 [ 1/Gam(2L+2) ] | Gam(L+1+i.n) | exp [ -(Pi) n/2 - i r ]  1F1 (L+1-i.n;2L+2;2i.r)    where   Mk,µ = Whittaker's function of the 1st kind



           STACK           INPUTS         OUTPUTS
           Level 3
               L
              /
           Level 2                n               /
           Level 1                r         FL(n,r)


Example:


   1.4   ENTER
  -2.1   ENTER
   1.6   RCWF      ->     F1.4( -2.1 , 1.6 ) =  0.779739873373

Notes:

-In fact, with the example above, the HP48 returns   0.779739873373 + 3.247... E-11 i
-Without roundoff-error, imaginary part = 0


-The irregular Coulomb wave function can be computed by:

   GL(n,r) = i FL(n,r) + | Gam(L+1+i.n) |  [ 1/Gam(L+1+i.n) ]  exp [ (PI) n/2 + i L(PI)/2 ]  Wi.n,L+1/2 (2i.r)

   where  Wk,µ = Whittaker's function of the 2nd kind


           STACK           INPUTS         OUTPUTS
           Level 3
               L
              /
           Level 2                n               /
           Level 1                r         GL(n,r)


Example:


   1.4   ENTER
  -2.1   ENTER
   1.6   ICWF      ->     G1.4( -2.1 , 1.6 ) =  -0.20636826825

Notes:

-With the example above, the HP48 returns   0.77973987338 + 0.000000000039 i
-Without roundoff-error, imaginary part = 0


       u)  Whittaker's Functions

-Whittaker's function of the 1st kind  Mk,m(x) is defined by

       Mk,m(x) = xm+1/2  e -x/2  M(m-k+1/2,2m+1,x)

where  M(a,b,x) = Kummer's function.


           STACK           INPUTS         OUTPUTS
           Level 3
               k
              /
           Level 2                m               /
           Level 1                x          Mk,m(x)


Example:


  2   SQRT
  3   SQRT
 PI  WHIM      ->       Msqrt(2),sqrt(3)(PI) = 5.61242619637


-Whittaker's function of the 2nd kind  Wk,m(x) is defined by

       Wk,m(x) = xm+1/2  e -x/2  U(m-k+1/2,2m+1,x)

where  U(a,b,x) = hypergeometricU function.


           STACK           INPUTS         OUTPUTS
           Level 3
               k
              /
           Level 2                m               /
           Level 1                x          Wk,m(x)


Example:


  2   SQRT
  3   SQRT
 PI  WHIW      ->       Wsqrt(2),sqrt(3)(PI) = 2.17759342004


       v)  Toronto Functions


-Toronto function is defined by

   T(m,n,r) = exp(-r2) [ Gam((m+1)/2) / n! ] r2n-m+1  M( (m+1)/2 , n+1 , r2 )

 where M(a,b,x) = Kummer's function


           STACK           INPUTS         OUTPUTS
           Level 3
               m
              /
           Level 2                n               /
           Level 1                r         T(m,n,r)


Example:


   2   SQRT
   3   SQRT
  PI   TOR      ->       T( sqrt(2),sqrt(3),PI ) = 0.963524225381


19°)  Spheroidal Wave Functions


-We want to solve the differential equation   ( 1 - x2 ) d2S/dx2 - 2.x  dS/dx + [ Lmn - c2 x2 - m2/( 1 - x2 ) S ] = 0

-First, LMN finds the eigenvalues Lmn by solving the transcendental equation   U1(Lmn) + U2(Lmn) = 0   where    U1 & U2  are 2 continued fractions:

                                                 -brm                      -br-2m
   U1(Lmn) = grm - Lmn +    ---------------       ---------------   ..............
                                           gr-2m - Lmn +         gr-4m - Lmn +

                                                                                                                           r = n - m
                                     -br+2m                    -br+4m
   U2(Lmn) =           ---------------       ----------------   ..............
                               gr+2m - Lmn +         gr+4m - Lmn +
 

   with      brm  =  [ r.(r-1).(2m+r).(2m+r-1).c4 ] / [ (2m+2r-1)2.(2m+2r+1).(2m+2r-3) ]
   and      grm  =  (m+r).(m+r+1) + (c2/2).[ 1 - (4m2-1)/((2m+2r-1).(2m+2r+3)) ]


-In fact, LMN only employs 12 iterations ( stored in 'ITER' ) to calculate the continued fractions.
-So, you can change the number of iterations - store another integer in 'ITER' - to check the accuracy


Example:      m = 0.2  ,  n = 0.6 ,  c2 = 1.7

-Store these 3 numbers in the corresponding variables  'M'  'N'  'C2'

   LMN       ->       Lmn = 2.24686665135      ( we get the same result with 14 stored in 'ITER' )

-This value is stored automatically in 'L'


-Then  SWF  computes   Smn(x)    with  | x | < 1   by the following formulae:

  Smn(x) = ( 1 - x2 )m/2  f(x)        where   f(x) = Sumk=0,1,.... ak xk

     with  a0 = Pnm(0)  =  2m sqrt(PI) / [ Gam((1-m-n)/2) Gam((2-m+n)/2 ]                           Flammer's scheme
     and   a1 = P'nm(0) = ( m + n ) 2m sqrt(PI) / [ Gam((2-m-n)/2) Gam((1-m+n)/2 ]

-In both cases,   (k+1)(k+2) ak+2 - [ k ( k + 2m + 1 ) - Lmn + m ( m + 1 ) ] ak  - c2  ak-2 = 0



           STACK           INPUTS         OUTPUTS
           Level 1                x            Smn(x)


Example:


  0.7   SWF      ->      Smn(0.7) = 0.682645661102


20°)  Ellipsoidal Wave Functions


-The ellipsoidal wave function W(x) satisfies the differential equation:

      W''(x) = W(x) [ a + b k2 Sn2 (x) + q k4 Sn4 (x) ]     where  Sn (x) is a Jacobian elliptic function.

-EWF  computes a solution of the form  W(x) = 1 + A1 t + A2 t2 + ............. + Am tm + ................

     where  t = Sn2 (x | k2  )

-This leads to the recurrence relation

     ( 2m+1 ) (2m+2 ) Am+1 = q k4 Am-2 + Am-1 k2 [ b - 2 ( m-1 ) ( 2m - 1 ) ] + Am [ -a + 4 m2 ( k2 + 1 ) ]


            STACK            INPUT          OUTPUT
             Level 1                x             W(x)

 
Example:             a = -1.2    b = 4.59   k2 = 0.8   q = - sqrt(2)

-Calculate  W(1)   

-Sore the 4 constants  a = -1.2    b = 4.59   k2 = 0.8   q = - sqrt(2)   into the corresponding variables  'a'   'b'   'K2'   'q'
 
-Then     1   EWF    ->     W(1) = 0.640627307889      


Note:

  SNX  computes the Jacobian elliptic function:  sn ( u | m )  ( cf §17-b )

Example:  0.7  ENTER  0.3  SNX  ->   sn ( 0.7 | 0.3 )  = 0.63230477631


21°)  Euler Gamma Constant


 'EULER'  simply contains Euler's gamma constant = 0.577215664902

 This is called by several programs



22°)  Asymptotic Expansions


       a)  Airy Functions


 AIBI  computes  Ai(x) & Bi(x)  for large positive x-values:

     Ai(x) ~ { 1/2sqrt[ pi sqrt(x) ]  }  exp ( -2/3 x3/22F0( 1/6 , 5/6 ; -3/(4x3/2) )
     Bi(x) ~ { 1/sqrt[ pi sqrt(x) ]  }  exp ( 2/3 x3/22F0( 1/6 , 5/6 ; 3/(4x3/2) )


           STACK           INPUTS         OUTPUTS
           Level 2                /             Ai(x)
           Level 1             x > 0             Bi(x)


Example:

                         Ai(8) = 4.69220761616 E-8
  8  AIBI   ->     Bi(8) = 1199586.00411


Note:

-If x is not large enough, the ( divergent ) series leads to an infinite loop.
-Press ON to stop the loops.


       b)  Coulomb Wave Functions


Formulae:

    FL(n,r)  =  g cos µ + f sin µ       where       µ     =   r - n Ln (2r) - L.(Pi)/2 + Arg Gam ( 1 + L + i n )
    GL(n,r)  =  f cos µ - g sin µ         and      f + i.g ~  u0 + u1 + u2 + ............ + uk + ......................

    with  u0 = 1  and   uk / uk-1 = ( i n - L + k - 1 ) ( i n + L + k ) / ( 2k i r )        ( k > 0 )



           STACK           INPUTS         OUTPUTS
           Level 3
               L
              /
           Level 2                n               /
           Level 1                r         FL(n,r)


Example:
   L = 3   n = 4   r = 21

     3   ENTER
     4   ENTER             F3(4;21) = 1.13300294999
    21    CWF     ->     G3(4;21) = 0.121760594375

Note:

-If x is not large enough, the ( divergent ) series leads to an infinite loop.
-Press ON to stop the loops.


       c)  Parabolic Cylinder Functions


xn exp(-x2/4) [ 1 - n(n-1) / ( 2 x2 ) + n(n-1)(n-2)(n-3) / ( 2 ( 4 x4 ) ) - ....... ]


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x            Dn(x)


Example:


   PI    ENTER
 5.37    DNX      ->     DPi(5.37) = 0.12839987247

Note:

-If x is not large enough, the ( divergent ) series leads to an infinite loop.
-Press ON to stop the loops.


       d)  Exponential Integrals En


Formula:    En(x)  ~  (1/x) exp(-x)  2F0 ( 1 , n ; -1/x )


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x            En(x)


Example:


   PI    ENTER
   41     ENX      ->     EPi(41) =  3.54610150354 E-20

Note:

-If x is not large enough, the ( divergent ) series leads to an infinite loop.
-Press ON to stop the loops.


       e)  Struve Functions Hn


-We have:      Hn(x)  ~  Yn(x)  + [ 21-n xn-1 / sqrt(Pi) / Gam(n+1/2) ]  3F0( 1/2 , -n + 1/2 , 1 ; -4/x2 )      


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x            Hn(x)


Example:


   PI    ENTER
   24     ENX      ->     HPi(24) = 29.8495813024

Note:

-If x is not large enough, the ( divergent ) series leads to an infinite loop.
-Press ON to stop the loops.


       f)  Bessel Functions  J & Y  and K

Formulae:

    Jn(x) = (2/(pi*x))1/2 ( P.cos(x-(2n+1)pi/4) - Q.sin(x-(2n+1)pi/4) )  
   Yn(x) = (2/(pi*x))1/2 ( P.sin(x-(2n+1)pi/4) + Q.cos(x-(2n+1)pi/4) )

  where   P ~  1 - (4n2-1)(4n2-9)/(2!(8x)2) + (4n2-1)(4n2-9)(4n2-25)(4n2-49)/(4!(8x)4) - ......
     and   Q ~  (4n2-1)/(8x) - (4n2-1)(4n2-9)(4n2-25)/(3!(8x)3) + ......


           STACK           INPUTS         OUTPUTS
           Level 2                n             Jn(x)
           Level 1                x            Yn(x)


Example:


    PI  ENTER              JPi(16) = -0.0811607476181
    16  JYNX       ->    YPi(16) = -0.184298980133

Notes:

-In fact, the continued fraction used in  JYNX  in the  BESSEL  directory also works for large arguments

-With the modified Bessel function  Kn(x) , we have the formula:

     Kn(x) ~  (pi/(2x))1/2 e-x  ( 1 + (4n2-1)/(8x) + (4n2-1)(4n2-9)/(2!(8x)2) + (4n2-1)(4n2-9)(4n2-25)/(3!(8x)3) + ......  )


           STACK           INPUTS         OUTPUTS
           Level 2                n               /
           Level 1                x            Kn(x)


Example:


  1.4  ENTER
  19    KNX         ->      K1.4(19) = 1.683198846503 E-9


Note:

-If x is not large enough, the ( divergent ) series leads to an infinite loop.
-Press ON to stop the loops.


23°)  Fractional-Integro Differentiation


-If a function f is defined by a power series:  f(x) = SUMk=0,1,2,.....   ck xk  ,  its fractional integro-differentiation may be computed by

   dµ f / dxµ = Dµ f(x) = SUMk=0,1,2,.....   ck [ Gam(k+1) / Gam(k+1-µ) ] xk-µ    where  µ is a real number ( integer or fractional )

-If the function may be expressed in terms of hypergeometric functions pFq , the following relation is very useful too:

   Dµ pFq ( a1 , .......... , ap ; b1 , .......... bq ; x ) = x Gam(b1).........Gam(bq)   p+1F~q+1 ( 1 , a1 , .......... , ap ; 1-µ , b1 , .......... bq ; x )

   where   Gam = Euler's Gamma function  and pF~q  is the regularized generalized hypergeometric function


       a) Exponential  


    Dµ Exp x = x 1F~1 ( 1 ; 1-µ ; x )
 

           STACK           INPUTS         OUTPUTS
           Level 2                µ               /
           Level 1                x            Dµ Exp x


Example:


     3.14   ENTER
     1.28   DEXP       ->      D3.14 Exp ( 1.28 ) = 3.50196367142


       b)  Logarithm

       Dµ Ln x = x FC(µ)log (x)

        where     FC(µ)log (x) = (-1)µ-1 (µ-1) !                                               if  µ is a positive integer
          and       FC(µ)log (x) = [ Ln x - Psi(1-µ) - gamma ] / Gam(1-µ)        otherwise

      Psi = Digamma Function , gamma = Euler's constant = 0.5772156649...  and  Gam = Gamma Function.


           STACK           INPUTS         OUTPUTS
           Level 2                µ               /
           Level 1                x            Dµ Ln x


Example:


     3.14   ENTER
     1.28    DLN       ->       D3.14 Ln ( 1.28 ) = 1.13856985083


       c)  FClog


FC(µ)log (x) = (-1)µ-1 (µ-1) !                                               if  µ is a positive integer
          and       FC(µ)log (x) = [ Ln x - Psi(1-µ) - gamma ] / Gam(1-µ)        otherwise

      Psi = Digamma Function , gamma = Euler's constant = 0.5772156649...  and  Gam = Gamma Function.



           STACK           INPUTS         OUTPUTS
           Level 2                µ               /
           Level 1                x        FC(µ)log (x)


Example:


     3.14   ENTER
     1.28    FCLN      ->    FC(3.14)log (1.28) = 2.47171836412


       d)  Cosine


   Dµ Cos x = (2/x)µ sqrt(PI)  1F~2 ( 1 ; (1-µ)/2 , (2-µ)/2 ; -x2/4 )


           STACK           INPUTS         OUTPUTS
           Level 2                µ               /
           Level 1                x         Dµ Cos x


Example:


     3.14   ENTER
     1.28   DCOS        ->       D3.14 Cos ( 1.28 ) = 0.888787267089


       e)  Sine

    Dµ Sin x = 2µ-1 sqrt(PI) x1-µ1F~2 ( 1 ; (2-µ)/2 , (3-µ)/2 ; -x2/4 )


           STACK           INPUTS         OUTPUTS
           Level 2                µ               /
           Level 1                x         Dµ Sin x


Example:


     3.14   ENTER
     1.28   DSIN        ->       D3.14 Sin ( 1.28 ) = -1.91420925734 E-2


       f)  Hyperbolic Cosine


   Dµ Cosh x = (2/x)µ sqrt(PI)  1F~2 ( 1 ; (1-µ)/2 , (2-µ)/2 ; x2/4 )


           STACK           INPUTS         OUTPUTS
           Level 2                µ               /
           Level 1                x         Dµ Cosh x


Example:


     3.14   ENTER
     1.28    DCH        ->       D3.14 Cosh ( 1.28 ) = 1.50295822021


       g)  Hyperbolic Sine


     Dµ Sinh x = 2µ-1 sqrt(PI) x1-µ1F~2 ( 1 ; (2-µ)/2 , (3-µ)/2 ; x2/4 )


           STACK           INPUTS         OUTPUTS
           Level 2                µ               /
           Level 1                x         Dµ Sinh x


Example:


     3.14   ENTER
     1.28    DSH        ->       D3.14 Sinh ( 1.28 ) = 1.9990054512


       h)  Airy Functions

       Dµ Ai(x) = 3µ-4/3 x  { 32/3 Gam(1/3) 2F~3 [ 1/3 , 1 ; (1-µ)/3 , (2-µ)/3 , (3-µ)/3 ; x3/9 ] - x Gam(2/3) 2F~3 [ 2/3 , 1 ; (4-µ)/3 , (2-µ)/3 , (3-µ)/3 ; x3/9 ] }

       Dµ Bi(x) = 3µ-5/6 x  { 32/3 Gam(1/3) 2F~3 [ 1/3 , 1 ; (1-µ)/3 , (2-µ)/3 , (3-µ)/3 ; x3/9 ] + x Gam(2/3) 2F~3 [ 2/3 , 1 ; (4-µ)/3 , (2-µ)/3 , (3-µ)/3 ; x3/9 ] }


           STACK           INPUTS         OUTPUTS
           Level 2                µ         Dµ Ai(x)
           Level 1                x         Dµ Bi(x)


Example:


     3.14   ENTER                      D3.14 Ai ( 1.28 ) = -0.162004855985
     1.28   DAIBI      ->              D3.14 Bi ( 1.28 ) =   3.43259262532


       i) Error Function


  Dµ Erf (x) = 2µ x1-µ 2F~2 [ 1/2 , 1 ; (2-µ)/2 , (3-µ)/2 ; -x2 ]


           STACK           INPUTS         OUTPUTS
           Level 2                µ                /
           Level 1                x          Dµ Erf(x)


Example:


     3.14   ENTER          
     1.28   DERF         ->      D3.14 Erf ( 1.28 ) =   1.25055702267


       j)  Hermite Functions


     Dµ Hn (x) = [ 2n+µ (PI) x / Gam((1-n)/2) ] 2F~2 [ 1 , -n/2 ; (1-µ)/2 , (2-µ)/2 ; x2 ] - [ 2n+µ (PI) x1-µ / Gam((-n)/2) ] 2F~2 [ 1 , (1-n)/2 ; 1-µ/2 , (3-µ)/2 ; x2 ]


           STACK           INPUTS         OUTPUTS
           Level 3                µ                /
           Level 2
               n
               /
           Level 1                x          Dµ Hn (x)


Example:


     3.14   ENTER
     2.41   ENTER
     1.28   DHMT       ->        D3.14 H2.41 ( 1.28 ) = 3.53770762114


       k)  Kummer's Function


   Dµ F(a;b;x) = x Gam(b) 2F~2 ( 1 , a ; 1-µ , b ; x )


           STACK           INPUTS         OUTPUTS
           Level 4                µ                /
           Level 2
               a
               /
           Level 2
               b
               /
           Level 1                x         Dµ F(a;b;x)


Example:


     3.14   ENTER
        2     SQRT
        3     SQRT
     1.28   DKUM       ->       D3.14 F ( 21/2 ; 31/2 ; 1.28 ) = 2.07589150484


       l)  Generalized Laguerre Functions


    Dµ Lan (x) = [ Gam(n+a+1)/Gam(n+1) ] x2F~2 ( 1 , -n ; a+1 , 1-µ ; x )


           STACK           INPUTS         OUTPUTS
           Level 4                µ                /
           Level 2
               a
               /
           Level 2
               n
               /
           Level 1                x         Dµ Lan (x)


Example:

     3.14   ENTER
     1.76   ENTER
     2.41   ENTER
     1.28   DLANX      ->       D3.14 L1.762.41 ( 1.28 ) = -1.767203465

       m)  Bessel Functions


  •  Bessel Function - 1st kind           Dµ Jn (x) = 2µ-2n sqrt(PI)  xn-µ  Gam(n+1)  2F~3 [ (n+1)/2 , (n+2)/2 ; (n+1-µ)/2 , (n+2-µ)/2 , n+1 ; -x2/4 ]

  •  Bessel Function - 2nd kind

               Dµ Yn (x) = 2µ-2n (PI)1/2  x-µ-n csc(n.PI) { -16n Gam(1-n)  2F~3 [ (1-n)/2 , (2-n)/2 ; (1-µ-n)/2 , (2-µ-n)/2 , 1-n ; -x2/4 ]

                               + x2n Cos(n.PI) Gam(n+1)  2F~3 [ (n+1)/2 , (n+2)/2 ; (n+1-µ)/2 , (n+2-µ)/2 , n+1 ; -x2/4 ] }    where n is not an integer.

  •  Modified Bessel Function - 1st kind      Dµ In (x) = 2µ-2n sqrt(PI) xn-µ  Gam(n+1)  2F~3 [ (n+1)/2 , (n+2)/2 ; (n+1-µ)/2 , (n+2-µ)/2 , n+1 ; x2/4 ]


  •  Modified Bessel Function - 2nd kind

               Dµ Kn (x) = 2µ-2n-1 (PI)3/2  x-µ-n csc(n.PI) { 16n Gam(1-n)  2F~3 [ (1-n)/2 , (2-n)/2 ; (1-µ-n)/2 , (2-µ-n)/2 , 1-n ; x2/4 ]

                                 - x2n Gam(n+1)  2F~3 [ (n+1)/2 , (n+2)/2 ; (n+1-µ)/2 , (n+2-µ)/2 , n+1 ; x2/4 ] }    where n is not an integer.

  •  Spherical Bessel Function - 1st kind      Dµ jn (x) = 2µ-2n-1 PI  xn-µ  Gam(n+1)  2F~3 [ (n+1)/2 , (n+2)/2 ; (n+1-µ)/2 , (n+2-µ)/2 , n+3/2 ; -x2/4 ]


           STACK           INPUTS         OUTPUTS
           Level 3                µ                /
           Level 2
               n
               /
           Level 1                x          Dµ Besseln (x)


Examples:


     3.14   ENTER
     2.41   ENTER
     1.28   DJNX      ->      D3.14 J2.41 ( 1.28 ) = -0.150524582429

     3.14   ENTER
     2.41   ENTER
     1.28   DYNX      ->      D3.14 Y2.41 ( 1.28 ) = 25.493085779

     3.14   ENTER
     2.41   ENTER
     1.28   DINX      ->       D3.14 I2.41 ( 1.28 ) = 0.352247278862

     3.14   ENTER
     2.41   ENTER
     1.28   DKNX      ->      D3.14 K2.41 ( 1.28 ) = -38.9846931335

     3.14   ENTER
     2.41   ENTER
     1.28   DSB1       ->      D3.14 j2.41 ( 1.28 ) = -0.064451621889


       n)  Fresnel Integrals

  •  Fresnel Cosine Integral     Dµ C(x) = 22µ-3/2 PI3/2 x1-µ3F~4 [ 1/4 , 3/4 , 1 ; (2-µ)/4 , (3-µ)/4 , (4-µ)/4 , (5-µ)/4 ; -(PI)2 x4/16 ]
 

  •  Fresnel Sine Integral    Dµ S(x) = 22µ-11/2 PI5/2 x3-µ3F~4 [ 3/4 , 1 , 5/4 ; (4-µ)/4 , (5-µ)/4 , (6-µ)/4 , (6-µ)/4 ; -(PI)2 x4/16 ]


           STACK           INPUTS         OUTPUTS
           Level 2                µ                /
           Level 1                x   Dµ C(x) or Dµ S(x)


Examples:


     3.14   ENTER
     1.28    DCX      ->        D3.14 C ( 1.28 ) = 16.9561224908

     3.14   ENTER
     1.28    DSX       ->        D3.14 S ( 1.28 ) = -11.203027733


       o)  Exponential Integrals & Related Functions


  •  Exponential Integral     Dµ Ei x = [ FC(µ)log (x) + gamma / Gam(1-µ) ] x + x1-µ  2F~2 ( 1 , 1 ; 2 , 2-µ ; x )

  •  Sine Integral             Dµ Si x = 2µ-2  PI  x1-µ2F~3 ( 1/2 , 1 ; 3/2 , (2-µ)/2 , (3-µ)/2 ; -x2/4 )
 

  •  Hyperbolic Sine Integral         Dµ Shi x = 2µ-2  PI  x1-µ2F~3 ( 1/2 , 1 ; 3/2 , (2-µ)/2 , (3-µ)/2 ; x2/4 )
 

  •  Cosine Integral           Dµ Ci x = [ FC(µ)log (x) + gamma / Gam(1-µ) ] x - 2µ-3  sqrt(PI)  x2-µ  2F~3 ( 1 , 1 ; 2 , (3-µ)/2 , (4-µ)/2 ; -x2/4 )
 

  •  Hyperbolic Cosine Integral     Dµ Chi x = [ FC(µ)log (x) + gamma / Gam(1-µ) ] x + 2µ-3  sqrt(PI)  x2-µ  2F~3 ( 1 , 1 ; 2 , (3-µ)/2 , (4-µ)/2 ; x2/4 )



           STACK           INPUTS         OUTPUTS
           Level 2                µ                /
           Level 1                x         Dµ ... (x)


Examples:


     3.14   ENTER
     1.28     DEI         ->        D3.14 Ei ( 1.28 ) = 1.98213560559

     3.14   ENTER
     1.28     DSI         ->        D3.14 Si ( 1.28 ) = -0.045395643837

     3.14   ENTER
     1.28   DSHI        ->         D3.14 Shi ( 1.28 ) = 0.57649521068

     3.14   ENTER
     1.28    DCI         ->         D3.14 Ci ( 1.28 ) = 1.36732389602

     3.14   ENTER
     1.28   DCHI        ->        D3.14 Chi ( 1.28 ) = 1.4056403949


Notes:

-The results are accurate only if x is enough small.
-S1  S2   .......   S7   are subroutines called by the programs above.



24°)  Non-Linear Systems


       a)  Secant Method


 SOLVE employs the generalized secant method to solve a system of n equations in n unkowns.
 They must be written under the form:


    f1( x1,... ,xn )  = 0
       .....................

    fn( x
1, ... ,xn ) = 0


  SOLVE takes a program in level  3 that takes the vector V = [ x1 , ...... , xn ]  and returns   [ f1(x1, ....,xn) , ...... , fn(x1, ....,xn) ]  in level 1

                and 2 initial guesses  [ x1(1) , ...... , xn(1) ]
                                        and   [ x1(2) , ...... , xn(2) ]  in levels 1 & 2

-The successive approximations are displayed and - if the method is convergent - gives | F(V) | in level 2 & a solution in level 1  ( level 3 is unchanged )


           STACK           INPUTS         OUTPUTS
           Level 3
          << F >>
         << F >>
           Level 2    [ x1(1) , ...... , xn(1) ]            | F(V) |
           Level 1    [ x1(2) , ...... , xn(2) ]           VSolution


Example:       Find a solution near ( 4 , 1 , 3 , 6 ) of the system:

       x + y + z + t - 16 = 0
          x y z - 3 t          = 0
       4 x2 - y z t - 40    = 0
          x y z t - 140     = 0

   <<  OBJ->  DROP  ->  X Y Z T
      <<  X  Y  Z  T  +  +  +  16  -
             X  Y  Z *  *  T  3  *  -
             X  SQ  4  *  Y  Z  T  *  *  -  40  -
             X  Y  Z  T  *  *  *  140  -
             4  ->ARRY
       >>
    >>                           ENTER
      [  4  1  3  6  ]         ENTER
 [ 4.1  1.1  3.1  6.1 ]    SOLVE           the successive approximations are displayed and eventually, we get:


   Level 2                                                                  0
   Level 1           [ 4.26654047494  1.35363223606  3.54852677842  6.83130051063 ]
     
-So    f(V) ~ 0    and we have one solution:

    x = 4.26654047494
    y = 1.35363223606
    z = 3.54852677842
    t  = 6.83130051063


Note:

-The iterations stop when 2 successive x-values are identical, so
-All the coordinates of the 2 initial guesses must be different:     xj(1)  #   xj(2)   for  all  j


       b)  Newton's Method          


   NEWT  also solves systems:

    f1( x1,... ,xn )  = 0
       .....................

    fn( x
1, ... ,xn ) = 0



  NEWT takes the list of n functions in level 3
                       the list of n variables in level 2
                         and the initial guess in level 1

-First, it computes all the partial derivatives and then employs Newton's method to find a solution


           STACK           INPUTS         OUTPUTS
           Level 3
    { 'f1' ........... 'f1' }
   { 'fj' + partial deriv }
           Level 2      { 'x1' ......... 'x1' }     { 'x1' ......... 'x1' }
           Level 1     [ x1(2) , ...... , xn(2) ]           VSolution


Example:       Find a solution near ( 4 , 1 , 3 , 6 ) of the system:

       x + y + z + t - 16 = 0
          x y z - 3 t          = 0
       4 x2 - y z t - 40    = 0
          x y z t - 140     = 0

     { 'X+Y+Z+T-16'  'X*Y*Z-3*T'  '4*X^2-Y*Z*T-40'  'X*Y*Z*T-140' }   ENTER
                                           { X Y Z T }                                                          ENTER
                                           [ 4  1  3  6 ]                                                           NEWT

-After displaying the successive approximations, we get in level 1                    [ 4.26654047494  1.35363223606  3.54852677842  6.83130051063 ]
     
-So we have one solution:

    x = 4.26654047494
    y = 1.35363223610
    z = 3.54852677833
    t  = 6.83130051063

Notes:

-The list in level 3 now contains also all the partial derivatives.
-So, if you want to find another solution of the same system, don't modify level 3:
-Simply replace the vector in level 1 by another guess.

-The variable  'eps'  contains a very small number  ( 10-10 )  to determine the end of the loops.


25°)  Continued Fractions


  CFR   computes a function f(x) defined by a continued fraction:

                            a1       a2       a3                               an
      f(x) =  b0 +  -----   -----   -----   .....................   -----  .......................     where  an &  bn are functions of  x and n
                          b1 +    b2 +    b3 +                            bn +


-The modified Lenz's algorithm is employed:

    we set   f0 = b0  if  b0 # 0  or  f0 = tiny  if  b0 = 0    ( tiny = E-41 in CFR )
               C0 = f0 and D0 = 0

   then, for  n = 1 , 2 , .......      Cn = bn + an/Cn-1              (  Cn is replaced by tiny if Cn = 0 )
                                              Dn = 1/ [ bn + an Dn-1 ]      (  Dn = 1/tiny  if the denominator = 0 )

   and  fn = Cn Dn fn-1   until  | Cn Dn - 1 |  <=  a "small" number  (  E-11 in CFR )

>>>>    f(x) = the last  fn



           STACK           INPUTS         OUTPUTS
           Level3
               b0
               /
           Level 2           << F >>                /
           Level 1                x              f(x)

  Where          b0       is the 1st term of the continued fraction
    and        << F >>  is a program that takes x in level 2 & n in level 1 and returns  an  in level 2 & bn  in leve 1  without changing the other stack levels

Example:
     f is defined by:    b0 = 1  ;   an = 2.x + n  ,  bn =  x2 + n2  ( n > 0 )  ;    evaluate   f(Pi)

                                          1                                               ENTER
 << OVER  2  *  OVER  +  ROT  SQ  ROT  SQ  +  >>    ENTER
                                          PI                                               CFR       ->        f(Pi)  =  1.63626566028






References:

[1]   Abramowitz and Stegun - "Handbook of Mathematical Functions" -  Dover Publications -  ISBN  0-486-61272-4
[2]   http://functions.wolfram.com/
[3]   Press , Vetterling , Teukolsky , Flannery - "Numerical Recipes in C++" - Cambridge University Press - ISBN  0-521-75033-4
[4]   P. Borwein - "An Efficient Algorithm for the Riemann Zeta Function"
[5]  B.C. Carlson, "Numerical Computation of Real or Complex Elliptic Integrals"