hp41programs

Template

Cyclic Universes(2) for the HP-41


Overview
 

1°)  Cosmological Constant = 0
2°)  Density of Matter = 0 & Radiation Pressure < 0  ( 3 programs )

3°)  Radiation Pressure = 0 & Density of Matter < 0  ( 2 programs )
4°)  Density of Matter < 0 & Radiation Pressure # 0 ( or = 0 )
 ( 2 programs )


-These cyclic universes have no singularity.
-Cf "Cyclic Universes(1)" & "Age of the Universe" to compute the "age" and the period of the universes.

-The following programs take the redshift of a galaxy in X-register and calculate:

          D   =  light-travel time distance ( in Giga-light-years ) = light-travel time ( in Giga-years )
          D0 = comoving distance ( in Giga-light-years )
          DL = luminosity-distance ( in Giga-light-years )

-The minimum, current and maximum scale factors are to be stored in registers  R01-R02-R03 ( respectively )


Formulae:

    D  = (c/H0)  §y(em)1  y. [  (Omega)lambda.y4 + ( 1-(Omega)tot ).y2 + (Omega)mat.y + (Omega)rad  ] -1/2 dy           y(em) = y at the instant of emission
    D0 = (c/H0)  §y(em)1      [  (Omega)lambda.y4 + ( 1-(Omega)tot ).y2 + (Omega)mat.y + (Omega)rad  ] -1/2 dy          z + 1 = R0/R = 1/yem  

    where  (Omega)tot = (Omega)mat + (Omega)lambda + (Omega)rad  

                                                                  F(x) = Sinh(x)  if  k = -1     hyperbolic space
     DL = R0 ( z + 1 ) F(D0/R0)    where    F(x) =   x         if  k = 0      euclidean space
                                                                 F(x) = Sin(x)    if  k = +1    spherical space

  y = R/R0  so the integrals may also be computed with R instead of y


1°)  Cosmological Constant = 0
 

-These universes are spherical ( k = +1 )
-Density of matter is positive; radiation pressure is negative.


Data Registers:       R00-R04-R05-R06: temp                              ( Registers R01-R02-R03 are to be initialized before executing "Z-D" )

                               
 R01 = Rmin      
                               
 R02 = R0           
                                 R03 = Rmax      
Flags:  /
Subroutines:  /


 01 LBL "Z-D"
 02 RAD
 03 1
 04 +
 05 STO 00
 06 RCL 03
 07 RCL 02          
 08 ST* 00
 09 -
 10 STO 04
 11 LASTX
 12 RCL 01
 13 -
 14 ST* 04
 15 -
 16 RCL 01
 17 RCL 03
 18 -
 19 STO 06          
 20 /
 21 ASIN
 22 RCL 01
 23 RCL 02
 24 R^
 25 /
 26 -
 27 STO 05
 28 LASTX
 29 RCL 03
 30 -
 31 ST* 05
 32 -
 33 RCL 06          
 34 /
 35 ASIN
 36 -
 37 STO 06
 38 RCL 01
 39 RCL 03
 40 +
 41 *
 42 2
 43 /
 44 RCL 05
 45 SQRT
 46 +
 47 RCL 04          
 48 SQRT
 49 -
 50 RCL 06
 51 SIN
 52 RCL 00          
 53 *
 54 RCL 02
 55 RCL 06
 56 *
 57 R^
 58 DEG
 59 END

     
         ( 70 bytes / SIZE 007 )

 
           STACK           INPUTS        OUTPUTS
               Z
               /
            DL
               Y                /
            D0
               X                z
            D
   

Example:         Rmin = 2   R0 = 41   Rmax = 257  ( Gygalightyears )       z = 7    

    2    STO 01
   41   STO 02
  257  STO 03

    7   XEQ "Z-D"   >>>>     D = 11.60902216   Gly                         ---Execution time = 3s---
                              RDN     D0 = 23.85152165  Gly
                              RDN     DL = 180.2301790  Gly

Note:

-All theses distances are computed with elementary functions.


2°)  Density of Matter = 0 & Radiation Pressure < 0  ( 3 programs )


-These universes are hyperbolic ( k= -1 )
-The distance D is calculated by elementary functions.

-But D0 is computed with Gauss-Legendre 2-point formula


Data Registers:              R10 = z + 1                                 ( Registers R01-R02-R03 are to be initialized before executing "Z-D" )

                                      •  R01 = Rmin         R04 = D           R06 to R11: temp
                                      •  R02 = R0            R05 = D0
                                      •  R03 = Rmax
Flags: /
Subroutines: /

 
 01 LBL "Z-D"
 02 DEG
 03 STO 00
 04 SIGN
 05 +
 06 STO 10          
 07 RCL 02
 08 X<>Y
 09 /
 10 STO 06
 11 RCL 02
 12 X^2
 13 ST+ X
 14 RCL 01
 15 X^2
 16 STO 04
 17 RCL 03
 18 X^2
 19 ST- 04
 20 +
 21 STO 11
 22 -
 23 RCL 04
 24 /
 25 ACOS
 26 RCL 06
 27 X^2
 28 ST+ X
 29 RCL 11          
 30 -
 31 RCL 04
 32 /
 33 ACOS
 34 -
 35 D-R
 36 2
 37 /
 38 STO 04
 39 RCL 02
 40 RCL 01
 41 -
 42 SQRT
 43 RCL 06
 44 RCL 01
 45 -
 46 SQRT
 47 STO 07
 48 -
 49 RCL 00          
 50 ST+ 00
 51 /
 52 STO Y
 53 3
 54 SQRT
 55 /
 56 STO 08
 57 -
 58 STO 09
 59 2
 60 /
 61 ST- 07
 62 CLX
 63 STO 05
 64 LBL 01
 65 RCL 07
 66 RCL 08
 67 X<> 09
 68 STO 08
 69 +
 70 STO 07
 71 X^2
 72 RCL 01          
 73 STO Z
 74 +
 75 ENTER
 76 ST+ Z
 77 CHS
 78 RCL 03
 79 ST+ Z
 80 +
 81 *
 82 *
 83 SQRT
 84 1/X
 85 ST+ 05
 86 DSE 00
 87 GTO 01
 88 RCL 05
 89 RCL 08
 90 *
 91 3
 92 SQRT
 93 *
 94 RCL 11          
 95 SQRT
 96 ST* 04
 97 *
 98 STO 05
 99 E^X-1
100 LASTX
101 CHS
102 E^X-1
103 -
104 2
105 /
106 RCL 10
107 *
108 RCL 02
109 ST* 05
110 *
111 RCL 05
112 RCL 04
113 END

 
      ( 136 bytes / SIZE 012 )

 
             STACK            INPUTS          OUTPUTS
                 Z
                /
              DL
                 Y                 z               D0
                 X                N               D

  Where  N = number of subintervals for the Gauss-Legendre 2-point formula

Example:       ( Rmin , R0 , Rmax )  =  ( 0.7 , 14 , 314 )           expressed in Gigalightyears          z = 7

    0.7  STO 01
    14   STO 02
   314  STO 03

-If you choose N = 40

   7   ENTER^
  40  XEQ "Z-D"   >>>>     D = 12.38326745  Gly                         ---Execution time = 70s---
                             RDN     D0 = 29.70733009  Gly
                             RDN     DL = 460.7466896  Gly

Note:

-If z = zmax = R0/Rmin - 1 = 19 ,  D = 13.98718383  is the same value as the "age" of the universe ( the time since the last minimum scale factor )
-The distance D is computed with elementary functions.
-The precision for D0 ( and DL )  depends on the N-value

-But we can also use Carlson elliptic integral RF to compute D0


Data Registers:              R10 = z + 1                                 ( Registers R01-R02-R03 are to be initialized before executing "Z-D" )

                                      •  R01 = Rmin         R04 = D           R06 to R11: temp
                                      •  R02 = R0            R05 = D0
                                      •  R03 = Rmax
Flags: /
Subroutines:  ( M-Code routine )  RF   ( cf "Carlson Elliptic Integrals for the HP41" )

 
 01 LBL "Z-D"
 02 DEG
 03 1
 04 +
 05 STO 10          
 06 RCL 02
 07 X<>Y
 08 /
 09 STO 00
 10 RCL 02
 11 X^2
 12 STO 06
 13 ST+ X
 14 RCL 01
 15 X^2
 16 STO 04
 17 STO 07
 18 RCL 03
 19 X^2
 20 STO 08
 21 ST- 04
 22 +
 23 STO 11
 24 -
 25 RCL 04
 26 /
 27 ACOS
 28 RCL 00
 29 X^2
 30 STO 09          
 31 ST+ X
 32 RCL 11
 33 -
 34 RCL 04
 35 /
 36 ACOS
 37 -
 38 D-R
 39 2
 40 /
 41 STO 04
 42 RCL 06
 43 RCL 07
 44 -
 45 RCL 08
 46 RCL 09
 47 -
 48 *
 49 SQRT
 50 RCL 09
 51 RCL 07
 52 -
 53 RCL 08
 54 RCL 06
 55 -
 56 *
 57 SQRT
 58 +
 59 X^2
 60 STO 08          
 61 RCL 01
 62 RCL 02
 63 +
 64 STO 09
 65 RCL 03
 66 RCL 02
 67 -
 68 STO 06
 69 *
 70 RCL 00
 71 RCL 01
 72 -
 73 ST* 09
 74 *
 75 RCL 00
 76 RCL 03
 77 +
 78 ST* 06
 79 *
 80 SQRT
 81 RCL 00
 82 RCL 01
 83 +
 84 ST* 06
 85 RCL 03
 86 RCL 00          
 87 -
 88 ST* 09
 89 *
 90 RCL 02
 91 RCL 01
 92 -
 93 ST* 06
 94 *
 95 RCL 02
 96 RCL 03
 97 +
 98 ST* 09
 99 *
100 SQRT
101 +
102 X^2
103 RCL 09
104 SQRT
105 RCL 06
106 SQRT
107 +
108 X^2
109 RCL 02
110 RCL 00
111 -
112 X^2
113 ST/ 08
114 ST/ Z
115 /
116 RCL 08        
117 RF
118 ST+ X
119 RCL 11
120 SQRT
121 ST* 04
122 *
123 STO 05
124 E^X-1
125 LASTX
126 CHS
127 E^X-1
128 -
129 2
130 /
131 RCL 10
132 *
133 RCL 02
134 ST* 05
135 *
136 RCL 05
137 RCL 04
138 END

 
      ( 161 bytes / SIZE 012 )

 
             STACK            INPUTS          OUTPUTS
                 Z
                /
              DL
                 Y                 /               D0
                 X                 z               D


Example:       ( Rmin , R0 , Rmax )  =  ( 0.7 , 14 , 314 )           expressed in Gigalightyears    ,      z = 7

    0.7  STO 01
    14   STO 02
   314  STO 03

   7   XEQ "Z-D"   >>>>     D = 12.38326745  Gly                         ---Execution time = 11s---
                             RDN     D0 = 29.70733010  Gly
                             RDN     DL = 460.7466900  Gly


Note:

-If we only want to compute D, the program becomes much smaller:

Data Registers:       R00-R04: temp                                    ( Registers R01-R02-R03 are to be initialized before executing "Z-D" )

                               
 R01 = Rmin         
                               
 R02 = R0                     
                                 R03 = Rmax        
Flags:  /
Subroutines:  /

 01 LBL "Z-D"
 02 DEG
 03 1
 04 +
 05 RCL 02          
 06 X^2
 07 ST+ X
 08 RCL 01
 09 X^2
 10 STO 04          
 11 RCL 03
 12 X^2
 13 ST- 04
 14 +
 15 STO 00          
 16 -
 17 RCL 04
 18 /
 19 ACOS
 20 RCL 02
 21 R^
 22 /
 23 X^2
 24 ST+ X
 25 RCL 00          
 26 -
 27 RCL 04
 28 /
 29 ACOS
 30 -
 31 D-R
 32 RCL 00          
 33 SQRT
 34 *
 35 2
 36 /
 37 END

     
         ( 48 bytes / SIZE 005 )

 
           STACK           INPUTS        OUTPUTS
               Y                /
           z+1
               X                z
            D
   

Example:       ( Rmin , R0 , Rmax )  =  ( 0.7 , 14 , 314 )           expressed in Gigalightyears          z = 7

    0.7  STO 01
    14   STO 02
   314  STO 03

   7   XEQ "Z-D"   >>>>     D = 12.38326745  Gly                         ---Execution time = 2.5s---


3°)  Radiation Pressure = 0 & Density of Matter < 0  ( 2 programs )


-These universes are hyperbolic ( k= -1 )
-This routine computes D & D0 with Gauss-Legendre 2-point formula


Data Registers:              R11 = z + 1                                 ( Registers R01-R02-R03 are to be initialized before executing "Z-D" )

                                      •  R01 = Rmin         R09 = D           R06 to R11: temp
                                      •  R02 = R0            R10 = D0
                                      •  R03 = Rmax
Flags: /
Subroutines: /

 
 01 LBL "Z-D"
 02 STO 00
 03 CLX
 04 RCL 02          
 05 RCL 01
 06 STO 06
 07 -
 08 RCL 03
 09 ST+ 06
 10 LASTX
 11 -
 12 STO 05
 13 /
 14 SQRT
 15 RAD
 16 ASIN
 17 RCL 02
 18 R^
 19 1
 20 +
 21 STO 11
 22 /
 23 RCL 01          
 24 -
 25 RCL 05
 26 /
 27 SQRT
 28 ASIN
 29 STO 07
 30 -
 31 RCL 00
 32 ST+ 00
 33 /
 34 STO Y
 35 3
 36 SQRT
 37 /
 38 STO 08
 39 -
 40 STO 04
 41 2
 42 /
 43 ST- 07
 44 CLX
 45 STO 09          
 46 STO 10
 47 LBL 01
 48 RCL 07
 49 RCL 08
 50 X<> 04
 51 STO 08
 52 +
 53 STO 07
 54 SIN
 55 X^2
 56 RCL 05
 57 *
 58 RCL 01
 59 +
 60 ENTER
 61 STO Z
 62 RCL 06
 63 +
 64 /
 65 SQRT
 66 ST+ 09
 67 X<>Y
 68 /
 69 ST+ 10
 70 DSE 00
 71 GTO 01
 72 DEG
 73 RCL 08          
 74 RCL 03
 75 RCL 06
 76 *
 77 RCL 01
 78 X^2
 79 +
 80 3
 81 *
 82 SQRT
 83 *
 84 ST* 09
 85 ST* 10
 86 RCL 10          
 87 E^X-1
 88 LASTX
 89 CHS
 90 E^X-1
 91 -
 92 2
 93 /
 94 RCL 11
 95 *
 96 RCL 02
 97 ST* 10
 98 *
 99 RCL 10
100 RCL 09
101 END

 
      ( 122 bytes / SIZE 012 )

 
             STACK            INPUTS          OUTPUTS
                 Z
                /
              DL
                 Y                 z               D0
                 X                N               D

  Where  N = number of subintervals for the Gauss-Legendre 2-point formula

Example:       ( Rmin , R0 , Rmax )  =  ( 1 , 14 , 314 )           expressed in Gigalightyears          z = 7

     1  STO 01
    14   STO 02
   314  STO 03

-If you choose N = 40

   7   ENTER^
  40  XEQ "Z-D"   >>>>     D = 13.56149795  Gly                         ---Execution time = 100s---
                             RDN     D0 = 33.91425306  Gly
                             RDN     DL = 626.3433865  Gly

Note:

-Carlson elliptic integrals RF & RJ will calculate the results faster:



Data Registers:              R00 = z + 1                                 ( Registers R01-R02-R03 are to be initialized before executing "Z-D" )

                                      •  R01 = Rmin         R04 = D           R06 to R12: temp
                                      •  R02 = R0            R05 = D0
                                      •  R03 = Rmax
Flags: /
Subroutines:  ( M-Code routines )  RF & RJ   ( cf "Carlson Elliptic Integrals for the HP41" )

 
 01 LBL "Z-D"
 02 DEG
 03 1
 04 +
 05 STO 00
 06 RCL 02
 07 X<>Y
 08 /
 09 ENTER
 10 STO 04          
 11 RCL 01
 12 -
 13 STO 12
 14 *
 15 RCL 03
 16 RCL 02
 17 -
 18 STO 11
 19 *
 20 RCL 01
 21 RCL 03
 22 +
 23 STO 06
 24 STO 10
 25 RCL 02
 26 +
 27 STO 08
 28 *
 29 SQRT
 30 RCL 02
 31 RCL 02
 32 RCL 01
 33 -
 34 STO 05
 35 *
 36 RCL 03          
 37 RCL 04
 38 ST+ 06
 39 -
 40 ST* 08
 41 *
 42 RCL 06
 43 ST* 11
 44 *
 45 SQRT
 46 +
 47 RCL 02
 48 RCL 04
 49 -
 50 STO 07
 51 /
 52 X^2
 53 STO 09
 54 RCL 04
 55 RCL 11
 56 *
 57 RCL 05
 58 *
 59 SQRT
 60 RCL 02
 61 RCL 08
 62 *
 63 RCL 12          
 64 ST* 11
 65 *
 66 SQRT
 67 +
 68 RCL 07
 69 /
 70 X^2
 71 X<> 08
 72 RCL 04
 73 *
 74 RCL 05
 75 *
 76 SQRT
 77 RCL 02
 78 ST* 04
 79 RCL 11
 80 *
 81 SQRT
 82 +
 83 RCL 07
 84 /
 85 X^2
 86 STO 07
 87 RCL 01
 88 RCL 10
 89 *
 90 -
 91 STO 05
 92 RCL 07          
 93 RCL 08
 94 RCL 09
 95 RJ
 96 RCL 01
 97 RCL 03
 98 *
 99 RCL 10
100 *
101 *
102 3
103 /
104 X<> 05
105 RCL 04
106 STO Z
107 -
108 /
109 SQRT
110 ATAN
111 D-R
112 RCL 05
113 -
114 STO 04
115 RCL 07
116 RCL 08
117 RCL 09
118 RF
119 STO 05
120 RCL 03        
121 RCL 10
122 *
123 RCL 01
124 X^2
125 +
126 SQRT
127 ST+ X
128 ST* 04
129 ST* 05
130 RCL 05
131 E^X-1
132 LASTX
133 CHS
134 E^X-1
135 -
136 2
137 /
138 RCL 00
139 *
140 RCL 02
141 ST* 05
142 *
143 RCL 05
144 RCL 04
145 END

 
      ( 167 bytes / SIZE 013 )

 
             STACK            INPUTS          OUTPUTS
                 Z
                /
              DL
                 Y                 /               D0
                 X                 z               D


Example:       ( Rmin , R0 , Rmax )  =  ( 1 , 14 , 314 )           expressed in Gigalightyears    ,      z = 7

     1  STO 01
    14   STO 02
   314  STO 03

   7   XEQ "Z-D"   >>>>     D = 13.56149794  Gly                         ---Execution time = 21s---
                             RDN     D0 = 33.91425300  Gly
                             RDN     DL = 626.3433837  Gly


Note:

-If the data registers are shifted, the M-Code routines RF & RJ may be replaced by focal programs "RF" & "RJ"


4°)  Density of Matter < 0 & Radiation Pressure # 0 ( or = 0 )  ( 2 programs )


-These universes are hyperbolic ( k= -1 )
-This routine computes D & D0 with Gauss-Legendre 2-point formula and the change of variable  R = Rmin + x2

-The 3rd root R3 of the quartic equation must be  <  Rmin  and such that the 4th root is also  <  Rmin    ( Rmin + Rmax + R3 + R4 = 0 )


Data Registers:              R11 = z + 1                                 ( Registers R01-R02-R03-R04 are to be initialized before executing "Z-D" )

                                      •  R01 = Rmin        •  R04 = R3      R09 = D           R06 to R11: temp
                                      •  R02 = R0              R05 = -R4     R10 = D0
                                      •  R03 = Rmax
Flags: /
Subroutines: /

 
 01 LBL "Z-D"
 02 STO 00
 03 SIGN
 04 +
 05 STO 11
 06 RCL 02          
 07 RCL 01
 08 STO 05
 09 -
 10 SQRT
 11 RCL 02
 12 RCL 11
 13 /
 14 RCL 01
 15 -
 16 SQRT
 17 STO 07
 18 -
 19 RCL 00
 20 ST+ 00
 21 /
 22 STO Y
 23 3
 24 SQRT
 25 /
 26 STO 08          
 27 -
 28 STO 06
 29 2
 30 /
 31 ST- 07
 32 RCL 03
 33 RCL 04
 34 +
 35 ST+ 05
 36 CLX
 37 STO 09
 38 STO 10
 39 LBL 01
 40 RCL 07
 41 RCL 08
 42 X<> 06
 43 STO 08
 44 +
 45 STO 07
 46 X^2
 47 RCL 01          
 48 +
 49 ENTER
 50 ENTER
 51 CHS
 52 RCL 03
 53 +
 54 X<>Y
 55 RCL 04
 56 -
 57 *
 58 X<>Y
 59 RCL 05
 60 +
 61 *
 62 SQRT
 63 1/X
 64 ST+ 10
 65 *
 66 ST+ 09
 67 DSE 00
 68 GTO 01
 69 RCL 03          
 70 RCL 01
 71 ST+ Y
 72 *
 73 RCL 04
 74 RCL 05
 75 *
 76 +
 77 RCL 03
 78 X^2
 79 +
 80 3
 81 *
 82 SQRT
 83 RCL 08
 84 *
 85 ST* 09
 86 ST* 10
 87 RCL 10          
 88 E^X-1
 89 LASTX
 90 CHS
 91 E^X-1
 92 -
 93 RCL 11
 94 *
 95 2
 96 /
 97 RCL 02
 98 ST* 10
 99 *
100 RCL 10
101 RCL 09
102 END


      ( 123 bytes / SIZE 012 )

 
             STACK            INPUTS          OUTPUTS
                 Z
                /
              DL
                 Y                 z               D0
                 X                N               D

  Where  N = number of subintervals for the Gauss-Legendre 2-point formula

Example:       ( Rmin , R0 , Rmax , R3 )  =  ( 0.9 , 14 , 314 , 0.1 )           expressed in Gigalightyears          z = 7

    0.9  STO 01
    14   STO 02
   314  STO 03
    0.1  STO 04

-If you choose N = 40

   7   ENTER^
  40  XEQ "Z-D"   >>>>     D = 13.51825820  Gly                         ---Execution time = 80s---
                             RDN     D0 = 33.69201340  Gly
                             RDN     DL = 616.3214333  Gly


Note:

-The exact results of this example are:

   13.5182581301...
   33.6920135076...              ( with free42 )
  616.328437817...


-With Carlson elliptic integrals, we have:


Data Registers:              R11 = z + 1                                 ( Registers R01-R02-R03-R04 are to be initialized before executing "Z-D" )

                                      •  R01 = Rmin        •  R04 = R3      R09 = D0           R06 to R13: temp
                                      •  R02 = R0              R05 = -R4     R10 = D
                                      •  R03 = Rmax
Flags: /
Subroutines:   ( M-Code routines )  RF & RJ   ( cf "Carlson Elliptic Integrals for the HP41" )

 
 01 LBL "Z-D"
 02 DEG
 03 1
 04 +
 05 STO 00          
 06 RCL 02
 07 RCL 01
 08 -
 09 STO 07
 10 STO 08
 11 LASTX
 12 RCL 03
 13 +
 14 RCL 04
 15 +
 16 STO 05
 17 RCL 02
 18 +
 19 STO 09
 20 *
 21 RCL 03
 22 RCL 02
 23 RCL 00
 24 /
 25 STO 11
 26 -
 27 STO 10
 28 *
 29 RCL 11
 30 RCL 04
 31 -
 32 STO 12
 33 *
 34 SQRT
 35 RCL 11          
 36 RCL 01
 37 -
 38 STO 13
 39 RCL 05
 40 RCL 11
 41 +
 42 ST* 07
 43 *
 44 RCL 03
 45 RCL 02
 46 -
 47 ST* 12
 48 *
 49 RCL 02
 50 ST- 11
 51 RCL 04
 52 -
 53 ST* 10
 54 *
 55 SQRT
 56 +
 57 X^2
 58 STO 06
 59 RCL 07
 60 RCL 10
 61 *
 62 SQRT
 63 RCL 09
 64 RCL 13
 65 ST* 08
 66 *
 67 ST* 10
 68 RCL 12          
 69 ST* 07
 70 *
 71 SQRT
 72 +
 73 X^2
 74 X<> 10
 75 SQRT
 76 RCL 07
 77 SQRT
 78 +
 79 X^2
 80 RCL 11
 81 X^2
 82 ST/ 06
 83 ST/ 10
 84 /
 85 STO 09
 86 RCL 01
 87 RCL 04
 88 -
 89 RCL 01
 90 RCL 05
 91 +
 92 *
 93 +
 94 STO 07
 95 RCL 06
 96 RCL 10
 97 RCL 09
 98 RJ
 99 RCL 01          
100 RCL 03
101 -
102 *
103 RCL 04
104 RCL 01
105 -
106 *
107 RCL 01
108 RCL 05
109 +
110 *
111 3
112 /
113 RCL 08
114 RCL 07
115 RCL 08
116 -
117 /
118 SQRT
119 ATAN
120 D-R
121 +
122 X<> 10
123 RCL 06
124 RCL 09
125 RF
126 STO 09
127 RCL 01
128 *
129 ST+ 10
130 RCL 03
131 RCL 01          
132 ST+ Y
133 *
134 RCL 04
135 RCL 05
136 *
137 +
138 RCL 03
139 X^2
140 +
141 SQRT
142 ST+ X
143 ST* 09
144 ST* 10
145 RCL 09
146 E^X-1
147 LASTX
148 CHS
149 E^X-1
150 -
151 RCL 00
152 *
153 2
154 /
155 RCL 02
156 ST* 09
157 *
158 RCL 09
159 RCL 10
160 END

 
      ( 187 bytes / SIZE 014 )

 
             STACK            INPUTS          OUTPUTS
                 Z
                /
              DL
                 Y                 /               D0
                 X                 z               D


Example:       ( Rmin , R0 , Rmax , R3 )  =  ( 0.9 , 14 , 314 , 0.1 )           expressed in Gigalightyears          z = 7

    0.9  STO 01
    14   STO 02
   314  STO 03
    0.1  STO 04

    7  XEQ "Z-D"   >>>>     D = 13.51825813  Gly                         ---Execution time = 22s---
                             RDN     D0 = 33.69201350  Gly
                             RDN     DL = 616.3214378  Gly


Reference:

[1]   B. C. Carlson - "A Table of Elliptic Integrals of the Third Kind"