  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   1
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is ".standard.".

       C    1    1  {
       C    1    2   ******************************************************************************
       C    1    3   *                                                                            *
       C    1    4   *                                                                            *
       C    1    5   *                                                                            *
       C    1    6   *                        MMM    MMM   XXX      XXX  DDDDDDDD                 *
       C    1    7   *                        MMMM  MMMM    XXX    XXX   DDDDDDDDDD               *
       C    1    8   *                        MM MMMM MM     XXX  XXX    DD      DDD              *
       C    1    9   *                        MM  MM  MM      XXXXXX     DD       DD              *
       C    1   10   *                        MM      MM       XXXX      DD       DD              *
       C    1   11   *          T  H  E       MM      MM       XXXX      DD       DD              *
       C    1   12   *                        MM      MM      XXXXXX     DD       DD              *
       C    1   13   *                        MM      MM     XXX  XXX    DD      DDD              *
       C    1   14   *                        MM      MM    XXX    XXX   DDDDDDDDDD               *
       C    1   15   *                       MMMM    MMMM  XXX      XXX  DDDDDDDD                 *
       C    1   16   *                                                                            *
       C    1   17   *                                                                            *
       C    1   18   *                                                                            *
       C    1   19   *                 SSSSS Y     Y  SSSSS TTTTTTT EEEEEE M     M                *
       C    1   20   *                S       Y   Y  S         T    E      MM   MM                *
       C    1   21   *                S        Y Y   S         T    E      M M M M                *
       C    1   22   *                 SSSS     Y     SSSS     T    EEEEE  M  M  M                *
       C    1   23   *                     S    Y         S    T    E      M     M                *
       C    1   24   *                     S    Y         S    T    E      M     M  ..            *
       C    1   25   *                SSSSS     Y    SSSSS     T    EEEEEE M     M  ..            *
       C    1   26   *                                                                            *
       C    1   27   *                                                                            *
       C    1   28   *                                                                            *
       C    1   29   *              ---  Version  3.999 000 alpha -- 31/03/2010 ---               *
       C    1   30   *                                                                            *
       C    1   31   *                by :                                                        *
       C    1   32   *                                                                            *
       C    1   33   *                     P. Wolfers                                             *
       C    1   34   *                         c.n.r.s.                                           *
       C    1   35   *                         Institut Neel (MCMF), Bat F,                       *
       C    1   36   *                         B.P.  166 X   38042  Grenoble Cedex                *
       C    1   37   *                                                FRANCE.                     *
       C    1   38   *                                                                            *
       C    1   39   *                                                                            *
       C    1   40   ******************************************************************************
       C    1   41  
       C    1   42  
       C    1   43  ///////////////////////////////////////////////////////////////////////////////
       C    1   44  //                                                                           //
       C    1   45  //                                                                           //
       C    1   46  //                     Global Public Licence (GPL)                           //
       C    1   47  //                                                                           //
       C    1   48  //                                                                           //
       C    1   49  //    This license described in this file overrides all other licenses       //
       C    1   50  //    that might be specified in other files for this software.              //
       C    1   51  //                                                                           //
       C    1   52  //    This program is free software; you can redistribute it and/or          //
       C    1   53  //    modify it under the terms of the GNU Lesser General Public             //
       C    1   54  //    License as published by the Free Software Foundation; either           //
       C    1   55  //    version 2.1 of the License, or (at your option) any later version.     //
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   2
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is ".standard.".

       C    1   56  //                                                                           //
       C    1   57  //    This software is distributed in the hope that it will be useful,       //
       C    1   58  //    but WITHOUT ANY WARRANTY; without even the implied warranty of         //
       C    1   59  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
       C    1   60  //    Library General Public License for more details.                       //
       C    1   61  //                                                                           //
       C    1   62  //    You should have received a copy of the GNU Lesser General Public       //
       C    1   63  //    License along with this library (see COPYING.LIB); if not, write to    //
       C    1   64  //    the Free Software Foundation :                                         //
       C    1   65  //                         Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     //
       C    1   66  //                                                                           //
       C    1   67  ///////////////////////////////////////////////////////////////////////////////
       C    1   68  
       C    1   69  
       C    1   70  *******************************************************************************
       C    1   71  *                                                                             *
       C    1   72  *                                                                             *
       C    1   73  *                 MXD    Mathematical    function    Module                   *
       C    1   74  *                                                                             *
       C    1   75  *                                                                             *
       C    1   76  *******************************************************************************
       C    1   77  
       C    1   78  }
       C    1   79  
       C    1   80  {************     CPAS  version    *************}
       C    1   81  
       C    1   82  {
       C    1   83          *** Modification(s) from major version ***
       C    1   84  
       C    1   85  
       C    1   86                    ----
       C    1   87  
       C    1   88                   NOTHING
       C    1   89  
       C    1   90                    ----
       C    1   91  
       C    1   92  }
       C    1   93  
       C    1   94  
            1   95  module MXD_MATH;
            1   96  
            1   97  
       C    2    1  {
       C    2    2   ******************************************************************************
       C    2    3   *                                                                            *
       C    2    4   *                                                                            *
       C    2    5   *                                                                            *
       C    2    6   *                        MMM    MMM   XXX      XXX  DDDDDDDD                 *
       C    2    7   *                        MMMM  MMMM    XXX    XXX   DDDDDDDDDD               *
       C    2    8   *                        MM MMMM MM     XXX  XXX    DD      DDD              *
       C    2    9   *                        MM  MM  MM      XXXXXX     DD       DD              *
       C    2   10   *                        MM      MM       XXXX      DD       DD              *
       C    2   11   *          T  H  E       MM      MM       XXXX      DD       DD              *
       C    2   12   *                        MM      MM      XXXXXX     DD       DD              *
       C    2   13   *                        MM      MM     XXX  XXX    DD      DDD              *
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   3
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_env.pas".

       C    2   14   *                        MM      MM    XXX    XXX   DDDDDDDDDD               *
       C    2   15   *                       MMMM    MMMM  XXX      XXX  DDDDDDDD                 *
       C    2   16   *                                                                            *
       C    2   17   *                                                                            *
       C    2   18   *                                                                            *
       C    2   19   *                 SSSSS Y     Y  SSSSS TTTTTTT EEEEEE M     M                *
       C    2   20   *                S       Y   Y  S         T    E      MM   MM                *
       C    2   21   *                S        Y Y   S         T    E      M M M M                *
       C    2   22   *                 SSSS     Y     SSSS     T    EEEEE  M  M  M                *
       C    2   23   *                     S    Y         S    T    E      M     M                *
       C    2   24   *                     S    Y         S    T    E      M     M  ..            *
       C    2   25   *                SSSSS     Y    SSSSS     T    EEEEEE M     M  ..            *
       C    2   26   *                                                                            *
       C    2   27   *                                                                            *
       C    2   28   *                                                                            *
       C    2   29   *              ---  Version  3.999 000 alpha -- 31/03/2010 ---               *
       C    2   30   *                                                                            *
       C    2   31   *                by :                                                        *
       C    2   32   *                                                                            *
       C    2   33   *                     P. Wolfers                                             *
       C    2   34   *                         c.n.r.s.                                           *
       C    2   35   *                         Institut Neel (MCMF), Bat F,                       *
       C    2   36   *                         B.P.  166 X   38042  Grenoble Cedex                *
       C    2   37   *                                                FRANCE.                     *
       C    2   38   *                                                                            *
       C    2   39   *                                                                            *
       C    2   40   ******************************************************************************
       C    2   41  
       C    2   42  
       C    2   43  ///////////////////////////////////////////////////////////////////////////////
       C    2   44  //                                                                           //
       C    2   45  //                                                                           //
       C    2   46  //                     Global Public Licence (GPL)                           //
       C    2   47  //                                                                           //
       C    2   48  //                                                                           //
       C    2   49  //    This license described in this file overrides all other licenses       //
       C    2   50  //    that might be specified in other files for this software.              //
       C    2   51  //                                                                           //
       C    2   52  //    This program is free software; you can redistribute it and/or          //
       C    2   53  //    modify it under the terms of the GNU Lesser General Public             //
       C    2   54  //    License as published by the Free Software Foundation; either           //
       C    2   55  //    version 2.1 of the License, or (at your option) any later version.     //
       C    2   56  //                                                                           //
       C    2   57  //    This software is distributed in the hope that it will be useful,       //
       C    2   58  //    but WITHOUT ANY WARRANTY; without even the implied warranty of         //
       C    2   59  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      //
       C    2   60  //    Library General Public License for more details.                       //
       C    2   61  //                                                                           //
       C    2   62  //    You should have received a copy of the GNU Lesser General Public       //
       C    2   63  //    License along with this library (see COPYING.LIB); if not, write to    //
       C    2   64  //    the Free Software Foundation :                                         //
       C    2   65  //                         Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     //
       C    2   66  //                                                                           //
       C    2   67  ///////////////////////////////////////////////////////////////////////////////
       C    2   68  
       C    2   69  
       C    2   70  *******************************************************************************
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   4
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_env.pas".

       C    2   71  *                                                                             *
       C    2   72  *                                                                             *
       C    2   73  *                     Global     Environment     File                         *
       C    2   74  *                                                                             *
       C    2   75  *                                                                             *
       C    2   76  *******************************************************************************
       C    2   77  
       C    2   78  }
       C    2   79  
       C    2   80  {************     CPAS  version    *************}
       C    2   81  
       C    2   82  {
       C    2   83          *** Modification(s) from major version ***
       C    2   84  
       C    2   85  
       C    2   86                    ----
       C    2   87  
       C    2   88                   NOTHING
       C    2   89  
       C    2   90                    ----
       C    2   91  
       C    2   92  }
       C    2   93  
       C    2   94  
            2   95  const
            2   96  
            2   97    mxd_heading      =   'P.Wolfers Software: MXD V4.0-000 of 31-MAR-2010';       { Version Title specification fo
                    r page heading }
            2   98  
            2   99    mxd_search_path  =            './,HOME:/.mxd/,MXDLIB:,/usr/local/etc/';       { Search path for MXD }
            2  100  
            2  101    mpcspcfile       =           'mxd_pcd.tmp.1';         { MXD Pcode Default Statement File Name }
            2  102  
            2  103    pi               =         4.0*ARCTAN( 1.0 );         { Pi Number }
            2  104    inrd             =                  pi/180.0;         { To convert Decimal degrees to radian }
            2  105  
            2  106    max_hdt          =                        15;         { Maximum number of dependant value in binary data file 
                    }
            2  107  
            2  108    str_maxsize      =                       255;         { Used size of a command string }
            2  109    ide_maxsize      =                        62;         { Used size of a identifier name }
            2  110  
            2  111    unsmax           =               2.0**32-1.0;         { 32 bits unsigned maximum value }
            2  112    intmin           =                  -2.0**31;         { 32 bits integer minimum value }
            2  113    intmax           =               2.0**31-1.0;         { 32 bits integer maximum value }
            2  114    max_dblpow       =                       307;         { Maximum for exponent for double precision }
            2  115    max_fltpow       =                        38;         { Maximum for exponent for single precision }
            2  116    max_single       =                         7;         { Maximum of figure for a single prec. number }
            2  117  
            2  118    max_arg_dir      =                         3;         { Maximum number of directive argument in Pcode }
            2  119  
            2  120  type
       C    2  121  { str_ptr          =                   ^string;         { Define the pointer of string - Type already defined in
                     cpas_b__src_env }
       C    2  122  
            2  123    mxd_flt          =                    double;         { Define the used type of real (Double Precision) }
            2  124  
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   5
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_env.pas".

 The Current Compiled Module is "mxd_math".

            2  125    sbyte            =             short_integer;         { 8 bits signed integer }
            2  126  
            2  127    str_string       =     string( str_maxsize );         { Specific string type to store character string }
            2  128    ide_string       =     string( ide_maxsize );         { Specific string type to store identifier name }
            2  129  
            2  130  
            2  131    node_code = (                                         { * Define the MXD node codes * }
            2  132      nd_jobname,    nd_title,  nd_savfnam,               {  0 - Assign Jobname, job title, save status file speci
                    fication }
            2  133       nd_string,     nd_null,                            {  3 - To push a string, a null refernce in the stack }
            2  134        nd_konst,    nd_refer,   nd_paname,               {  5 - Enter a constant, a variable or parameter (by nd_
                    refer), set a name to id. }
            2  135        nd_coeff,   nd_tabref,                            {  8 - LSQ coefficient reference, LSQ Table reference }
            2  136       nd_defvar,   nd_assvar,   nd_defpar,               { 10 - Define a LSQ variable, assign a value to a variab
                    le, define a parameter }
            2  137         nd_item,   nd_itmref,  nd_itmfldr,               { 13 - Node for item definition and item field reference
                     }
            2  138       nd_permut,             nd_directive,               { 16 - Stack Permutation}
            2  139  
       C    2  140      { Operator and scalar constante node definitions }
            2  141          nd_not,      nd_neg,      nd_pow,      nd_ipw,  { 18 - "not", unary "-", **<int>, **<flt> }
            2  142          nd_mul,      nd_div,                            { 22 - "*", "/" }
            2  143          nd_idiv,     nd_mod,      nd_rem,               { 24 - "idiv", "mod", "rem" }
            2  144          nd_add,      nd_sub,                            { 27 - "+", binary "-" }
            2  145           nd_eq,       nd_ne,       nd_lt,               { 29 - "=", "<>", "<" }
            2  146           nd_le,       nd_ge,       nd_gt,               { 32 - "<=", ">=", ">" }
            2  147          nd_and,      nd_xor,       nd_or,               { 36 - "and", "xor", "or" }
            2  148  
            2  149          nd_abs,     nd_sqrt,                            { 38 }
            2  150         nd_sinr,     nd_cosr,     nd_tanr,               { 40 }
            2  151        nd_asinr,    nd_acosr,    nd_atanr,   nd_phaser,  { 43 }
            2  152         nd_sind,     nd_cosd,     nd_tand,               { 47 }
            2  153        nd_asind,    nd_acosd,    nd_atand,   nd_phased,  { 50 }
            2  154          nd_exp,       nd_ln,     nd_tanh,    nd_bessj,  { 54 }
            2  155       nd_bessjh, nd_interpol,   nd_integr,               { 58 }
            2  156        nd_trunc,    nd_round,                            { 61 }
            2  157  
            2  158          nd_nop,                                         { 63 }
            2  159  
            2  160         nd_call,   nd_return,                            { 64 - Call and return of a function }
            2  161  
       C    2  162  (*
       C    2  163      { Reference node definitions }
       C    2  164    { nd_ctarray }
       C    2  165      nd_contrrf,     nd_indxrf,      nd_functrf,     nd_formalrf,
       C    2  166      nd_arrayrf,
       C    2  167  
       C    2  168      nd_summ,        nd_select,      nd_intsel,      nd_sumhkl,
       C    2  169      nd_integr,
       C    2  170  
       C    2  171      { Special operators }
       C    2  172      nd_formalcall,  nd_functcall,   nd_connect,
       C    2  173  
       C    2  174      { All other p code statements are below }
       C    2  175      nd_cellsy,      nd_catomsy,     nd_atomsy,      nd_momentsy,    { 64..67 }
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   6
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_env.pas".

 The Current Compiled Module is "mxd_math".

       C    2  176      nd_mdsdspsy,    nd_wavevsy,     nd_npoladirsy,  nd_symtrysy,    { 68..71 }
       C    2  177      nd_optionssy,   nd_soptionsy,   nd_nullsy,                      { 72..74 }
       C    2  178      nd_varbldf,     nd_parmdf,                                      { 75..76 }
       C    2  179      nd_datasy,      nd_78,          nd_lsqblocksy,  nd_centeronsy,  { 77..80 }
       C    2  180      nd_assignvarsy, nd_bisomd,      nd_fixedsy,     nd_unfixedsy,   { 81..84 }
       C    2  181      nd_latticesy,   nd_limitssy,    nd_magneticsy,                  { 85..87 }
       C    2  182      nd_uctrdefsy,   nd_formaldf,    nd_usfunctdf,   nd_indxdf,      { 88..91 }
       C    2  183      nd_92,          nd_arraydf,     nd_94,          nd_95,          { 92..95 }
       C    2  184      nd_96,          nd_97,          nd_98,          nd_99,          { 96..99 }
       C    2  185  
       C    2  186  (*
       C    2  187      { Pseudo instructions follow }
       C    2  188       includesy,   chainsy,    eofsym,  pragmasy,
       C    2  189         rcellsy,ffassignsy, clrdatasy,macrolibsy,
       C    2  190         mcallsy,genspacesy,  repeatsy,      ifsy,
       C    2  191         macrosy,   beginsy,    thensy,   untilsy,
       C    2  192         endifsy,  endmacsy,     endsy,    elsesy,
       C    2  193         purgesy, illegalsy,   errorsy,  wrtmsgsy,
       C    2  194       displaysy,   replysy,    opensy,   closesy,
       C    2  195         writesy, writelnsy,    readsy,
       C    2  196  
       C    2  197      { Run control statements }
       C    2  198      nd_runapplsy,   nd_listingsy,   nd_spawnsy,
       C    2  199  
       C    2  200      { Constant operators }
       C    2  201      nd_assignop,    nd_andop,       nd_iorop,     nd_notop,
       C    2  202      nd_concop,      nd_interpop,    nd_substrop,  nd_lengthop,
       C    2  203      nd_indexop,     nd_nindexop,    nd_stringop,  nd_numberop,
       C    2  204      nd_definedop,   nd_paramrefop,  nd_getenvop,
       C    2  205  
       C    2  206      { Separator definitions }
       C    2  207         colonsy,   commasy,    lparsy,    rparsy,     brasy,     ketsy,
       C    2  208         smcolsy,
       C    2  209  
       C    2  210      { Parameter definitions }
       C    2  211            parh,      park,      parl,     parrh,     parrk,     parrl,
       C    2  212         parstsl,
       C    2  213           parhx,     parhy,     parhz,     parqx,     parqy,     parqz,
       C    2  214           parhh,     parkk,     parll,
       C    2  215          parobs,    parsig,   parweig,   parcalc,
       C    2  216          parfn2,    parfm2,  paripola,   parpola,
       C    2  217           parsh,     parsk,     parsl,
       C    2  218        parlchi2,  parcchi2,  parlmaxf,  parcmaxf,
       C    2  219          parfnr,    parfni,
       C    2  220          parfxr,    parfyr,    parfzr,    parfxi,    parfyi,    parfzi,
       C    2  221  *)
       C    2  222      { Last definitions }
            2  223      nd_end
            2  224    );
            2  225  
            2  226  
            2  227    val_afl( val_all: integer ) = record          { * Define an array of float * }
            2  228      val_ftb: array[1..val_all] of mxd_flt;
            2  229    end;
            2  230  
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   7
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_env.pas".

 The Current Compiled Module is "mxd_math".

            2  231  
            2  232  
            2  233  
            2  234  
            2  235  
            2  236  
            2  237    lsqp_index = (                        { * define the Least-Square Parameter index type and values }
            2  238      lsqp_h, lsqp_k, lsqp_l,             { Current H, K and L integer indicies (reciprocal space) }
            2  239      lsqp_nq, lsqp_mul,                  { Satellite order and multiplicity }
            2  240      lsqp_obs,
            2  241      lsqp_nf2,
            2  242      lsqp_mf2,
            2  243      lsqp_calc
            2  244    );
            2  245  
       C    2  246    { Data information definition }
       C    2  247  
            2  248    dat_rec = record
            2  249      h, k, l, m, nq, mlq, ise,           { Reciprocal cell diff vector }
            2  250      ipl,  refcat:              integer; { Reflexion data type }
            2  251      he,   ke,   le, stsl,               { Reciprocal diffusion vector }
            2  252      dobs, pds,  sig:           mxd_flt; { Intensity, weight and sigma }
            2  253      tbdif: array[0..max_hdt] of mxd_flt { Scattering table -> HKL Dependant table }
            2  254    end;
            2  255  
            2  256  
            2  257  
            2  258    bdt_file = file of dat_rec;           { Binary Data File type }
            2  259  
            2  260  
            2  261  
            2  262  
            2  263  function  MATH_BESSEL_J( rn: integer; rv: mxd_flt ): mxd_flt;
            2  264  external;
            2  265  function  MATH_BESSEL_JH( rn, rv: mxd_flt ): mxd_flt;
            2  266  external;
            2  267  function  MATH_GAMMA( xx: mxd_flt ): mxd_flt;
            2  268  external;
            2  269  function  MATH_INTERPOL( in_var ftab: val_afl; xx: mxd_flt ): mxd_flt;
            2  270  external;
            2  271  procedure MATH_GAUSS_INTEGR_BLDTAB( var ftab: val_afl; va, vb, ep: mxd_flt; ik: integer := 0 );
            2  272  external;
            2  273  function MATH_GAUSS_INTEGR( in_var ftab: val_afl; function FNC( x: mxd_flt ): mxd_flt ): mxd_flt;
            2  274  
            2  275  
            2  276  
       C    2  277  { *** End of environment *** }
       C    2  278  
            1   98   %include 'MXDSRC:mxd_env';                     { Load the mxd global environment }
            1   99  
            1  100  
            1  101  
            1  102  
            1  103  [global]
            1  104  var
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   8
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "math_gauss_integr".

            1  105    flg_extra:            boolean :=       false; { Flag for extrapolation during interpolation function }
            1  106  
            1  107    math_err:             integer :=           0; { Last MATH Error number }
            1  108  
            1  109  
            1  110  
            1  111  
            1  112  function IIPOWER( x, n: integer ): integer;
            1  113  var
            1  114    r: integer;
            1  115  
            1  116  begin
     1      1  117    r := 1;
            1  118    n := ABS( n );
            1  119    while n > 0 do
            1  120      if ODD( n ) then
            1  121      begin
     2      1  122        n := n - 1; r := r * x
     1      1  123      end
            1  124      else
            1  125      begin
     2      1  126        n := n div 2; x := SQR( x )
     1      1  127      end;
            1  128    IIPOWER := r
     0      1  129  end IIPOWER;
            1  130  
            1  131  
            1  132  
       C    1  133  (*
       C    1  134  [global]
       C    1  135  procedure CREATE_FLT_ARRAY( fa: obj_ref; sz: integer );
       C    1  136  var
       C    1  137    mr: mrd_ptr;
       C    1  138    rf: rfd_ptr;
       C    1  139  
       C    1  140  begin
       C    1  141    { Build the coefficient table definition }
       C    1  142    NEW( mr );                       { Allocate a record descriptor }
       C    1  143    NEW( rf );                       { and a field descriptor }
       C    1  144    with rf^ do
       C    1  145    begin
       C    1  146      rfd_nxt := nil;                { No next field for an array }
       C    1  147      rfd_mrd := mr;                 { Reverse link to record the descriptor }
       C    1  148      rfd_atm := nil;                { No field descriptor for array }
       C    1  149      rfd_off := 0;                  { Offset is always 0 }
       C    1  150      rfd_dim := sz;                 { Set the numeric table size }
       C    1  151      rfd_typ.flg := flg_def;        { Set the LISP_FLOAT type (double) }
       C    1  152      rfd_typ.typ := flty;
       C    1  153      rfd_typ.flt := 0.0
       C    1  154    end;
       C    1  155    sz := sz*size_doub;              { Get the size in bytes }
       C    1  156    with fa.at^, mr^ do
       C    1  157    begin
       C    1  158      mrd_nxt      := mrd_alloc;     { Link with previously defined descr. }
       C    1  159      mrd_alloc    := mr;
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE   9
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "math_gauss_integr".

       C    1  160      mrd_atm      := fa.at;         { Set the identifier link }
       C    1  161      mrd_rfdl     := rf;            { and the field descriptor link }
       C    1  162      mrd_size     := sz;            { Set the total size of record in byte }
       C    1  163      mrd_algn     := algn_doub;     { and the related alignement }
       C    1  164      fncref.flg.k := dre_funct;     { Set the atom as an array atom }
       C    1  165      fncref.typ   := mrdty;         { Set the descriptor record acc. fnc type }
       C    1  166      fncref.mrd   := mr;
       C    1  167      val.typ := mrecty;             { Set the allocation }
       C    1  168      { Set the array address in the descriptor }
       C    1  169      val.rec := NEW_RECORD_ALLOC( sz ) { Allocate the array }
       C    1  170    end
       C    1  171  end CREATE_FLT_ARRAY;
       C    1  172  
       C    1  173  
       C    1  174  
       C    1  175  
       C    1  176  [global]
       C    1  177  procedure GET_REC_ARRAY( var lp: obj_ref;    rty: obj_type;
       C    1  178                           var bl: rec_ptr; var sz: integer   );
       C    1  179  const
       C    1  180    mdnam = 'GRAR';
       C    1  181  var
       C    1  182    rf: rfd_ptr;
       C    1  183    fa: obj_ref;
       C    1  184  
       C    1  185  begin
       C    1  186    fa := GET_ATOM( NXT_PAR( lp ), true );  { Get the record array identifier }
       C    1  187    with fa.at^ do
       C    1  188    begin
       C    1  189      if (fncref.typ <> mrdty) or (val.typ <> mrecty) then
       C    1  190        EXEC_ERROR( mdnam, 999, e_severe );
       C    1  191      bl := val.rec;                        { Get the record pointer }
       C    1  192      rf := fncref.mrd^.mrd_rfdl
       C    1  193    end;
       C    1  194    with rf^ do
       C    1  195    begin
       C    1  196      if rfd_atm <> nil then EXEC_ERROR( mdnam, 999, e_severe );
       C    1  197      if rfd_typ.typ <> rty then EXEC_ERROR( mdnam, 999, e_severe );
       C    1  198      sz := rfd_dim
       C    1  199    end
       C    1  200  end GET_REC_ARRAY;
       C    1  201  *)
       C    1  202  
       C    1  203  
            1  204  [global]
            1  205  function  MATH_BESSEL_J( rn: integer; rv: mxd_flt ): mxd_flt;
            1  206  var
                    1
 %*+*+* error(s) was detected at line #   206
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
 (1) - An error #   404 is detected by the DPRO module.
 %*+*+*  A Global entry must be of lex level 1 (not built-in an other entry).

            1  207    re: mxd_flt;
            1  208  
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  10
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "P_math_bessel_j".

            1  209  begin
     1      1  210    re := 0.0;
            1  211  
            1  212    MATH_BESSEL_J := re
     0      1  213  end MATH_BESSEL_J;
            1  214  
            1  215  
            1  216  
            1  217  [global]
            1  218  function  MATH_BESSEL_JH( rn, rv: mxd_flt ): mxd_flt;
            1  219  var
                    1
 %*+*+* error(s) was detected at line #   219
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
 (1) - An error #   404 is detected by the DPRO module.
 %*+*+*  A Global entry must be of lex level 1 (not built-in an other entry).

            1  220    re: mxd_flt;
            1  221  
            1  222  begin
     1      1  223    re := 0.0;
            1  224  
            1  225    MATH_BESSEL_JH := re
     0      1  226  end MATH_BESSEL_JH;
            1  227  
            1  228  
            1  229  
            1  230  function  MATH_GAMMALN( x: mxd_flt ): mxd_flt;
            1  231  var
            1  232    i:           integer;
            1  233    x1, t, s:    mxd_flt;
            1  234    ct: [static] array[1..6] of mxd_flt := (
            1  235               76.18009172947146, -86.50532032941677,
            1  236               24.01409824083091, -1.231739572450155,
            1  237           0.1208650973866179E-2, -0.5395239384953E-5 );
            1  238  
            1  239  begin
     1      1  240    x1 := x;
            1  241    t  := x1 + 5.5;
            1  242    t  := t - (x + 0.5)*LN( t );
            1  243    s  := 1.000000000190015E+00;
            1  244    for i := 1 to 6 do
            1  245    begin
     2      1  246      x1 := x1 + 1.0;
            1  247      s  := s  + ct[i]/x1
     1      1  248    end;
            1  249    MATH_GAMMALN := LN( 2.5066282746310005*s/x ) - t
     0      1  250  end MATH_GAMMALN;
            1  251  
            1  252  
            1  253  
            1  254  
            1  255  [global]
            1  256  function  MATH_L_GAMMA( xx: mxd_flt ): mxd_flt;
            1  257  begin
                    1
 %*+*+* error(s) was detected at line #   257
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  11
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "P_math_l_gamma".

 (1) - An error #   404 is detected by the DPRO module.
 %*+*+*  A Global entry must be of lex level 1 (not built-in an other entry).

     1      1  258    MATH_L_GAMMA := EXP( MATH_GAMMALN( ABS( xx ) ) )
     0      1  259  end MATH_L_GAMMA;
            1  260  
            1  261  
            1  262  
            1  263  function  MATH_TABLE_LOCATE( in_var ftab: val_afl; xx: mxd_flt ): integer;
       C    1  264  { Locate the xx absciss in the tabme ftab (x is locate in the odd indicies and y in the even indicies.
       C    1  265    The table size (val_all) is always even.
       C    1  266  }
            1  267  var
            1  268    jl ,jm, ju:  integer;
            1  269  
            1  270  begin
     1      1  271    with ftab do
            1  272    if val_all > 2 then
            1  273    begin
     2      1  274      jl := 1;
            1  275      ju := val_all div 2 + 1;
            1  276      while ju - jm > 1 do
            1  277      begin
     3      1  278        jm := (ju + jl) div 2;
            1  279        if xx > val_ftb[2*jm-1] then jl := jm
            1  280                                else ju := jm
     2      1  281      end
     1      1  282    end
            1  283    else jl := 1;
            1  284    MATH_TABLE_LOCATE := jl
     0      1  285  end MATH_TABLE_LOCATE;
            1  286  
            1  287  
            1  288  procedure MATH_GET_TAB_POINT( in_var ftab: val_afl; nc: integer; var xx, yy: mxd_flt );
            1  289  var
            1  290  
            1  291  
            1  292  begin
     1      1  293    with ftab do
            1  294    begin
     2      1  295      xx := val_ftb[nc*2-1]; yy := val_ftb[nc*2]
     1      1  296    end
     0      1  297  end MATH_GET_TAB_POINT;
            1  298  
            1  299  
            1  300  
            1  301  [global]
            1  302  function  MATH_INTERPOL( in_var ftab: val_afl; xx: mxd_flt ): mxd_flt;
       C    1  303  { Perform an Interpolation of the A-list Table }
            1  304  const
                    1
 %*+*+* error(s) was detected at line #   304
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
 (1) - An error #   404 is detected by the DPRO module.
 %*+*+*  A Global entry must be of lex level 1 (not built-in an other entry).
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  12
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "P_math_interpol".


            1  305    mdnam = 'ITPO';
            1  306  
            1  307  var
            1  308    c1, c2, c3, r1, r2, re,
            1  309    x1, x2, x3, x4, y1, y2, y3, y4: mxd_flt;
            1  310    ip, nn:  integer;
            1  311  
            1  312  begin { MATH_INTERPOL }
     1      1  313    re := 0.0;
            1  314    math_err := 0;
            1  315    with ftab do
            1  316    begin
     2      1  317      nn  := val_all div 2;
            1  318      if nn > 1 then
            1  319      begin { Check for extrapolation }
     3      1  320        flg_extra := (xx < val_ftb[1]) or (xx > val_ftb[val_all-1]);
            1  321        if flg_extra then
            1  322        begin { Check for large extrapolation }
     4      1  323          x1 := val_ftb[1]; x2 := val_ftb[val_all-1];
            1  324          if xx < x1 then x3 := (x1 - xx)/(x2 - x1)
            1  325                     else x3 := (xx - x2)/(x2 - x1);
            1  326          if ABS( x3 ) > 0.1 then math_err := 1
     3      1  327        end
     2      1  328      end;
            1  329  
            1  330      if nn >= 4 then
            1  331      begin
     3      1  332        if ip > 4 then
            1  333        begin
     4      1  334          ip := MATH_TABLE_LOCATE( ftab, xx );
            1  335          if ip < 2 then ip := 2
            1  336                    else if ip > nn-2 then ip := nn-2
     3      1  337        end else ip := 2;
            1  338        MATH_GET_TAB_POINT( ftab, ip-1, x1, y1 );
            1  339        MATH_GET_TAB_POINT( ftab,   ip, x2, y2 );
            1  340        MATH_GET_TAB_POINT( ftab, ip+1, x3, y3 );
            1  341        MATH_GET_TAB_POINT( ftab, ip+2, x4, y4 );
       C    1  342        { Four points interpolation }
            1  343        r1 := (y1 - y2)/(x1 - x2);
            1  344        r2 := (r1 - (y1 - y3)/(x1 - x3))/(x2 - x3);
            1  345        c3 := (r2 - (r1 - (y1 - y4)/(x1 - x4))/(x2 - x4))/(x3 - x4);
            1  346        c2 := r2 - (x1 + x2 + x3)*c3;
            1  347        c1 := r1 - (x1 + x2)*c2 - (x1*x1 + x1*x2 + x2*x2)*c3;
            1  348        re := y1 - x1*(c1 + x1*(c2 + x1*c3)) + xx*(c1 + xx*(c2 + xx*c3))
     2      1  349      end
            1  350      else
            1  351      begin
     3      1  352        if nn > 0 then
            1  353        begin
     4      1  354          MATH_GET_TAB_POINT( ftab, 1, x1, y1 );
            1  355          if nn > 1 then
            1  356          begin
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  13
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "P_math_interpol".

     5      1  357            MATH_GET_TAB_POINT( ftab, 2, x2, y2 );
            1  358            if nn > 2 then MATH_GET_TAB_POINT( ftab, 3, x3, y3 )
     4      1  359          end
     3      1  360        end;
            1  361        case nn of
            1  362          3: begin
     4      1  363               r1 := (y1 - y2)/(x1 - x2);
            1  364               c2 := (r1 - (y1 - y3)/(x1 - x3))/(x2 - x3);
            1  365               c1 := r1 - (x1 + x2)*c2;
            1  366               re := y1 - x1*(c1 + x1*c2) + xx*(c1 + xx*c2)
     3      1  367             end;
            1  368          2: re := y1 + (xx - x1)*(y1 - y2)/(x1 - x2);
            1  369          1: re := y1;
            1  370        otherwise
     4      1  371          re := 0.0
     3      1  372        end
     2      1  373      end
     1      1  374    end;
            1  375    MATH_INTERPOL := re
     0      1  376  end MATH_INTERPOL;
            1  377  
            1  378  
            1  379  
            1  380  
            1  381  procedure INTGR_GAUSS_LEGENDRE( n:           integer;
            1  382                                  eps, va, vb: mxd_flt;
            1  383                                  bl:          val_afl );
            1  384  var
            1  385    i, ip, j, jp: integer;
            1  386    e, c1, c2, c3, cder, xm, xl, x, w: mxd_flt;
            1  387  
            1  388  begin
     1      1  389    xm := 0.5*(vb + va);
            1  390    xl := 0.5*(vb - va);
            1  391    ip := 0;
            1  392    jp := 2*n - 1;
            1  393    for i := 1 to (n + 1) div 2 do
            1  394    begin
     2      1  395      x := COS( pi*(i - 0.25)/(n + 0.5) );
            1  396      repeat
     3      1  397        c1 := 1.0;
            1  398        c2 := 0.0;
            1  399        for j := 1 to n do
            1  400        begin
     4      1  401          c3 := c2; c2 := c1;    { Pn-1 -> pn-2, Pn -> Pn-1 }
            1  402          c1 := ((2.0*j - 1.0)*x*c2 - (j - 1.0)*c3)/j
     3      1  403        end;
            1  404        cder := n*(x*c1 - c2)/(SQR( x ) - 1.0);
            1  405        e := x;
            1  406        x := e - c1/cder
     2      1  407      until ABS( x - e ) <= eps;
            1  408      w := 2.0*xl/((1.0 - SQR( x ))*SQR( cder ));
            1  409      bl.val_ftb[ip] := w;
            1  410      bl.val_ftb[jp] := xm + xl*x;
            1  411      ip := ip + 1;
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  14
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "PRC_00000004".

            1  412      jp := jp - 1;
            1  413      bl.val_ftb[ip] := xm - xl*x;
            1  414      bl.val_ftb[jp] := w;
            1  415      ip := ip + 1;
            1  416      jp := jp - 1
     1      1  417    end
     0      1  418  end INTGR_GAUSS_LEGENDRE;
            1  419  
            1  420  
            1  421  
            1  422  
            1  423  procedure INTGR_GAUSS_LAGUERRE( n:       integer;
            1  424                                  al, eps: mxd_flt;
            1  425                                  bl:      val_afl );
            1  426  const
            1  427    mdnam = 'INTL';
            1  428    maxit =    500;
            1  429  
            1  430  var
            1  431    i, ip, it, j: integer;
            1  432    c0, c1, c2, c3, pder, x, x1: mxd_flt;
            1  433  
            1  434  begin
     1      1  435    ip := 0;
            1  436    for i := 1 to n do
            1  437    begin
     2      1  438      case i of
            1  439        1: x := (1.0 + al)*(3.0 + 0.92*al)/(1.0 + 2.4*n + 1.8*al);
            1  440        2: x := x + (15.0 + 6.25*al)/(1.0 + 0.9*al + 2.5*n);
            1  441      otherwise
     3      1  442        c0 := i - 2;
            1  443        x  := x + ((1.0 + 2.55*c0)/(1.9*c0) + 1.26*c0*al/(1.0 + 3.5*c0))*
            1  444                  (x - bl.val_ftb[ip - 2])/(1.0 + 0.3*al)
     2      1  445      end;
            1  446      it := 0;
            1  447      repeat
     3      1  448        c1 := 1.0;
            1  449        c2 := 0.0;
            1  450        for j := 1 to n do
            1  451        begin
     4      1  452          c3 := c2;
            1  453          c2 := c1;
            1  454          c1 := ((2*j - 1 + al - x)*c2 - (j - 1 + al)*c3)/j
     3      1  455        end;
            1  456        pder := (n*c1 - (n + al)*c2)/x;
            1  457        x1 := x;
            1  458        x  := x1 - c1/pder;
            1  459        it := it + 1
     2      1  460      until (it > maxit) or (ABS( x - x1 ) < eps);
            1  461      if it > maxit then math_err := 2;
            1  462      bl.val_ftb[ip] := -EXP( MATH_GAMMALN( al + n )
            1  463                              - MATH_GAMMALN( double( n ) ) )/(pder*n*c2);
            1  464      ip := ip + 1;
            1  465      bl.val_ftb[ip] := x;
            1  466      ip := ip + 1
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  15
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "PRC_00000005".

     1      1  467    end
     0      1  468  end INTGR_GAUSS_LAGUERRE;
            1  469  
            1  470  
            1  471  
            1  472  
            1  473  procedure INTGR_GAUSS_HERMITE(  n:   integer;
            1  474                                  ep:  mxd_flt;
            1  475                                  bl:  val_afl );
            1  476  const
            1  477    mdnam = 'INTH';
            1  478    maxit  = 500;
            1  479    uspir4 = 0.7511255444649425E+00;
            1  480  
            1  481  var
            1  482    i, ip, it, j, jp: integer;
            1  483    c1, c2, c3, pder, x, x1: mxd_flt;
            1  484  
            1  485  begin
     1      1  486    ip := 0;
            1  487    jp := 2*n - 1;
            1  488    for i := 1 to (n + 1) div 2 do
            1  489    begin 
     2      1  490      case i of
            1  491        1: begin
     3      1  492             x1 := 2*n + 1;
            1  493             x  := SQRT( x1 ) - 1.85575*EXP( -1.6667*LN( x1 ) )
     2      1  494           end;
            1  495  
            1  496        2: begin
     3      1  497             x1 := n;
            1  498             x  := x - 1.14*EXP( 0.426*LN( x1 ) )/x
     2      1  499           end;
            1  500  
            1  501        3: x := 1.86*x - 0.86*bl.val_ftb[1];      { Compute 3-th root from the first one }
            1  502  
            1  503        4: x := 1.91*x - 0.91*bl.val_ftb[3];      { Compute 4-th root form the second one}
            1  504  
            1  505      otherwise
     3      1  506        x := 2.0*x - bl.val_ftb[ip - 2]           { Compute the i-th x from the i-2-th x }
     2      1  507      end;
            1  508  
            1  509      it := 0;
            1  510      repeat
     3      1  511        c1 := uspir4;
            1  512        c2 := 0.0;
            1  513        for j := 1 to n do
            1  514        begin
     4      1  515          c3 := c2;
            1  516          c2 := c1;
            1  517          c1 := j;
            1  518          c1 := x*SQRT( 2.0/c1 )*c2 - SQRT( (c1 - 1.0)/c1 )*c3
     3      1  519        end;
            1  520        pder := SQRT( 2.0*n )*c2;
            1  521        x1   := x;
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  16
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "PRC_00000006".

            1  522        x    := x1 - c1/pder;
            1  523        it := it + 1
     2      1  524      until (ABS( x1 - x ) < ep) or (it > maxit);
            1  525      if it > maxit then math_err := 3;
            1  526      pder := 2.0/SQR( pder );
            1  527      bl.val_ftb[ip] := pder;
            1  528      bl.val_ftb[jp] := x;
            1  529      ip := ip + 1;
            1  530      jp := jp - 1;
            1  531      bl.val_ftb[ip] := -x;
            1  532      bl.val_ftb[jp] := pder;
            1  533      ip := ip + 1;
            1  534      jp := jp - 1
     1      1  535    end
     0      1  536  end INTGR_GAUSS_HERMITE;
            1  537  
            1  538  
            1  539  
            1  540  
            1  541  [global]
            1  542  procedure MATH_GAUSS_INTEGR_BLDTAB( var ftab: val_afl; va, vb, ep: mxd_flt; ik: integer := 0 );
            1  543  var
                    1
 %*+*+* error(s) was detected at line #   543
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
 (1) - An error #   404 is detected by the DPRO module.
 %*+*+*  A Global entry must be of lex level 1 (not built-in an other entry).

            1  544    nn: integer;
            1  545  
            1  546  begin
     1      1  547    with ftab do
            1  548    begin
     2      1  549      nn := val_all div 2;
            1  550      if nn < 5 then math_err := 2
            1  551      else
            1  552        case ik of
            1  553          1: { GAUSS LAGUERRE }
            1  554            begin
     3      1  555              if va = maxint then va := 1.0;    { Get the alpha laguerre coef }
            1  556              INTGR_GAUSS_LAGUERRE( nn, va, ep, ftab )
     2      1  557            end;
            1  558  
            1  559          2: { GAUSS HERMITE }
            1  560            INTGR_GAUSS_HERMITE( nn, ep, ftab );
            1  561  
            1  562        otherwise
       C    1  563          { Default to GAUSS LEGENDRE }
     3      1  564          if vb <= va then vb := va + 1.0;
            1  565          INTGR_GAUSS_LEGENDRE( nn, ep, va, vb, ftab )
     2      1  566        end
     1      1  567    end
     0      1  568  end MATH_GAUSS_INTEGR_BLDTAB;
            1  569  
            1  570  
  P A S - P. WOLFERS SOFTWARE: V2.1-E OF 31-AUG-2009  RUN THE 01-APR-2010 AT 17:05:22     PAGE  17
 The Current Source File is "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas".

 The Current Compiled Module is "math_gauss_integr".

            1  571  
            1  572  [global]
            1  573  function  MATH_GAUSS_INTEGR( in_var ftab: val_afl; function FNC( x: mxd_flt ): mxd_flt ): mxd_flt;
            1  574  const
                    1
 %*+*+* error(s) was detected at line #   574
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
 (1) - An error #   404 is detected by the DPRO module.
 %*+*+*  A Global entry must be of lex level 1 (not built-in an other entry).

            1  575    mdnam = 'MTHI';
            1  576    joker = 1.0E+30;
            1  577  
            1  578  var
            1  579    ip, nn: integer;
            1  580    we, re:        mxd_flt;
            1  581  
            1  582  begin
     1      1  583    with ftab do
            1  584    begin
     2      1  585      nn := val_all div 2;
            1  586      re := 0.0;
            1  587  
       C    1  588      { Integration Loop }
            1  589      ip := 0;
            1  590      if nn > 5 then
            1  591        for ii := 1 to nn do
            1  592        begin
     3      1  593          ip   :=           ip + 1;
            1  594          we   :=      val_ftb[ip];               { Get the weight }
            1  595          ip   :=           ip + 1;
            1  596          re   := re + we*FNC( val_ftb[ip] )      { Compute the integral term }
     2      1  597        end
     1      1  598    end;
            1  599    MATH_GAUSS_INTEGR := re
     0      1  600  end MATH_GAUSS_INTEGR;
            1  601  
            1  602  
            1  603  end MXD_MATH.
                    ____1_______2
 %*+*+* error(s) was detected at line #   603
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
 (1) - An error #    71 is detected by the GEND module.
 %*+*+*  Identifier "mxd_math" after a end of procedure/function do not match.
 (2) - An error #    91 is detected by the BLOC module.
 %*+*+*  Illegal statement.

            1  604  
                    1
 %*+*+* error(s) was detected at line #   604
 in the file : "/home/wolfers/Soft/cpsh_kits/MXDV4_src/mxd_math.pas"
 (1) - A warning #    91 is detected by the BLOC module.
 %*+*+*  Illegal statement.

