fnf@mcdsun.UUCP (04/30/87)
It appears that Part 1 of 6 of the pml posting was truncated or lost because it exceeded 64000 characters; *NOT* 64K (???). Anyway, I've split the contents up into two postings, Part 1a and Part 1b. #! /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 <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 1 (of 1)." # Contents: doc doc/trlr.r funcs funcs/doc funcs/doc/funcs.r # funcs/environ funcs/environ/Makefile funcs/environ/testfrexp.in # funcs/environ/testfrexp.out funcs/environ/testldexp.in # funcs/environ/testldexp.out funcs/environ/testmodf.in # funcs/environ/testmodf.out funcs/src funcs/src/Makefile # funcs/src/cabs.c funcs/src/cadd.c funcs/src/casin.c # funcs/src/catan.c funcs/src/ccos.c funcs/src/ccosh.c # funcs/src/cexp.c funcs/src/clog.c funcs/src/crcp.c # funcs/src/csin.c funcs/src/csinh.c funcs/unused tests tests/unused # Wrapped by fnf@mcdsun on Wed Apr 29 14:02:08 1987 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test ! -d doc ; then echo shar: Creating directory \"doc\" mkdir doc fi if test -f doc/trlr.r -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"doc/trlr.r\" else echo shar: Extracting \"doc/trlr.r\" \(376 characters\) sed "s/^X//" >doc/trlr.r <<'END_OF_doc/trlr.r' X.bp X.ce XREFERENCES X.sp 3 X.nf XP. A. Fox, A. D. Hall, and N. L. Schryer, XThe PORT Mathematical Subroutine Library, XACM Transactions on Mathematical Software, XVol 4, No. 2, June 1978, pp 104-126. X.sp 3 XBrian Ford, XParameterization of the Environment for Transportable Numerical Software, XACM Transactions on Mathematical Software, XVol 4, No. 2, June 1978, pp 100-103. X X.bp X.xp X X END_OF_doc/trlr.r if test 376 -ne `wc -c <doc/trlr.r`; then echo shar: \"doc/trlr.r\" unpacked with wrong size! fi # end of overwriting check fi if test ! -d funcs ; then echo shar: Creating directory \"funcs\" mkdir funcs fi if test ! -d funcs/doc ; then echo shar: Creating directory \"funcs/doc\" mkdir funcs/doc fi if test -f funcs/doc/funcs.r -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/doc/funcs.r\" else echo shar: Extracting \"funcs/doc/funcs.r\" \(460 characters\) sed "s/^X//" >funcs/doc/funcs.r <<'END_OF_funcs/doc/funcs.r' X.he '\*(td''abs' X.bp X.fo ''- % -'' X.sh 2 "abs double precision absolute value" X.sp 3 X.ce X******* X.ce X* abs * X.ce X******* X.sp 3 X.(x Xabs X.)x X.(x Xmachine independent routines X.)x X.(x Xmath libraries X.)x X.ul 1 XDESCRIPTION X.sp 1 X.in 8 XReturns absolute value of double precision number. X.sp 1 X.in 0 X.ul 1 XUSAGE X.sp 1 X.nf X.in 8 Xdouble abs(x) Xdouble x; X.sp 1 X.in 0 X.ul 1 XPROGRAMMER X.sp 1 X.in 8 XFred Fish XEngineering Software Tools XP.O. Box 2035 XTempe, Az 85281 X.sp 1 END_OF_funcs/doc/funcs.r if test 460 -ne `wc -c <funcs/doc/funcs.r`; then echo shar: \"funcs/doc/funcs.r\" unpacked with wrong size! fi # end of overwriting check fi if test ! -d funcs/environ ; then echo shar: Creating directory \"funcs/environ\" mkdir funcs/environ fi if test -f funcs/environ/Makefile -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/environ/Makefile\" else echo shar: Extracting \"funcs/environ/Makefile\" \(216 characters\) sed "s/^X//" >funcs/environ/Makefile <<'END_OF_funcs/environ/Makefile' Xall : testfrexp testldexp testmodf X Xtestfrexp : testfrexp.c X cc -o testfrexp testfrexp.c -lm X Xtestldexp : testldexp.c X cc -o testldexp testldexp.c -lm X Xtestmodf : testmodf.c X cc -o testmodf testmodf.c -lm END_OF_funcs/environ/Makefile if test 216 -ne `wc -c <funcs/environ/Makefile`; then echo shar: \"funcs/environ/Makefile\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/environ/testfrexp.in -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/environ/testfrexp.in\" else echo shar: Extracting \"funcs/environ/testfrexp.in\" \(283 characters\) sed "s/^X//" >funcs/environ/testfrexp.in <<'END_OF_funcs/environ/testfrexp.in' X0.000000e+00 X1.000000e+00 X2.000000e+00 X4.000000e+00 X8.000000e+00 X2.560000e+02 X3.276800e+04 X-1.000000e+00 X-2.000000e+00 X-4.000000e+00 X-8.000000e+00 X-2.560000e+02 X-3.276800e+04 X1.234500e+00 X1.234500e+10 X3.456700e+20 X3.456700e-05 X-1.234500e+00 X-1.234500e+10 X-3.456700e+20 X-3.456700e-05 END_OF_funcs/environ/testfrexp.in if test 283 -ne `wc -c <funcs/environ/testfrexp.in`; then echo shar: \"funcs/environ/testfrexp.in\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/environ/testfrexp.out -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/environ/testfrexp.out\" else echo shar: Extracting \"funcs/environ/testfrexp.out\" \(339 characters\) sed "s/^X//" >funcs/environ/testfrexp.out <<'END_OF_funcs/environ/testfrexp.out' X0.000000e+00 -1021 X5.000000e-01 1 X5.000000e-01 2 X5.000000e-01 3 X5.000000e-01 4 X5.000000e-01 9 X5.000000e-01 16 X-5.000000e-01 1 X-5.000000e-01 2 X-5.000000e-01 3 X-5.000000e-01 4 X-5.000000e-01 9 X-5.000000e-01 16 X6.172500e-01 1 X7.185736e-01 34 X5.855878e-01 69 X5.663457e-01 -14 X-6.172500e-01 1 X-7.185736e-01 34 X-5.855878e-01 69 X-5.663457e-01 -14 END_OF_funcs/environ/testfrexp.out if test 339 -ne `wc -c <funcs/environ/testfrexp.out`; then echo shar: \"funcs/environ/testfrexp.out\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/environ/testldexp.in -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/environ/testldexp.in\" else echo shar: Extracting \"funcs/environ/testldexp.in\" \(339 characters\) sed "s/^X//" >funcs/environ/testldexp.in <<'END_OF_funcs/environ/testldexp.in' X0.000000e+00 -1021 X5.000000e-01 1 X5.000000e-01 2 X5.000000e-01 3 X5.000000e-01 4 X5.000000e-01 9 X5.000000e-01 16 X-5.000000e-01 1 X-5.000000e-01 2 X-5.000000e-01 3 X-5.000000e-01 4 X-5.000000e-01 9 X-5.000000e-01 16 X6.172500e-01 1 X7.185736e-01 34 X5.855878e-01 69 X5.663457e-01 -14 X-6.172500e-01 1 X-7.185736e-01 34 X-5.855878e-01 69 X-5.663457e-01 -14 END_OF_funcs/environ/testldexp.in if test 339 -ne `wc -c <funcs/environ/testldexp.in`; then echo shar: \"funcs/environ/testldexp.in\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/environ/testldexp.out -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/environ/testldexp.out\" else echo shar: Extracting \"funcs/environ/testldexp.out\" \(283 characters\) sed "s/^X//" >funcs/environ/testldexp.out <<'END_OF_funcs/environ/testldexp.out' X0.000000e+00 X1.000000e+00 X2.000000e+00 X4.000000e+00 X8.000000e+00 X2.560000e+02 X3.276800e+04 X-1.000000e+00 X-2.000000e+00 X-4.000000e+00 X-8.000000e+00 X-2.560000e+02 X-3.276800e+04 X1.234500e+00 X1.234500e+10 X3.456700e+20 X3.456700e-05 X-1.234500e+00 X-1.234500e+10 X-3.456700e+20 X-3.456700e-05 END_OF_funcs/environ/testldexp.out if test 283 -ne `wc -c <funcs/environ/testldexp.out`; then echo shar: \"funcs/environ/testldexp.out\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/environ/testmodf.in -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/environ/testmodf.in\" else echo shar: Extracting \"funcs/environ/testmodf.in\" \(283 characters\) sed "s/^X//" >funcs/environ/testmodf.in <<'END_OF_funcs/environ/testmodf.in' X0.000000e+00 X1.000000e+00 X2.000000e+00 X4.000000e+00 X8.000000e+00 X2.560000e+02 X3.276800e+04 X-1.000000e+00 X-2.000000e+00 X-4.000000e+00 X-8.000000e+00 X-2.560000e+02 X-3.276800e+04 X1.234500e+00 X1.234500e+10 X3.456700e+20 X3.456700e-05 X-1.234500e+00 X-1.234500e+10 X-3.456700e+20 X-3.456700e-05 END_OF_funcs/environ/testmodf.in if test 283 -ne `wc -c <funcs/environ/testmodf.in`; then echo shar: \"funcs/environ/testmodf.in\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/environ/testmodf.out -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/environ/testmodf.out\" else echo shar: Extracting \"funcs/environ/testmodf.out\" \(557 characters\) sed "s/^X//" >funcs/environ/testmodf.out <<'END_OF_funcs/environ/testmodf.out' X0.000000e+00 0.000000e+00 X0.000000e+00 1.000000e+00 X0.000000e+00 2.000000e+00 X0.000000e+00 4.000000e+00 X0.000000e+00 8.000000e+00 X0.000000e+00 2.560000e+02 X0.000000e+00 3.276800e+04 X0.000000e+00 -1.000000e+00 X0.000000e+00 -2.000000e+00 X0.000000e+00 -4.000000e+00 X0.000000e+00 -8.000000e+00 X0.000000e+00 -2.560000e+02 X0.000000e+00 -3.276800e+04 X2.345000e-01 1.000000e+00 X0.000000e+00 1.234500e+10 X0.000000e+00 3.456700e+20 X3.456700e-05 0.000000e+00 X-2.345000e-01 -1.000000e+00 X0.000000e+00 -1.234500e+10 X0.000000e+00 -3.456700e+20 X-3.456700e-05 0.000000e+00 END_OF_funcs/environ/testmodf.out if test 557 -ne `wc -c <funcs/environ/testmodf.out`; then echo shar: \"funcs/environ/testmodf.out\" unpacked with wrong size! fi # end of overwriting check fi if test ! -d funcs/src ; then echo shar: Creating directory \"funcs/src\" mkdir funcs/src fi if test -f funcs/src/Makefile -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/Makefile\" else echo shar: Extracting \"funcs/src/Makefile\" \(1358 characters\) sed "s/^X//" >funcs/src/Makefile <<'END_OF_funcs/src/Makefile' X# X# FILE X# X# Makefile build and install the pml library X# X# SYNOPSIS X# X# make funcs make version of library in local directory X# make install install the library (must be root) X# X# WARNING X# X# The order of the modules listed in the "LEVEL<n>" macros X# is significant since these are the orders in which X# they will be loaded into the library archive. Although X# some machines support randomly ordered libraries, ordering X# them correctly doesn't hurt... X XLIB = /usr/lib X XINC = /usr/include X XCFLAGS = -O -DIEEE X XLEVEL0 = ldexp.o frexp.o modf.o matherr.o X XLEVEL1 = sign.o mod.o poly.o dabs.o sqrt.o X XLEVEL2 = acos.o acosh.o asin.o asinh.o atan2.o atan.o \ X log10.o tan.o \ X tanh.o sinh.o cosh.o atanh.o \ X log.o sin.o cos.o exp.o max.o min.o X XLEVEL3 = casin.o cacos.o cmult.o catan.o ccosh.o clog.o \ X crcp.o csinh.o csqrt.o ctan.o ctanh.o cexp.o \ X ccos.o csin.o cdiv.o csubt.o cabs.o X XLEVEL4 = cadd.o X XOBJ = $(LEVEL4) $(LEVEL3) $(LEVEL2) $(LEVEL1) X X# X# The default thing to make. X# X Xdefault: libpml.a X Xlibpml.a: $(OBJ) X ar cr libpml.a $(OBJ) X X$(OBJ) : pml.h X X# X# Stuff to do installation X# X Xinstall : $(LIB)/libpml.a $(INC)/pmluser.h X X$(LIB)/libpml.a: libpml.a X cp libpml.a $(LIB)/libpml.a X X$(INC)/pmluser.h : pmluser.h X cp pmluser.h $(INC)/pmluser.h X X# X# Clean up the directory. X# X Xclean: X rm -f *.o *.BAK libpml.a *.tmp *.bak nohup.out END_OF_funcs/src/Makefile if test 1358 -ne `wc -c <funcs/src/Makefile`; then echo shar: \"funcs/src/Makefile\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/cabs.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/cabs.c\" else echo shar: Extracting \"funcs/src/cabs.c\" \(1722 characters\) sed "s/^X//" >funcs/src/cabs.c <<'END_OF_funcs/src/cabs.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * cabs double precision complex absolute value X * X * KEY WORDS X * X * cabs X * complex functions X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Computes double precision absolute value of a double X * precision complex argument, where "absolute value" X * is taken to mean magnitude. The result replaces the X * argument. X * X * USAGE X * X * double cabs (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az X * X * INTERNALS X * X * Computes cabs (z) where z = (x) + j(y) from: X * X * cabs (z) = sqrt (x*x + y*y) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X Xdouble cabs (z) XCOMPLEX z; X{ X double result; X extern double sqrt (); X X ENTER ("cabs"); X DEBUG4 ("cabsin", "arg %le +j %le", z.real, z.imag); X result = sqrt ((z.real * z.real) + (z.imag * z.imag)); X DEBUG3 ("cabsout", "result %le", result); X LEAVE (); X return (result); X} END_OF_funcs/src/cabs.c if test 1722 -ne `wc -c <funcs/src/cabs.c`; then echo shar: \"funcs/src/cabs.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/cadd.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/cadd.c\" else echo shar: Extracting \"funcs/src/cadd.c\" \(1820 characters\) sed "s/^X//" >funcs/src/cadd.c <<'END_OF_funcs/src/cadd.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * cadd double precision complex addition X * X * KEY WORDS X * X * cadd X * complex functions X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex result of addition of X * first double precision complex argument with second double X * precision complex argument. X * X * Note that the complex addition function is X * so simple that it would not normally be called as a function X * but simply done "inline". It is supplied mostly for X * completeness. X * X * USAGE X * X * COMPLEX cadd (z1, z2) X * COMPLEX z1; X * COMPLEX z2; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes cadd(z1,z2) from: X * X * 1. Let z1 = a + j b X * Let z2 = c + j d X * X * 2. Then cadd(z1,z2) = (a + c) + j (b + d) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX cadd (z1, z2) XCOMPLEX z1; XCOMPLEX z2; X{ X ENTER ("cadd"); X z1.real += z2.real; X z1.imag += z2.imag; X LEAVE (); X return (z1); X} END_OF_funcs/src/cadd.c if test 1820 -ne `wc -c <funcs/src/cadd.c`; then echo shar: \"funcs/src/cadd.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/casin.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/casin.c\" else echo shar: Extracting \"funcs/src/casin.c\" \(1876 characters\) sed "s/^X//" >funcs/src/casin.c <<'END_OF_funcs/src/casin.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * casin complex double precision arc sine X * X * KEY WORDS X * X * casin X * machine independent routines X * complex functions X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex arc sine of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX casin (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex arc sine of z = x + j y from: X * X * casin(z) = -j * clog(csqrt(1-z*z) + j*z) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX casin (z) XCOMPLEX z; X{ X COMPLEX temp; X extern COMPLEX csqrt (), clog (), cmult (); X X ENTER ("casin"); X DEBUG4 ("casinin", "arg %le %le", z.real, z.imag); X temp = cmult (z, z); X temp.real = 1.0 - temp.real; X temp.imag = -temp.imag; X temp = csqrt (temp); X temp.real -= z.imag; X temp.imag += z.real; X temp = clog (temp); X z.real = temp.imag; X z.imag = -temp.real; X DEBUG4 ("casinout", "result %le %le", z.real, z.imag); X LEAVE (); X return (z); X} END_OF_funcs/src/casin.c if test 1876 -ne `wc -c <funcs/src/casin.c`; then echo shar: \"funcs/src/casin.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/catan.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/catan.c\" else echo shar: Extracting \"funcs/src/catan.c\" \(1857 characters\) sed "s/^X//" >funcs/src/catan.c <<'END_OF_funcs/src/catan.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * catan complex double precision arc tangent X * X * KEY WORDS X * X * catan X * machine independent routines X * complex functions X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex arc tangent of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX catan (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex arc tangent of z = x + j y from: X * X * catan(z) = -j/2 * clog( (j+z) / (j-z) ) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX catan (z) XCOMPLEX z; X{ X COMPLEX temp; X double swaptemp; X extern COMPLEX cdiv (), clog (); X X ENTER ("catan"); X DEBUG4 ("catanin", "arg %le %le", z.real, z.imag); X temp.real = -z.real; X temp.imag = 1.0 - z.imag; X z.imag += 1.0; X z = cdiv (z, temp); X z = clog (z); X swaptemp = z.real; X z.real = -0.5 * z.imag; X z.imag = 0.5 * swaptemp; X DEBUG4 ("catanout", "result %le %le", z.real, z.imag); X LEAVE (); X return (z); X} END_OF_funcs/src/catan.c if test 1857 -ne `wc -c <funcs/src/catan.c`; then echo shar: \"funcs/src/catan.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/ccos.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/ccos.c\" else echo shar: Extracting \"funcs/src/ccos.c\" \(1881 characters\) sed "s/^X//" >funcs/src/ccos.c <<'END_OF_funcs/src/ccos.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * ccos complex double precision cosine X * X * KEY WORDS X * X * ccos X * complex functions X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex cosine of a double X * precision complex argument. X * X * USAGE X * X * COMPLEX ccos (z) X * COMPLEX z; X * X * REFERENCES X * X * Fortran 77 user's guide, Digital Equipment Corp. pp B-12 X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex cosine of z = x + j y from: X * X * 1. r_ccos = cos(x) * cosh(y) X * X * 2. i_ccos = -sin(x) * sinh(y) X * X * 3. ccos(z) = r_ccos + j i_ccos X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX ccos (z) XCOMPLEX z; X{ X COMPLEX result; X extern double sin(), cos(), sinh(), cosh(); X X ENTER ("ccos"); X DEBUG4 ("ccosin", "arg %le %le", z.real, z.imag); X result.real = cos(z.real) * cosh(z.imag); X result.imag = -sin(z.real) * sinh(z.imag); X DEBUG4 ("ccosout", "result %le %le", result.real, result.imag); X LEAVE (); X return (result); X} END_OF_funcs/src/ccos.c if test 1881 -ne `wc -c <funcs/src/ccos.c`; then echo shar: \"funcs/src/ccos.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/ccosh.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/ccosh.c\" else echo shar: Extracting \"funcs/src/ccosh.c\" \(1842 characters\) sed "s/^X//" >funcs/src/ccosh.c <<'END_OF_funcs/src/ccosh.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * ccosh complex double precision hyperbolic cosine X * X * KEY WORDS X * X * ccosh X * machine independent routines X * complex functions X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex hyperbolic cosine of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX ccosh (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex hyperbolic cosine of Z = x + j y from: X * X * ccosh(z) = 0.5 * ( cexp(z) + cexp(-z) ) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX ccosh (z) XCOMPLEX z; X{ X COMPLEX cexpmz; X extern COMPLEX cexp (); X X ENTER ("ccosh"); X DEBUG4 ("ccoshin", "arg %le %le", z.real, z.imag); X cexpmz.real = -z.real; X cexpmz.imag = -z.imag; X cexpmz = cexp (cexpmz); X z = cexp (z); X z.real += cexpmz.real; X z.imag += cexpmz.imag; X z.real *= 0.5; X z.imag *= 0.5; X DEBUG4 ("ccoshout", "result %le %le", z.real, z.imag); X LEAVE (); X return (z); X} END_OF_funcs/src/ccosh.c if test 1842 -ne `wc -c <funcs/src/ccosh.c`; then echo shar: \"funcs/src/ccosh.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/cexp.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/cexp.c\" else echo shar: Extracting \"funcs/src/cexp.c\" \(1910 characters\) sed "s/^X//" >funcs/src/cexp.c <<'END_OF_funcs/src/cexp.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * cexp complex double precision exponential X * X * KEY WORDS X * X * cexp X * complex functions X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex exponential of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX cexp (z) X * COMPLEX z; X * X * REFERENCES X * X * Fortran 77 user's guide, Digital Equipment Corp. pp B-13 X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex exponential of z = x + j y from: X * X * 1. r_cexp = exp(x) * cos(y) X * X * 2. i_cexp = exp(x) * sin(y) X * X * 3. cexp(z) = r_cexp + j i_cexp X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX cexp (z) XCOMPLEX z; X{ X COMPLEX result; X double expx; X extern double exp(), sin(), cos(); X X ENTER ("cexp"); X DEBUG4 ("cexpin", "arg %le %le", z.real, z.imag); X expx = exp (z.real); X result.real = expx * cos (z.imag); X result.imag = expx * sin (z.imag); X DEBUG4 ("cexpout", "result %le %le", result.real, result.imag); X LEAVE (); X return (result); X} END_OF_funcs/src/cexp.c if test 1910 -ne `wc -c <funcs/src/cexp.c`; then echo shar: \"funcs/src/cexp.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/clog.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/clog.c\" else echo shar: Extracting \"funcs/src/clog.c\" \(1870 characters\) sed "s/^X//" >funcs/src/clog.c <<'END_OF_funcs/src/clog.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * clog complex double precision natural logarithm X * X * KEY WORDS X * X * clog X * complex functions X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex natural logarithm of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX clog (z) X * COMPLEX z; X * X * REFERENCES X * X * Fortran 77 user's guide, Digital Equipment Corp. pp B-13 X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex natural logarithm of z = x + j y from: X * X * 1. r_clog = log(cabs(z)) X * X * 2. i_clog = atan2(x,y) X * X * 3. clog(z) = r_clog + j i_clog X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX clog (z) XCOMPLEX z; X{ X double temp; X extern double cabs (), atan2(), log (); X X ENTER ("clog"); X DEBUG4 ("clogin", "arg %le %le", z.real, z.imag); X temp = log (cabs (z)); X z.imag = atan2 (z.real, z.imag); X z.real = temp; X DEBUG4 ("clogout", "result %le %le", z.real, z.imag); X LEAVE (); X return (z); X} END_OF_funcs/src/clog.c if test 1870 -ne `wc -c <funcs/src/clog.c`; then echo shar: \"funcs/src/clog.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/crcp.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/crcp.c\" else echo shar: Extracting \"funcs/src/crcp.c\" \(1919 characters\) sed "s/^X//" >funcs/src/crcp.c <<'END_OF_funcs/src/crcp.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * crcp complex double precision reciprocal X * X * KEY WORDS X * X * crcp X * complex functions X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex reciprocal of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX crcp (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex reciprocal of z = x + j y from: X * X * 1. Compute denom = x*x + y*y X * X * 2. If denom = 0.0 then flag error X * and return MAX_POS_DBLF + j 0.0 X * X * 3. Else crcp(z) = (x/denom) + j (-y/denom) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX crcp (z) XCOMPLEX z; X{ X double denom; X X ENTER ("crcp"); X DEBUG4 ("crcpin", "arg %le %le", z.real, z.imag); X denom = (z.real * z.real) + (z.imag * z.imag); X if (denom == 0.0) { X/***** X pmlerr(CRCP_OF_ZERO); X z.real = MAX_POS_DBLF; X******/ X z.real = 0.0; /* TERRIBLY WRONG */ X z.imag = 0.0; X } else { X z.real /= denom; X z.imag /= -denom; X } X DEBUG4 ("crcpout", "result %le %le", z.real, z.imag); X LEAVE (); X return (z); X} END_OF_funcs/src/crcp.c if test 1919 -ne `wc -c <funcs/src/crcp.c`; then echo shar: \"funcs/src/crcp.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/csin.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/csin.c\" else echo shar: Extracting \"funcs/src/csin.c\" \(1876 characters\) sed "s/^X//" >funcs/src/csin.c <<'END_OF_funcs/src/csin.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * csin complex double precision sine X * X * KEY WORDS X * X * csin X * complex functions X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex sine of a double X * precision complex argument. X * X * USAGE X * X * COMPLEX csin (z) X * COMPLEX z; X * X * REFERENCES X * X * Fortran 77 user's guide, Digital Equipment Corp. pp B-12 X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex sine of z = x + j y from: X * X * 1. r_csin = sin(x) * cosh(y) X * X * 2. i_csin = cos(x) * sinh(y) X * X * 3. csin(z) = r_csin + j i_csin X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX csin (z) XCOMPLEX z; X{ X COMPLEX result; X extern double sin(), cos(), sinh(), cosh(); X X ENTER ("csin"); X DEBUG4 ("csinin", "arg %le %le", z.real, z.imag); X result.real = sin (z.real) * cosh (z.imag); X result.imag = cos (z.real) * sinh (z.imag); X DEBUG4 ("csinout", "result %le %le", result.real, result.imag); X LEAVE (); X return (result); X} END_OF_funcs/src/csin.c if test 1876 -ne `wc -c <funcs/src/csin.c`; then echo shar: \"funcs/src/csin.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/csinh.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/csinh.c\" else echo shar: Extracting \"funcs/src/csinh.c\" \(1836 characters\) sed "s/^X//" >funcs/src/csinh.c <<'END_OF_funcs/src/csinh.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * csinh complex double precision hyperbolic sine X * X * KEY WORDS X * X * csinh X * machine independent routines X * complex functions X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex hyperbolic sine of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX csinh (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex hyperbolic sine of z = x + j y from: X * X * csinh(z) = 0.5 * ( cexp(z) - cexp(-z) ) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX csinh (z) XCOMPLEX z; X{ X COMPLEX cexpmz; X extern COMPLEX cexp (); X X ENTER ("csinh"); X DEBUG4 ("csinhin", "arg %le %le", z.real, z.imag); X cexpmz.real = -z.real; X cexpmz.imag = -z.imag; X cexpmz = cexp (cexpmz); X z = cexp (z); X z.real -= cexpmz.real; X z.imag -= cexpmz.imag; X z.real *= 0.5; X z.imag *= 0.5; X DEBUG4 ("csinhout", "result %le %le", z.real, z.imag); X LEAVE (); X return (z); X} END_OF_funcs/src/csinh.c if test 1836 -ne `wc -c <funcs/src/csinh.c`; then echo shar: \"funcs/src/csinh.c\" unpacked with wrong size! fi # end of overwriting check fi if test ! -d funcs/unused ; then echo shar: Creating directory \"funcs/unused\" mkdir funcs/unused fi if test ! -d tests ; then echo shar: Creating directory \"tests\" mkdir tests fi if test ! -d tests/unused ; then echo shar: Creating directory \"tests/unused\" mkdir tests/unused fi echo shar: End of archive 1 \(of 1\). cp /dev/null ark1isdone MISSING="" for I in 1 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 1 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- = Drug tests; just say *NO*! (Moto just announced new drug testing program) = = Fred Fish Motorola Computer Division, 3013 S 52nd St, Tempe, Az 85282 USA = = seismo!noao!mcdsun!fnf (602) 438-5976 =
fnf@mcdsun.UUCP (04/30/87)
It appears that Part 1 of 6 of the pml posting was truncated or lost because it exceeded 64000 characters; *NOT* 64K (???). Anyway, I've split the contents up into two postings, Part 1a and Part 1b. #! /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 <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 1 (of 1)." # Contents: funcs/src/ctan.c funcs/src/ctanh.c funcs/src/dabs.c # funcs/src/log10.c funcs/src/matherr.c funcs/src/max.c # funcs/src/min.c funcs/src/mod.c funcs/src/pmluser.h # funcs/src/sign.c funcs/unused/frac.c tests/Makefile tests/c2d.dat # tests/dd2d.dat tests/unused/d2i.dat tests/unused/di2d.dat # Wrapped by fnf@mcdsun on Wed Apr 29 14:02:35 1987 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f funcs/src/ctan.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/ctan.c\" else echo shar: Extracting \"funcs/src/ctan.c\" \(1942 characters\) sed "s/^X//" >funcs/src/ctan.c <<'END_OF_funcs/src/ctan.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * ctan complex double precision tangent X * X * KEY WORDS X * X * ctan X * complex functions X * machine independent functions X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex tangent of a double X * precision complex argument. X * X * USAGE X * X * COMPLEX ctan (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex tangent of z = x + j y from: X * X * 1. Compute ccos(z) X * X * 2. If ccos(z) = 0 + j0 then the X * result is MAX_POS_DBLF + j0 X * X * 3. Else ctan(z) = csin(z) / ccos(z) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX ctan (z) XCOMPLEX z; X{ X COMPLEX ccosz; X extern COMPLEX ccos (), csin (), cdiv (); X X ENTER ("ctan"); X DEBUG4 ("ctanin", "arg %le %le", z.real, z.imag); X ccosz = ccos (z); X if (ccosz.real == 0.0 && ccosz.imag == 0.0) { X/***** X z.real = MAX_POS_DBLF; X******/ X z.real = 0.0; /* TERRIBLY WRONG! */ X z.imag = 0.0; X } else { X z = csin (z); X z = cdiv (z, ccosz); X } X DEBUG4 ("ctanout", "result %le %le", z.real, z.imag); X LEAVE (); X return (z); X} END_OF_funcs/src/ctan.c if test 1942 -ne `wc -c <funcs/src/ctan.c`; then echo shar: \"funcs/src/ctan.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/ctanh.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/ctanh.c\" else echo shar: Extracting \"funcs/src/ctanh.c\" \(1898 characters\) sed "s/^X//" >funcs/src/ctanh.c <<'END_OF_funcs/src/ctanh.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * ctanh complex double precision hyperbolic tangent X * X * KEY WORDS X * X * ctanh X * complex functions X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Computes double precision complex hyperbolic tangent of X * a double precision complex argument. X * X * USAGE X * X * COMPLEX ctanh (z) X * COMPLEX z; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X * INTERNALS X * X * Computes complex hyperbolic tangent of Z = x + j y from: X * X * ctanh(z) = (1 - cexp(-2z)) / (1 + cexp(-2z)) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X XCOMPLEX ctanh (z) XCOMPLEX z; X{ X COMPLEX result; X extern COMPLEX cexp (), cdiv (); X X ENTER ("ctanh"); X DEBUG4 ("ctanhin", "arg %le %le", z.real, z.imag); X result.real = -2.0 * z.real; X result.imag = -2.0 * z.imag; X result = cexp (result); X z.real = 1.0 - result.real; X z.imag = -result.imag; X result.real += 1.0; X result = cdiv (z, result); X DEBUG4 ("ctanhout", "result %le %le", result.real, result.imag); X LEAVE (); X return (result); X} END_OF_funcs/src/ctanh.c if test 1898 -ne `wc -c <funcs/src/ctanh.c`; then echo shar: \"funcs/src/ctanh.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/dabs.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/dabs.c\" else echo shar: Extracting \"funcs/src/dabs.c\" \(1653 characters\) sed "s/^X//" >funcs/src/dabs.c <<'END_OF_funcs/src/dabs.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * dabs,fabs double precision absolute value X * X * KEY WORDS X * X * dabs X * fabs X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Returns absolute value of double precision number. X * X * The fabs routine is supplied for compatibility with unix X * libraries where for some bizarre reason, the double precision X * absolute value routine is called fabs. X * X * USAGE X * X * double dabs (x) X * double x; X * X * double fabs (x) X * double x; X * X * PROGRAMMER X * X * Fred Fish X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X Xstatic char funcname[] = "dabs"; X X Xdouble dabs (x) Xdouble x; X{ X DBUG_ENTER (funcname); X DBUG_3 ("dabsin", "arg %le", x); X if (x < 0.0) { X x = -x; X } X DBUG_3 ("dabsout", "result %le", x); X DBUG_RETURN (x); X} X X Xdouble fabs (x) Xdouble x; X{ X return (dabs(x)); X} END_OF_funcs/src/dabs.c if test 1653 -ne `wc -c <funcs/src/dabs.c`; then echo shar: \"funcs/src/dabs.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/log10.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/log10.c\" else echo shar: Extracting \"funcs/src/log10.c\" \(1744 characters\) sed "s/^X//" >funcs/src/log10.c <<'END_OF_funcs/src/log10.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * log10 double precision common log X * X * KEY WORDS X * X * log10 X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Returns double precision common log of double precision X * floating point argument. X * X * USAGE X * X * double log10 (x) X * double x; X * X * REFERENCES X * X * PDP-11 Fortran IV-plus users guide, Digital Equip. Corp., X * 1975, pp. B-3. X * X * RESTRICTIONS X * X * For precision information refer to documentation of the X * floating point library routines called. X * X * PROGRAMMER X * X * Fred Fish X * X * INTERNALS X * X * Computes log10(x) from: X * X * log10(x) = log10(e) * log(x) X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X Xstatic char funcname[] = "log10"; X X Xdouble log10 (x) Xdouble x; X{ X extern double log (); X X DBUG_ENTER (funcname); X DBUG_3 ("log10in", "arg %le", x); X x = LOG10E * log (x); X DBUG_3 ("log10out", "result %le", x); X DBUG_RETURN (x); X} END_OF_funcs/src/log10.c if test 1744 -ne `wc -c <funcs/src/log10.c`; then echo shar: \"funcs/src/log10.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/matherr.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/matherr.c\" else echo shar: Extracting \"funcs/src/matherr.c\" \(1609 characters\) sed "s/^X//" >funcs/src/matherr.c <<'END_OF_funcs/src/matherr.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * matherr default math error handler function X * X * KEY WORDS X * X * error handler X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Default math error handler for the math library. This routine X * may be replaced by one of the user's own handlers. The default X * is to do nothing and returns zero. If the user wishes to supply X * the return value for the function, and to suppress default X * error handling by the function, his matherr routine must return X * non-zero. X * X * USAGE X * X * int matherr (xcpt) X * struct exception *xcpt; X * X * PROGRAMMER X * X * Fred Fish X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X Xstatic char funcname[] = "matherr"; X Xint matherr (xcpt) Xstruct exception *xcpt; X{ X DBUG_ENTER (funcname); X DBUG_RETURN (0); X} END_OF_funcs/src/matherr.c if test 1609 -ne `wc -c <funcs/src/matherr.c`; then echo shar: \"funcs/src/matherr.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/max.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/max.c\" else echo shar: Extracting \"funcs/src/max.c\" \(1411 characters\) sed "s/^X//" >funcs/src/max.c <<'END_OF_funcs/src/max.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * max double precision maximum of two arguments X * X * KEY WORDS X * X * max X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Returns maximum value of two double precision numbers. X * X * USAGE X * X * double max (x,y) X * double x; X * double y; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X Xdouble max (x, y) Xdouble x; Xdouble y; X{ X ENTER ("max"); X DEBUG4 ("maxin", "x = %le y = %le", x, y); X if (x < y) { X x = y; X } X DEBUG3 ("maxout", "result %le", x); X LEAVE (); X return (x); X} END_OF_funcs/src/max.c if test 1411 -ne `wc -c <funcs/src/max.c`; then echo shar: \"funcs/src/max.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/min.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/min.c\" else echo shar: Extracting \"funcs/src/min.c\" \(1412 characters\) sed "s/^X//" >funcs/src/min.c <<'END_OF_funcs/src/min.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * min double precision minimum of two arguments X * X * KEY WORDS X * X * min X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Returns minimum value of two double precision numbers. X * X * USAGE X * X * double min (x, y) X * double x; X * double y; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X Xdouble min (x, y) Xdouble x; Xdouble y; X{ X ENTER ("min"); X DEBUG4 ("minin", "x = %le y = %le", x, y); X if (x > y) { X x = y; X } X DEBUG3 ("minout", "result %le", x); X LEAVE (); X return (x); X} END_OF_funcs/src/min.c if test 1412 -ne `wc -c <funcs/src/min.c`; then echo shar: \"funcs/src/min.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/mod.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/mod.c\" else echo shar: Extracting \"funcs/src/mod.c\" \(1520 characters\) sed "s/^X//" >funcs/src/mod.c <<'END_OF_funcs/src/mod.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * mod double precision modulo X * X * KEY WORDS X * X * mod X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Returns double precision modulo of two double X * precision arguments. X * X * USAGE X * X * double mod (value, base) X * double value; X * double base; X * X * PROGRAMMER X * X * Fred Fish X * X */ X X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X Xdouble mod (value, base) Xdouble value; Xdouble base; X{ X auto double intpart; X extern double modf (); X X DBUG_ENTER ("mod"); X DBUG_4 ("modin", "args %le %le", value, base); X value /= base; X value = modf (value, &intpart); X value *= base; X DBUG_3 ("modout", "result %le", value); X DBUG_RETURN (value); X} END_OF_funcs/src/mod.c if test 1520 -ne `wc -c <funcs/src/mod.c`; then echo shar: \"funcs/src/mod.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/pmluser.h -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/pmluser.h\" else echo shar: Extracting \"funcs/src/pmluser.h\" \(1332 characters\) sed "s/^X//" >funcs/src/pmluser.h <<'END_OF_funcs/src/pmluser.h' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FILE X * X * pmluser.h include file for users of portable math library X * X * SYNOPSIS X * X * #include <pmluser.h> X * X * DESCRIPTION X * X * This file should be included in any user compilation module X * which accesses routines from the Portable Math Library (PML). X * X */ X X X/* X * Create the type "COMPLEX". This is an obvious extension that I X * hope becomes a part of standard C someday. X * X */ X Xtypedef struct cmplx { /* Complex structure */ X double real; /* Real part */ X double imag; /* Imaginary part */ X} COMPLEX; END_OF_funcs/src/pmluser.h if test 1332 -ne `wc -c <funcs/src/pmluser.h`; then echo shar: \"funcs/src/pmluser.h\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/src/sign.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/src/sign.c\" else echo shar: Extracting \"funcs/src/sign.c\" \(1580 characters\) sed "s/^X//" >funcs/src/sign.c <<'END_OF_funcs/src/sign.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X X/* X * FUNCTION X * X * sign transfer of sign X * X * KEY WORDS X * X * sign X * machine independent routines X * math libraries X * X * DESCRIPTION X * X * Returns first argument with same sign as second argument. X * X * USAGE X * X * double sign (x, y) X * double x; X * double y; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X Xdouble sign (x, y) Xdouble x; Xdouble y; X{ X double rtnval; X X ENTER ("sign"); X DEBUG4 ("signin", "args %le %le", x, y); X if (x > 0.0) { X if (y > 0.0) { X rtnval = x; X } else { X rtnval = -x; X } X } else { X if (y < 0.0) { X rtnval = x; X } else { X rtnval = -x; X } X } X DEBUG3 ("signout", "result %le", rtnval); X LEAVE (); X return (rtnval); X} END_OF_funcs/src/sign.c if test 1580 -ne `wc -c <funcs/src/sign.c`; then echo shar: \"funcs/src/sign.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f funcs/unused/frac.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"funcs/unused/frac.c\" else echo shar: Extracting \"funcs/unused/frac.c\" \(1305 characters\) sed "s/^X//" >funcs/unused/frac.c <<'END_OF_funcs/unused/frac.c' X/************************************************************************ X * * X * N O T I C E * X * * X * Copyright Abandoned, 1987, Fred Fish * X * * X * This previously copyrighted work has been placed into the * X * public domain by the author (Fred Fish) and may be freely used * X * for any purpose, private or commercial. I would appreciate * X * it, as a courtesy, if this notice is left in all copies and * X * derivative works. Thank you, and enjoy... * X * * X * The author makes no warranty of any kind with respect to this * X * product and explicitly disclaims any implied warranties of * X * merchantability or fitness for any particular purpose. * X * * X ************************************************************************ X */ X X/* X * FUNCTION X * X * frac double precision fractional portion X * X * KEY WORDS X * X * frac X * machine dependent routines X * math libraries X * X * DESCRIPTION X * X * Returns fractional portion of double precision number as double X * precision number. X * X * USAGE X * X * double frac(x) X * double x; X * X * PROGRAMMER X * X * Fred Fish X * Tempe, Az 85281 X * (602) 966-8871 X * X */ X X#include <stdio.h> X#include <pmluser.h> X#include "pml.h" X X Xdouble frac(x) Xdouble x; X{ X double dint(); X X return (x - dint(x)); X} END_OF_funcs/unused/frac.c if test 1305 -ne `wc -c <funcs/unused/frac.c`; then echo shar: \"funcs/unused/frac.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f tests/Makefile -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"tests/Makefile\" else echo shar: Extracting \"tests/Makefile\" \(388 characters\) sed "s/^X//" >tests/Makefile <<'END_OF_tests/Makefile' XCFLAGS = -DHELP -O XLIBS = -lpml -lm -ldbg X Xall : d2d dd2d c2d c2c cc2c X Xd2d : d2d.o X cc -o d2d d2d.o $(LIBS) X Xdd2d : dd2d.o X cc -o dd2d dd2d.o $(LIBS) X Xc2d : c2d.o X cc -o c2d c2d.o $(LIBS) X Xc2c : c2c.o X cc -o c2c c2c.o $(LIBS) X Xcc2c : cc2c.o X cc -o cc2c cc2c.o $(LIBS) X X X# X# Clean up the directory. X# X Xclean: X rm -f c2c c2d cc2c d2d dd2d *.BAK *.bak *.tmp nohup.out *.o END_OF_tests/Makefile if test 388 -ne `wc -c <tests/Makefile`; then echo shar: \"tests/Makefile\" unpacked with wrong size! fi # end of overwriting check fi if test -f tests/c2d.dat -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"tests/c2d.dat\" else echo shar: Extracting \"tests/c2d.dat\" \(401 characters\) sed "s/^X//" >tests/c2d.dat <<'END_OF_tests/c2d.dat' Xcabs 1.000000000000e00 2.000000000000e00 2.23606798052788e00 Xcabs 0.000000000000e00 2.000000000000e00 2.00000000000000e00 Xcabs 1.000000000000e00 0.000000000000e00 1.00000000000000e00 Xcabs -2.000000000000e00 2.000000000000e00 2.82842713594437e00 Xcabs -1.000000000000e00 -2.000000000000e00 2.23606798052788e00 Xcabs 1.000000000000e00 -2.000000000000e00 2.23606798052788e00 END_OF_tests/c2d.dat if test 401 -ne `wc -c <tests/c2d.dat`; then echo shar: \"tests/c2d.dat\" unpacked with wrong size! fi # end of overwriting check fi if test -f tests/dd2d.dat -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"tests/dd2d.dat\" else echo shar: Extracting \"tests/dd2d.dat\" \(1082 characters\) sed "s/^X//" >tests/dd2d.dat <<'END_OF_tests/dd2d.dat' Xatan2 -6.000000000000e-01 -5.000000000000e-01 -2.44685437739309e00 Xatan2 0.000000000000e00 -1.000000000000e00 -1.57079632679490e00 Xatan2 6.000000000000e-01 -5.000000000000e-01 -6.94738276196703e-01 Xatan2 1.000000000000e00 0.000000000000e00 0.00000000000000e00 Xatan2 6.000000000000e-01 5.000000000000e-01 6.94738276196703e-01 Xatan2 0.000000000000e00 1.000000000000e00 1.57079632679490e00 Xatan2 -6.000000000000e-01 5.000000000000e-01 2.44685437739309e00 Xatan2 -1.000000000000e00 0.000000000000e00 -3.14159265358979e00 Xmax 6.0 5.0 6.0 Xmax 0.0 0.0 0.0 Xmax 0.1 0.2 0.2 Xmax -0.1 -0.2 -0.1 Xmax -0.1 0.2 0.2 Xmax 0.1 0.2 0.2 Xmax 0.1 -0.2 0.1 Xmax 1e10 1.1e10 1.1e10 Xmax -1e10 -1.1e10 -1e10 Xmax 1e-10 1.1e-10 1.1e-10 Xmin 6.0 5.0 5.0 Xmin 0.0 0.0 0.0 Xmin 0.1 0.2 0.1 Xmin -0.1 -0.2 -0.2 Xmin -0.1 0.2 -0.1 Xmin 0.1 0.2 0.1 Xmin 0.1 -0.2 -0.2 Xmin 1e10 1.1e10 1e10 Xmin -1e10 -1.1e10 -1.1e10 Xmin 1e-10 1.1e-10 1e-10 END_OF_tests/dd2d.dat if test 1082 -ne `wc -c <tests/dd2d.dat`; then echo shar: \"tests/dd2d.dat\" unpacked with wrong size! fi # end of overwriting check fi if test -f tests/unused/d2i.dat -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"tests/unused/d2i.dat\" else echo shar: Extracting \"tests/unused/d2i.dat\" \(117 characters\) sed "s/^X//" >tests/unused/d2i.dat <<'END_OF_tests/unused/d2i.dat' Xxexp 65536.0 16 Xxexp 256.0 8 Xxexp 4.0 2 Xxexp 2.0 1 Xxexp 1.0 0 Xxexp 0.0 0 Xxexp 0.5 -1 Xxexp 0.25 -2 Xxexp 0.125 -3 END_OF_tests/unused/d2i.dat if test 117 -ne `wc -c <tests/unused/d2i.dat`; then echo shar: \"tests/unused/d2i.dat\" unpacked with wrong size! fi # end of overwriting check fi if test -f tests/unused/di2d.dat -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"tests/unused/di2d.dat\" else echo shar: Extracting \"tests/unused/di2d.dat\" \(104 characters\) sed "s/^X//" >tests/unused/di2d.dat <<'END_OF_tests/unused/di2d.dat' Xscale 1.0 2 4.0 Xscale 1.0 -2 0.25 Xscale 0.0 10 0.0 Xscale -1.0 2 -4.0 Xscale -1.0 -2 -0.25 END_OF_tests/unused/di2d.dat if test 104 -ne `wc -c <tests/unused/di2d.dat`; then echo shar: \"tests/unused/di2d.dat\" unpacked with wrong size! fi # end of overwriting check fi echo shar: End of archive 1 \(of 1\). cp /dev/null ark1isdone MISSING="" for I in 1 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 1 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 -- = Drug tests; just say *NO*! (Moto just announced new drug testing program) = = Fred Fish Motorola Computer Division, 3013 S 52nd St, Tempe, Az 85282 USA = = seismo!noao!mcdsun!fnf (602) 438-5976 =