Home » Archimedes archive » Micro User » MU 1991-07.adf » PD-Stuff » Fractals/!Martin/!Help

Fractals/!Martin/!Help

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Micro User » MU 1991-07.adf » PD-Stuff
Filename: Fractals/!Martin/!Help
Read OK:
File size: 0348 bytes
Load address: 0000
Exec address: 0000
File contents
Help file for !Martin v1.0

!Martin uses the algorithm discovered by the man of the same name - Dr Barry
Martin, and was originally published in the Scientific American. I gather it
works due to rounding errors caused by the use of floating point numbers.
These numbers are only stored approximately by the programming language /
computer, and thus errors gradually creep in by the repeated calculation.

Performing the same calculation using a different floating point mechanism
will produce different results.

The key to the routine is the SGN term - without it nothing spectacular
happens. You can try different calculations to produce a similar effect.

The amazing thing about the routine is its simplicity and speed. In fact you
can reduce this program to just 1 line of BASIC code!

Mike Curnow,
Archimedes Fractal Group,
April 1991
00000000  48 65 6c 70 20 66 69 6c  65 20 66 6f 72 20 21 4d  |Help file for !M|
00000010  61 72 74 69 6e 20 76 31  2e 30 0a 0a 21 4d 61 72  |artin v1.0..!Mar|
00000020  74 69 6e 20 75 73 65 73  20 74 68 65 20 61 6c 67  |tin uses the alg|
00000030  6f 72 69 74 68 6d 20 64  69 73 63 6f 76 65 72 65  |orithm discovere|
00000040  64 20 62 79 20 74 68 65  20 6d 61 6e 20 6f 66 20  |d by the man of |
00000050  74 68 65 20 73 61 6d 65  20 6e 61 6d 65 20 2d 20  |the same name - |
00000060  44 72 20 42 61 72 72 79  0a 4d 61 72 74 69 6e 2c  |Dr Barry.Martin,|
00000070  20 61 6e 64 20 77 61 73  20 6f 72 69 67 69 6e 61  | and was origina|
00000080  6c 6c 79 20 70 75 62 6c  69 73 68 65 64 20 69 6e  |lly published in|
00000090  20 74 68 65 20 53 63 69  65 6e 74 69 66 69 63 20  | the Scientific |
000000a0  41 6d 65 72 69 63 61 6e  2e 20 49 20 67 61 74 68  |American. I gath|
000000b0  65 72 20 69 74 0a 77 6f  72 6b 73 20 64 75 65 20  |er it.works due |
000000c0  74 6f 20 72 6f 75 6e 64  69 6e 67 20 65 72 72 6f  |to rounding erro|
000000d0  72 73 20 63 61 75 73 65  64 20 62 79 20 74 68 65  |rs caused by the|
000000e0  20 75 73 65 20 6f 66 20  66 6c 6f 61 74 69 6e 67  | use of floating|
000000f0  20 70 6f 69 6e 74 20 6e  75 6d 62 65 72 73 2e 0a  | point numbers..|
00000100  54 68 65 73 65 20 6e 75  6d 62 65 72 73 20 61 72  |These numbers ar|
00000110  65 20 6f 6e 6c 79 20 73  74 6f 72 65 64 20 61 70  |e only stored ap|
00000120  70 72 6f 78 69 6d 61 74  65 6c 79 20 62 79 20 74  |proximately by t|
00000130  68 65 20 70 72 6f 67 72  61 6d 6d 69 6e 67 20 6c  |he programming l|
00000140  61 6e 67 75 61 67 65 20  2f 0a 63 6f 6d 70 75 74  |anguage /.comput|
00000150  65 72 2c 20 61 6e 64 20  74 68 75 73 20 65 72 72  |er, and thus err|
00000160  6f 72 73 20 67 72 61 64  75 61 6c 6c 79 20 63 72  |ors gradually cr|
00000170  65 65 70 20 69 6e 20 62  79 20 74 68 65 20 72 65  |eep in by the re|
00000180  70 65 61 74 65 64 20 63  61 6c 63 75 6c 61 74 69  |peated calculati|
00000190  6f 6e 2e 0a 0a 50 65 72  66 6f 72 6d 69 6e 67 20  |on...Performing |
000001a0  74 68 65 20 73 61 6d 65  20 63 61 6c 63 75 6c 61  |the same calcula|
000001b0  74 69 6f 6e 20 75 73 69  6e 67 20 61 20 64 69 66  |tion using a dif|
000001c0  66 65 72 65 6e 74 20 66  6c 6f 61 74 69 6e 67 20  |ferent floating |
000001d0  70 6f 69 6e 74 20 6d 65  63 68 61 6e 69 73 6d 0a  |point mechanism.|
000001e0  77 69 6c 6c 20 70 72 6f  64 75 63 65 20 64 69 66  |will produce dif|
000001f0  66 65 72 65 6e 74 20 72  65 73 75 6c 74 73 2e 0a  |ferent results..|
00000200  0a 54 68 65 20 6b 65 79  20 74 6f 20 74 68 65 20  |.The key to the |
00000210  72 6f 75 74 69 6e 65 20  69 73 20 74 68 65 20 53  |routine is the S|
00000220  47 4e 20 74 65 72 6d 20  2d 20 77 69 74 68 6f 75  |GN term - withou|
00000230  74 20 69 74 20 6e 6f 74  68 69 6e 67 20 73 70 65  |t it nothing spe|
00000240  63 74 61 63 75 6c 61 72  0a 68 61 70 70 65 6e 73  |ctacular.happens|
00000250  2e 20 59 6f 75 20 63 61  6e 20 74 72 79 20 64 69  |. You can try di|
00000260  66 66 65 72 65 6e 74 20  63 61 6c 63 75 6c 61 74  |fferent calculat|
00000270  69 6f 6e 73 20 74 6f 20  70 72 6f 64 75 63 65 20  |ions to produce |
00000280  61 20 73 69 6d 69 6c 61  72 20 65 66 66 65 63 74  |a similar effect|
00000290  2e 0a 0a 54 68 65 20 61  6d 61 7a 69 6e 67 20 74  |...The amazing t|
000002a0  68 69 6e 67 20 61 62 6f  75 74 20 74 68 65 20 72  |hing about the r|
000002b0  6f 75 74 69 6e 65 20 69  73 20 69 74 73 20 73 69  |outine is its si|
000002c0  6d 70 6c 69 63 69 74 79  20 61 6e 64 20 73 70 65  |mplicity and spe|
000002d0  65 64 2e 20 49 6e 20 66  61 63 74 20 79 6f 75 0a  |ed. In fact you.|
000002e0  63 61 6e 20 72 65 64 75  63 65 20 74 68 69 73 20  |can reduce this |
000002f0  70 72 6f 67 72 61 6d 20  74 6f 20 6a 75 73 74 20  |program to just |
00000300  31 20 6c 69 6e 65 20 6f  66 20 42 41 53 49 43 20  |1 line of BASIC |
00000310  63 6f 64 65 21 0a 0a 4d  69 6b 65 20 43 75 72 6e  |code!..Mike Curn|
00000320  6f 77 2c 0a 41 72 63 68  69 6d 65 64 65 73 20 46  |ow,.Archimedes F|
00000330  72 61 63 74 61 6c 20 47  72 6f 75 70 2c 0a 41 70  |ractal Group,.Ap|
00000340  72 69 6c 20 31 39 39 31                           |ril 1991|
00000348