Switch to side-by-side view

--- a/SpezFunkt2.mod.m2pp
+++ b/SpezFunkt2.mod.m2pp
@@ -47,6 +47,7 @@
   (* 19.12.18, MRi: Ersetzen von GammaIn durch Neuuebersetzng von AS239     *)
   (*                da die alte Routine (basierend auf AS32) fuer grosse X  *)
   (*                teilweise falsche Ergebnisse erzielt hatte.             *)
+  (* 19.12.18, MRi: Erstellen der ersten Version von AlNorm                 *)
   (*------------------------------------------------------------------------*)
   (* Testroutinen vorhanden, IBeta gegen unabhaengigen Fortran-Code ge-     *)
   (* testet, IGamma & JGamma nur gegen Pascal-Aequivalent                   *)
@@ -62,7 +63,7 @@
   (* Licence        : GNU Lesser General Public License (LGPL)              *)
   (*------------------------------------------------------------------------*)
 
-  (* $Id: SpezFunkt2.mod.m2pp,v 1.4 2018/02/17 09:17:19 mriedl Exp $ *)
+  (* $Id: SpezFunkt2.mod.m2pp,v 1.6 2019/02/01 22:24:03 mriedl Exp mriedl $ *)
 
 FROM Errors          IMPORT FatalError,ErrOut,Fehler,Fehlerflag;
                      IMPORT LowLong;
@@ -106,17 +107,19 @@
 
           CONST ltone = 7.0; utzero = 18.66; con = 1.28;
 
-                p   =   0.398942280444; q   =   0.39990348504;
-                r   =   0.398942280385;
-                a1  =   5.75885480458;  a2  =   2.62433121679;
-                a3  =   5.92885724438;
-                b1  = -29.8213557807;   b2  =  48.6959930692;
-                c1  =  -3.8052E-08;     c2  =   3.98064794E-04;
-                c3  =  -0.151679116635; c4  =   4.8385912808;
-                c5  =   0.742380924027; c6  =   3.99019417011;
-                d1  =   1.00000615302;  d2  =   1.98615381364;
-                d3  =   5.29330324926;  d4  = -15.1508972451;
-                d5  =  30.789933034;
+                p  =   0.398942280444; q  =   0.399903485040;
+                r  =   0.398942280385;
+                a1 =   5.758854804580; a2 =   2.624331216790;
+                a3 =   5.928857244380;
+                b1 = -29.821355780700; b2 =  48.695993069200;
+
+                c1 =  -3.80520000E-08; c2 =   3.98064794E-04;
+                c3 =  -0.151679116635; c4 =   4.838591280800;
+                c5 =   0.742380924027; c6 =   3.990194170110;
+
+                d1 =   1.000006153020; d2 =   1.986153813640;
+                d3 =   5.293303249260; d4 = -15.150897245100;
+                d5 =  30.789933034000;
 
           VAR   z,y,alnorm : LONGREAL;
                 up         : BOOLEAN;
@@ -151,12 +154,12 @@
                   VAR Ifault : INTEGER) : LONGREAL;
 
           (*----------------------------------------------------------------*)
-          (* Auxiliary functions required: ALOGAM := logarithm of the gamma *)
-          (* function, and AlNorm := algorithm AS66                         *)
+          (* This is a M2 verions of AS239. Auxiliary functions required    *)
+          (* are the logarithm of the gamma function and AlNorm (AS66).     *)
           (*----------------------------------------------------------------*)
 
           CONST  Tol    = 1.0E-14; 
-                 Xbig   = 1.0E+08; Oflow   = MAX(REAL); 
+                 Xbig   = 1.0E+08; Oflow   = LFLOAT(MAX(REAL)); 
                  Elimit =   -88.0; Plimit = 1000.0;
 
           VAR    pn1,pn2,pn3,pn4,pn5,pn6  : LONGREAL;
@@ -173,7 +176,7 @@
       END; (* IF *)
       (* Use a normal approximation if P > Plimit *)
       IF (P > Plimit) THEN
-        pn1 := 3.0*sqrt(P)*((X/P)**(1.0/3.0)+1.0/(9.0*P)-1.0);
+        pn1 := 3.0*sqrt(P)*(power((X/P),(1.0/3.0)) + 1.0/(9.0*P) - 1.0);
         RETURN AlNorm(pn1,FALSE);
       END; (* IF *)
       (* If X is extremely large compared to P then set gamma = 1 *)