Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!nbires!hao!noao!mcdsun!fnf From: fnf@mcdsun.UUCP Newsgroups: net.sources Subject: Portable Math Library in C (Part 0 of 6) Message-ID: <288@mcdsun.UUCP> Date: Fri, 10-Apr-87 18:38:11 EST Article-I.D.: mcdsun.288 Posted: Fri Apr 10 18:38:11 1987 Date-Received: Sun, 12-Apr-87 05:46:48 EST Organization: Motorola Microcomputer Division, Tempe, Az. Lines: 185 Keywords: math library This is a portable math library written entirely in C. Since it has been several years since I had any interest in doing any more work on it, and people may find it useful, I have decided to post it. There should be a lead-in posting (part 0 of 6?) containing a README file and commands to make the directories for the regular parts 1-6. Be sure to read the README file in 'part 0'. -Fred Fish =============== Cut here and feed to the shell ======================== #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh README <<'END_OF_README' X XThe original version of pml (Portable Math Library) was written several Xyears ago, when I was just learning C and trying to switch most of my work Xfor engineering classes from Fortran to C. I quickly ran into problems Xwith portability, missing functions, compiler bugs, etc, etc, etc. XConsidering I was using some pretty primitive stuff at the time, it's a Xwonder anything worked! Anyway, pml came about from pressures to get Xsomething that would work in a number of environments and also as a learning Xtool as to how floating point libraries worked. I don't claim to be a Xnumerical analyst, then or now, but I did learn a lot writing this stuff X(including how to write in C). X XSeveral times I have started to go back and redo the library to use Xnewer C features, make it compatible with the Unix version, etc. For Xexample, the original C compilers I had access to could not pass structures, Xjust pointers to structures, which made for some pretty ugly code. Changing Xthe code to pass a 'complex' structure cleaned it up a lot. Given Xseveral aborted attempts to redo the whole thing (aborted due to lack Xof motivation and/or time), it's now in somewhat of a mess, and probably Xinconsistent in several areas. Still, someone might find it useful, or Xeven be motivated enough to carry on with it, given this code as a base. X XSo, in the hopes that someone will 'adopt' pml, and make it their pet, XI've decided to post my most current code, and relinquish all rights to Xit. I.E., make it truly public domain, rather than simply freely Xredistributable. X XHints for adoptive parents: X X 1. Much of the documentation and internal comments X is now either wrong, misleading, or both. Beware. X X 2. Most C functions use pieces from various iterations X of my macro based debugging package. For example, X the LEAVE() macro hasn't been used directly in years... X You should either chuck this stuff wholesale, or X convert it to use my latest version (posted on the X net some months ago). X X 3. The implementation of functions like 'inverse complex X hyperbolic arccosine' may very well be numerically X naive. X X 4. This is your baby now, don't ask me how to change its X diapers. I wouldn't mind getting pictures now and then X though. :-) :-) X XBelow is the original README file, for reference. X X Fred Fish X 10-Apr-87 X X====================================================================== X XPML --- Portable Math Library for C programs. X XThis directory contains the PML math library distribution. XSince it is intended to be a highly portable library, useful Xon a wide variety of machines, no installation command files Xare provided. It is assumed that the installer is sufficiently Xknowledgeable to successfully install the library given the Xfollowing general guidelines: X X(1) The constants in "pml.h" must be suitably defined for X the environment in which the library is to be used. X X(2) The appropriate environment #define variable is X defined somewhere, either within the preprocessor X itself, in , is added to "pml.h", or X is included on the compiler invocation command X line. X X For example, "#define PDP10" or "#define pdp11". X X(3) The file "pmluser.h" is moved to the global header X file directory, so that an "#include " X will be properly processed. X X(4) All of the library source files are compiled. X X(5) The furnished test routines are compiled, linked X with the library routines, and executed. X XThis library currently runs essentially unchanged on a wide Xvariety of machines, under a wide variety of operating systems. XKnown installations include PDP-11s running RSX-11M and using Xthe DECUS C system, DECSYSTEM-20 running TOPS-20 using an XMIT C compiler, Callan Data Systems 68000 system running XUniplus (Unix port from Unisoft), and an IBM Personal XComputer running PC-DOS using a CII C compiler. If you Xknow of any others, please let me know. X X Fred Fish X END_OF_README if test 3902 -ne `wc -c