#include "perms.h"

                                                                //      1  !%endoflist
                                                                //      2  !These Pseudo-random numbers were written by P. Reid.  It is not known if
                                                                //      3  !they are genuinely random or not.
                                                                //      4  
                                                                //      5  !**  %routine   INITALISE RANDOM    sets up the random integer SEED          **!
                                                                //      6  !**  %real %fn  RANDOM REAL (LO,HI) returns uniformly distributed reals      **!
                                                                //      7  !**                                 between LO and HI inclusive              **!
                                                                //      8  !**  %short %fn RANDOM INT (LO,HI)  returns uniformly distributed short      **!
                                                                //      9  !**                                 integers between LO and HI inclusive     **!
                                                                //     10  
                                                                //     11  %own %integer Seed=0  {initialised to 0: JHB mod 16/12/86}
#line 11 "regression-compile-tmp/random.imp"
static int SEED = 0;
                                                                //     12  
                                                                //     13  
                                                                //     14  %routine Initialise Random
#line 14 "regression-compile-tmp/random.imp"
void INITIALISERANDOM( void )
#line 14 "regression-compile-tmp/random.imp"
{
  __label__ _imp_endofblock;
                                                                //     15  !
                                                                //     16  ! Set up SEED
                                                                //     17  !
                                                                //     18     Seed = CpuTime
_imp_current_line = 18; _imp_current_file = "regression-compile-tmp/random.imp";
#line 18 "regression-compile-tmp/random.imp"
SEED = _imp_CPUTIME();
                                                                //     19  %end
_imp_current_line = 19; _imp_current_file = "regression-compile-tmp/random.imp";
#line 19 "regression-compile-tmp/random.imp"
return;
_imp_endofblock: ;
} // End of block INITIALISERANDOM at level 1
                                                                //     20  
                                                                //     21  
                                                                //     22  %realfn Random Real(%real Lo, Hi)
#line 22 "regression-compile-tmp/random.imp"
float RANDOMREAL( float LO, float HI )
#line 22 "regression-compile-tmp/random.imp"
{
  __label__ _imp_endofblock;
                                                                //     23  !
                                                                //     24  ! Returns a random real between LO and HI inclusive
                                                                //     25  !
                                                                //     26     Seed = (23501*Seed + 6923) & 32767
_imp_current_line = 26; _imp_current_file = "regression-compile-tmp/random.imp";
#line 26 "regression-compile-tmp/random.imp"
SEED = (((((int)((((int)(23501)) * (SEED)))) + (6923))) & (32767));
/*Warning: potential loss of precision converting from integer AST_VAR (SEED - 4 bytes) to real AST_BINOP ((((float)(HI)) - (LO)) - 0 bytes) detected at ast.c line 108 */
                                                                //     27     %result = Lo + (Seed * (Hi - Lo))/32767
_imp_current_line = 27; _imp_current_file = "regression-compile-tmp/random.imp";
#line 27 "regression-compile-tmp/random.imp"
return ((LO) + ((((((((SEED)) * ((((float)(HI)) - (LO)))))) / ((float)(32767))))));
                                                                //     28  %end
_imp_current_line = 28; _imp_current_file = "regression-compile-tmp/random.imp";
#line 28 "regression-compile-tmp/random.imp"
_imp_endofblock: ;
} // End of block RANDOMREAL at level 1
                                                                //     29  
                                                                //     30  
                                                                //     31  %shortfn Random Int (%short Lo, Hi)
#line 31 "regression-compile-tmp/random.imp"
short RANDOMINT( short LO, short HI )
#line 31 "regression-compile-tmp/random.imp"
{
  __label__ _imp_endofblock;
                                                                //     32  !
                                                                //     33  ! Returns a random shortinteger between LO and HI inclusive
                                                                //     34  !
                                                                //     35     Seed = (23501*Seed + 6923) & 32767
_imp_current_line = 35; _imp_current_file = "regression-compile-tmp/random.imp";
#line 35 "regression-compile-tmp/random.imp"
SEED = (((((int)((((int)(23501)) * (SEED)))) + (6923))) & (32767));
                                                                //     36     %result = Int(Lo + (Seed * (Hi - Lo))/32767)
_imp_current_line = 36; _imp_current_file = "regression-compile-tmp/random.imp";
#line 36 "regression-compile-tmp/random.imp"
return _imp_INT(((LO) + (((((((SEED) * ((int)((((short)(HI)) - (LO))))))) / ((float)(32767)))))));
                                                                //     37  %end
_imp_current_line = 37; _imp_current_file = "regression-compile-tmp/random.imp";
#line 37 "regression-compile-tmp/random.imp"
_imp_endofblock: ;
} // End of block RANDOMINT at level 1
                                                                //     38  
                                                                //     39  !%list
                                                                //     40  %endoffile
#line 40 "regression-compile-tmp/random.imp"
// End of file
