      FUNCTION   GEN(ANOISE)                                            GEN00100
C     C.L.LAWSON AND R.J.HANSON, JET PROPULSION LABORATORY, 1972 DEC 15 GEN00200
C     TO APPEAR IN 'SOLVING LEAST SQUARES PROBLEMS', PRENTICE-HALL, 1974GEN00300
C          GENERATE NUMBERS FOR CONSTRUCTION OF TEST CASES.             GEN00400
      IF (ANOISE) 10,30,20                                              GEN00500
   10 MI=891                                                            GEN00600
      MJ=457                                                            GEN00700
      I=5                                                               GEN00800
      J=7                                                               GEN00900
      AJ=0.                                                             GEN01000
      GEN=0.                                                            GEN01100
      RETURN                                                            GEN01200
C                                                                       GEN01300
C     THE SEQUENCE OF VALUES OF J  IS BOUNDED BETWEEN 1 AND 996         GEN01400
C     IF INITIAL J = 1,2,3,4,5,6,7,8, OR 9, THE PERIOD IS 332           GEN01500
   20 J=J*MJ                                                            GEN01600
      J=J-997*(J/997)                                                   GEN01700
      AJ=J-498                                                          GEN01800
C     THE SEQUENCE OF VALUES OF I  IS BOUNDED BETWEEN 1 AND 999         GEN01900
C     IF INITIAL I = 1,2,3,6,7, OR 9,  THE PERIOD WILL BE 50            GEN02000
C     IF INITIAL I = 4 OR 8   THE PERIOD WILL BE 25                     GEN02100
C     IF INITIAL I = 5        THE PERIOD WILL BE 10                     GEN02200
   30 I=I*MI                                                            GEN02300
      I=I-1000*(I/1000)                                                 GEN02400
      AI=I-500                                                          GEN02500
      GEN=AI+AJ*ANOISE                                                  GEN02600
      RETURN                                                            GEN02700
      END                                                               GEN02800
