Archive: forth/complex

Up to parent directory

complex number word sets
complex.fs 18Aug09 13:06:35EDT 22K A revision of Julian V. Noble's complex arithmetic lexicon, with OpenMath principal expressions for inverse functions. Included in the FSL as Algorithm #60.
complex-kahan.fs 18Aug09 12:35:33EDT 33K Another revision that uses William Kahan's extended accuracy algorithms.
complex-kahan.log 18Aug09 13:07:48EDT 4.9K Change log for complex-kahan.fs.
complex.seq 19Feb03 14:42:46EST 7.8K The basic complex arithmetic lexicon from the Forth Scientific Library.
zabs.seq 19Feb03 14:42:50EST 6.2K A subset of complex.seq modified for testing zabs with the celefunt port in zabs.fs below.

tests
complex-test.fs 18Aug09 12:17:19EDT 26K Formal correctness tests for complex.fs and complex-kahan.fs, and for a pfe primitive port of the lexicon. Uses ttester.fs. Included as an auxiliary file in the FSL.
complex-ieee-test.fs 18Aug09 12:13:27EDT 28K Additional tests for IEEE 754 signed zero, signed infinity, and NaN properties of the complex functions, including the evaluation of functions having principal branches on either side of their cuts, by using appropriate real or imaginary, signed zero arguments. Uses ttester.fs
ftester.fs 24Apr05 19:26:40EDT 5.7K Obsolete, functionality absorbed into ttester.

ports of celefunt tests

The following complex function accuracy tests are ported from W. J. Cody's celefunt Fortran package. They all require machar.fs and ren.fs from the next section, and all but zabs.fs require zfunstat.fs as well. In the style of the JVN lexicon, we call the port zelefunt.

These are not intended as models of Forth code; they are fairly literal translations from Fortran, aimed at allowing exact comparison of the Fortran and Forth results. This especially applies to the random number generator ren.fs. Cody asserts that its algorithm is good enough for this purpose, while acknowledging its crudeness.
zabs.fs 19Jan05 17:40:37EST 8.9K
zexp.fs 19Jan05 17:41:05EST 5.7K
zln.fs 19Jan05 17:41:16EST 4.5K
zpow.fs 19Jan05 17:41:30EST 5.6K
zsincos.fs 19Jan05 17:42:53EST 7.1K
zsqrt.fs 19Jan05 17:41:59EST 4.1K
zabs-results.txt 19Jan05 17:40:42EST 3.1K
zexp-results.txt 19Jan05 17:40:57EST 7.8K
zln-results.txt 19Jan05 17:41:11EST 6.8K
zpow-results.txt 19Jan05 17:41:25EST 6.8K
zsincos-results.txt 19Jan05 17:41:45EST 6.7K
zsqrt-results.txt 19Jan05 17:41:55EST 3.8K

ports of celefunt subprograms
machar.fs 09Mar05 08:44:50EST 15K
ren.fs 04Dec04 10:17:52EST 1.6K
zfunstat.fs 19Jan05 17:40:06EST 13K

Borda's mouthpiece

William Kahan uses Borda's mouthpiece as an example where the proper treatment of signed zero makes a dramatic difference. See the plots in his article on The Baleful Effect of Computer Benchmarks. The files below verify correctness for the same example with any of complex.fs, complex-kahan.fs, or the pfe primitive port of the complex lexicon, and incorrectness with a g77 version of Fortran.
borda.html 04Feb05 15:13:00EST 2.5K The plots.
borda.pdf 11Jan09 09:56:54EST 45K The plots as pdf.
borda.fs 11Jan09 08:58:32EST 6.7K ANSForth source for the plot data.
borda.tar.gz 11Jan09 09:57:30EST 51K An archive containing the above two files, Fortran source, and the LaTeX/PSTricks source for borda.pdf, with the UPDL license.

links

Up to top of archive

Files in this directory under the GNU LGPL typically have a POLITENESS request.