Home » Archimedes archive » Archimedes World » AW-1996-03-Disc 2.adf » !AcornAns_AcornAns » MathFns/ReadMe

MathFns/ReadMe

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 » Archimedes World » AW-1996-03-Disc 2.adf » !AcornAns_AcornAns
Filename: MathFns/ReadMe
Read OK:
File size: 0331 bytes
Load address: 0000
Exec address: 0000
File contents
See AcornAnswers in magazine for details.

Briefly, the 'Demo' program demonstrates how to code assembler routines
to evaluate mathematical functions such as ln, exp, sin, cos etc, using
polynomial approximation and additional techniques.

It graphs various functions for which it contains routines & also plots
the errors these approximations produce compared to the much slower
floating point routines contained in FPEmulator.

Sample code (for ln, exp, sin & cos) can be found in MathFns.s.subrouts1.
It is heavily commented.

The 'Coef' program assists in the calculation of suitable polynomials
for arbitrary functions, to allow you to code your own new functions.

Before undertaking such a task I suggest you try to construct your own
cos routine with it & compare your results to that in the subrouts1 file.
00000000  0a 53 65 65 20 41 63 6f  72 6e 41 6e 73 77 65 72  |.See AcornAnswer|
00000010  73 20 69 6e 20 6d 61 67  61 7a 69 6e 65 20 66 6f  |s in magazine fo|
00000020  72 20 64 65 74 61 69 6c  73 2e 0a 0a 42 72 69 65  |r details...Brie|
00000030  66 6c 79 2c 20 74 68 65  20 27 44 65 6d 6f 27 20  |fly, the 'Demo' |
00000040  70 72 6f 67 72 61 6d 20  64 65 6d 6f 6e 73 74 72  |program demonstr|
00000050  61 74 65 73 20 68 6f 77  20 74 6f 20 63 6f 64 65  |ates how to code|
00000060  20 61 73 73 65 6d 62 6c  65 72 20 72 6f 75 74 69  | assembler routi|
00000070  6e 65 73 0a 74 6f 20 65  76 61 6c 75 61 74 65 20  |nes.to evaluate |
00000080  6d 61 74 68 65 6d 61 74  69 63 61 6c 20 66 75 6e  |mathematical fun|
00000090  63 74 69 6f 6e 73 20 73  75 63 68 20 61 73 20 6c  |ctions such as l|
000000a0  6e 2c 20 65 78 70 2c 20  73 69 6e 2c 20 63 6f 73  |n, exp, sin, cos|
000000b0  20 65 74 63 2c 20 75 73  69 6e 67 0a 70 6f 6c 79  | etc, using.poly|
000000c0  6e 6f 6d 69 61 6c 20 61  70 70 72 6f 78 69 6d 61  |nomial approxima|
000000d0  74 69 6f 6e 20 61 6e 64  20 61 64 64 69 74 69 6f  |tion and additio|
000000e0  6e 61 6c 20 74 65 63 68  6e 69 71 75 65 73 2e 0a  |nal techniques..|
000000f0  0a 49 74 20 67 72 61 70  68 73 20 76 61 72 69 6f  |.It graphs vario|
00000100  75 73 20 66 75 6e 63 74  69 6f 6e 73 20 66 6f 72  |us functions for|
00000110  20 77 68 69 63 68 20 69  74 20 63 6f 6e 74 61 69  | which it contai|
00000120  6e 73 20 72 6f 75 74 69  6e 65 73 20 26 20 61 6c  |ns routines & al|
00000130  73 6f 20 70 6c 6f 74 73  0a 74 68 65 20 65 72 72  |so plots.the err|
00000140  6f 72 73 20 74 68 65 73  65 20 61 70 70 72 6f 78  |ors these approx|
00000150  69 6d 61 74 69 6f 6e 73  20 70 72 6f 64 75 63 65  |imations produce|
00000160  20 63 6f 6d 70 61 72 65  64 20 74 6f 20 74 68 65  | compared to the|
00000170  20 6d 75 63 68 20 73 6c  6f 77 65 72 0a 66 6c 6f  | much slower.flo|
00000180  61 74 69 6e 67 20 70 6f  69 6e 74 20 72 6f 75 74  |ating point rout|
00000190  69 6e 65 73 20 63 6f 6e  74 61 69 6e 65 64 20 69  |ines contained i|
000001a0  6e 20 46 50 45 6d 75 6c  61 74 6f 72 2e 0a 0a 53  |n FPEmulator...S|
000001b0  61 6d 70 6c 65 20 63 6f  64 65 20 28 66 6f 72 20  |ample code (for |
000001c0  6c 6e 2c 20 65 78 70 2c  20 73 69 6e 20 26 20 63  |ln, exp, sin & c|
000001d0  6f 73 29 20 63 61 6e 20  62 65 20 66 6f 75 6e 64  |os) can be found|
000001e0  20 69 6e 20 4d 61 74 68  46 6e 73 2e 73 2e 73 75  | in MathFns.s.su|
000001f0  62 72 6f 75 74 73 31 2e  0a 49 74 20 69 73 20 68  |brouts1..It is h|
00000200  65 61 76 69 6c 79 20 63  6f 6d 6d 65 6e 74 65 64  |eavily commented|
00000210  2e 0a 0a 54 68 65 20 27  43 6f 65 66 27 20 70 72  |...The 'Coef' pr|
00000220  6f 67 72 61 6d 20 61 73  73 69 73 74 73 20 69 6e  |ogram assists in|
00000230  20 74 68 65 20 63 61 6c  63 75 6c 61 74 69 6f 6e  | the calculation|
00000240  20 6f 66 20 73 75 69 74  61 62 6c 65 20 70 6f 6c  | of suitable pol|
00000250  79 6e 6f 6d 69 61 6c 73  0a 66 6f 72 20 61 72 62  |ynomials.for arb|
00000260  69 74 72 61 72 79 20 66  75 6e 63 74 69 6f 6e 73  |itrary functions|
00000270  2c 20 74 6f 20 61 6c 6c  6f 77 20 79 6f 75 20 74  |, to allow you t|
00000280  6f 20 63 6f 64 65 20 79  6f 75 72 20 6f 77 6e 20  |o code your own |
00000290  6e 65 77 20 66 75 6e 63  74 69 6f 6e 73 2e 0a 0a  |new functions...|
000002a0  42 65 66 6f 72 65 20 75  6e 64 65 72 74 61 6b 69  |Before undertaki|
000002b0  6e 67 20 73 75 63 68 20  61 20 74 61 73 6b 20 49  |ng such a task I|
000002c0  20 73 75 67 67 65 73 74  20 79 6f 75 20 74 72 79  | suggest you try|
000002d0  20 74 6f 20 63 6f 6e 73  74 72 75 63 74 20 79 6f  | to construct yo|
000002e0  75 72 20 6f 77 6e 0a 63  6f 73 20 72 6f 75 74 69  |ur own.cos routi|
000002f0  6e 65 20 77 69 74 68 20  69 74 20 26 20 63 6f 6d  |ne with it & com|
00000300  70 61 72 65 20 79 6f 75  72 20 72 65 73 75 6c 74  |pare your result|
00000310  73 20 74 6f 20 74 68 61  74 20 69 6e 20 74 68 65  |s to that in the|
00000320  20 73 75 62 72 6f 75 74  73 31 20 66 69 6c 65 2e  | subrouts1 file.|
00000330  0a                                                |.|
00000331