home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume28 / mrandom-3.0 / part01 / src / script < prev    next >
Encoding:
Text File  |  1994-05-06  |  2.4 KB  |  71 lines

  1. #! /bin/csh -f
  2. # script 3.1 5/28/93
  3. #
  4. # Make, test, and show some features of the mrandom package.
  5. #
  6. echo "Making..."
  7. make mrtest
  8. echo " "
  9. echo "Exhibit a problem with the -f method of generating large integers."
  10. mrtest -e -f -S1,1 -m100663296 -q 100000
  11. echo " "
  12. echo "Exhibit a problem with the -p method of generating large integers."
  13. mrtest -e -p -m201326592 -q 100000
  14. echo " "
  15. make mrtestv
  16. echo " "
  17. echo "What is the 100,000th output from 4.3bsd random(), seed = 1?"
  18. mrtestv -e -S1,1,0,100000 -M31 1
  19. echo " "
  20. echo "How long does 4.3bsd random() take to generate 1e6 ints"
  21. echo "  in 0..99, using vectorized code?" 
  22. time mrtestv -e -t -q -m100 1000000
  23. echo " "
  24. echo "What is the 100,000th output from Jon Bentley's rng, seed 1?"
  25. echo "  Note that Bentley's rng has a range of 1e9."
  26. mrtestv -e -S2,1,0,100000 -m1000000000 1
  27. echo " "
  28. echo "How long does Bentley's RNG take to generate 1e6 ints?"
  29. time mrtestv -e -t -m100 1000000
  30. echo " "
  31. echo "What is the 100,000th output from the Portable Combined multiplicative"
  32. echo "  generator (pcrand), with seeds = (1,2)?"
  33. echo "  Note that this rng has a range of 2147483561." 
  34. mrtestv -e -S3,1,2,100000 -m2147483561 1
  35. echo " "
  36. echo "How long does pcrand() take to generate 1e6 ints?"
  37. time mrtestv -e -t -q -m100 1000000
  38. echo " "
  39. echo "What is the 100,000th output from nrand48 with 48-bit seed = (1<<16)+2?"
  40. mrtestv -e -S4,1,2,100000 -M31 1
  41. echo " "
  42. echo "Exhibit a problem with long-range correlation in nrand48."
  43. mrtestv -e -S4,1,2,200001 -M16 -d1023 -q 1000
  44. echo " "
  45. echo "How long does nrand48() take to generate 1e6 ints?"
  46. time mrtestv -e -t -q -m100 1000000
  47. echo " "
  48. echo "What is the 100,000th output from 4.3bsd rand, seed = 1?"
  49. mrtestv -e -S5,1,0,100000 -M31 1
  50. echo " "
  51. echo "Exhibit a problem with the low-order bits of rand."
  52. mrtestv -e -M31 -q 500
  53. echo " "
  54. echo "Try the weak equi-distribution test on the low-order bits of rand."
  55. mrtestv -e -M31 -q 240000
  56. echo " "
  57. echo "Exhibit a problem with the middle bits of rand."
  58. mrtestv -e -M16 -q 100000
  59. echo " "
  60. echo "Exhibit a problem with long-range correlation of the MSBs in rand."
  61. mrtestv -e -M3 -d1023 -q 500
  62. echo " "
  63. echo "How long does 4.3bsd rand() take to generate 1e6 ints?  (Who cares?)"
  64. time mrtestv -e -t -q -m100 1000000
  65. echo " "
  66. echo "Just for fun, observe the catastrophic failures of an additive RNG."
  67. mrtestv -e -S0,0,65536 -q -M16 2000
  68. echo " "
  69. echo "The mrandom exhibition script is complete."
  70. exit(0)
  71.