Download - ACORN random numbers

This gives examples and downloadable executables in various languages.


Download

ACORN FORTRAN 77

This is the original code from 1989 and 2009 articles!

This version of ACORN uses 32-bit integers and works modulo 260. Although it works well, it does not pass all of the tests in the TestU01 test suite.

It is straightforward to modify so that it works modulo 290 or 2120 (which is desirable, in order to pass all the tests in the TestU01 test suite)

                                                                               
      DOUBLE PRECISION FUNCTION ACORNJ(XDUMMY)                                 
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)                                      
      PARAMETER (MAXORD=120,MAXOP1=MAXORD+1)                                   
      COMMON /IACO2/ KORDEJ,MAXJNT,IXV1(MAXOP1),IXV2(MAXOP1)                   
      DO 7 I=1,KORDEJ                                                          
        IXV1(I+1)=(IXV1(I+1)+IXV1(I))                                          
        IXV2(I+1)=(IXV2(I+1)+IXV2(I))                                          
        IF (IXV2(I+1).GE.MAXJNT) THEN                                          
          IXV2(I+1)=IXV2(I+1)-MAXJNT                                           
          IXV1(I+1)=IXV1(I+1)+1                                                
        ENDIF                                                                  
      IF (IXV1(I+1).GE.MAXJNT) IXV1(I+1)=IXV1(I+1)-MAXJNT                      
    7 CONTINUE                                                                 
      ACORNJ=(DBLE(IXV1(KORDEJ+1))                                             
     1          +DBLE(IXV2(KORDEJ+1))/MAXJNT)/MAXJNT                           
      RETURN                                                                   
      END                                                                      
                                                                               

ACORN JavaScript - available soon

A javascript implementation of ACORN is acornJs.js, which closely follows the original code above, and can be adapted according to your needs.

Either - Link your HTML page(s) to this site:
<script src="http://acorn.wikramaratna.org/acornjs/acornJs.js"> </script>

 -  OR  - Use 20190200acornJs.zip which contains the script and instructions.
20190200acornJs.zip

ACORN for Windows - available soon

File 20190200windowsExe.zip contains compiled FORTRAN 32-bit and 64-bit Windows executables and instructions.



All information on this site © 2019 Roy Wikramaratna.
You may use all information for research and teaching purposes (with due acknowledgement).
For business or commercial or other use for gain, see contact page.
created 2019-01-31 / updated 2019-03-31