diff --git a/src/const.c b/src/const.c deleted file mode 100644 index 2d9ff7b3..00000000 --- a/src/const.c +++ /dev/null @@ -1,252 +0,0 @@ -/* const.c - * - * Globally declared constants - * - * - * - * SYNOPSIS: - * - * extern double nameofconstant; - * - * - * - * - * DESCRIPTION: - * - * This file contains a number of mathematical constants and - * also some needed size parameters of the computer arithmetic. - * The values are supplied as arrays of hexadecimal integers - * for IEEE arithmetic; arrays of octal constants for DEC - * arithmetic; and in a normal decimal scientific notation for - * other machines. The particular notation used is determined - * by a symbol (DEC, IBMPC, or UNK) defined in the include file - * mconf.h. - * - * The default size parameters are as follows. - * - * For DEC and UNK modes: - * MACHEP = 1.38777878078144567553E-17 2**-56 - * MAXLOG = 8.8029691931113054295988E1 log(2**127) - * MINLOG = -8.872283911167299960540E1 log(2**-128) - * MAXNUM = 1.701411834604692317316873e38 2**127 - * - * For IEEE arithmetic (IBMPC): - * MACHEP = 1.11022302462515654042E-16 2**-53 - * MAXLOG = 7.09782712893383996843E2 log(2**1024) - * MINLOG = -7.08396418532264106224E2 log(2**-1022) - * MAXNUM = 1.7976931348623158E308 2**1024 - * - * The global symbols for mathematical constants are - * PI = 3.14159265358979323846 pi - * PIO2 = 1.57079632679489661923 pi/2 - * PIO4 = 7.85398163397448309616E-1 pi/4 - * SQRT2 = 1.41421356237309504880 sqrt(2) - * SQRTH = 7.07106781186547524401E-1 sqrt(2)/2 - * LOG2E = 1.4426950408889634073599 1/log(2) - * SQ2OPI = 7.9788456080286535587989E-1 sqrt( 2/pi ) - * LOGE2 = 6.93147180559945309417E-1 log(2) - * LOGSQ2 = 3.46573590279972654709E-1 log(2)/2 - * THPIO4 = 2.35619449019234492885 3*pi/4 - * TWOOPI = 6.36619772367581343075535E-1 2/pi - * - * These lists are subject to change. - */ - -/* const.c */ - -/* -Cephes Math Library Release 2.3: March, 1995 -Copyright 1984, 1995 by Stephen L. Moshier -*/ - -#include "mconf.h" - -#ifdef UNK -#if 1 -double MACHEP = 1.11022302462515654042E-16; /* 2**-53 */ -#else -double MACHEP = 1.38777878078144567553E-17; /* 2**-56 */ -#endif -double UFLOWTHRESH = 2.22507385850720138309E-308; /* 2**-1022 */ -#ifdef DENORMAL -double MAXLOG = 7.09782712893383996732E2; /* log(MAXNUM) */ -/* double MINLOG = -7.44440071921381262314E2; */ /* log(2**-1074) */ -double MINLOG = -7.451332191019412076235E2; /* log(2**-1075) */ -#else -double MAXLOG = 7.08396418532264106224E2; /* log 2**1022 */ -double MINLOG = -7.08396418532264106224E2; /* log 2**-1022 */ -#endif -double MAXNUM = 1.79769313486231570815E308; /* 2**1024*(1-MACHEP) */ -double PI = 3.14159265358979323846; /* pi */ -double PIO2 = 1.57079632679489661923; /* pi/2 */ -double PIO4 = 7.85398163397448309616E-1; /* pi/4 */ -double SQRT2 = 1.41421356237309504880; /* sqrt(2) */ -double SQRTH = 7.07106781186547524401E-1; /* sqrt(2)/2 */ -double LOG2E = 1.4426950408889634073599; /* 1/log(2) */ -double SQ2OPI = 7.9788456080286535587989E-1; /* sqrt( 2/pi ) */ -double LOGE2 = 6.93147180559945309417E-1; /* log(2) */ -double LOGSQ2 = 3.46573590279972654709E-1; /* log(2)/2 */ -double THPIO4 = 2.35619449019234492885; /* 3*pi/4 */ -double TWOOPI = 6.36619772367581343075535E-1; /* 2/pi */ -#ifdef INFINITIES -double INFINITY = 1.0/0.0; /* 99e999; */ -#else -double INFINITY = 1.79769313486231570815E308; /* 2**1024*(1-MACHEP) */ -#endif -#ifdef NANS -double NAN = 1.0/0.0 - 1.0/0.0; -#else -double NAN = 0.0; -#endif -#ifdef MINUSZERO -double NEGZERO = -0.0; -#else -double NEGZERO = 0.0; -#endif -#endif - -#ifdef IBMPC - /* 2**-53 = 1.11022302462515654042E-16 */ -unsigned short MACHEP[4] = {0x0000,0x0000,0x0000,0x3ca0}; -unsigned short UFLOWTHRESH[4] = {0x0000,0x0000,0x0000,0x0010}; -#ifdef DENORMAL - /* log(MAXNUM) = 7.09782712893383996732224E2 */ -unsigned short MAXLOG[4] = {0x39ef,0xfefa,0x2e42,0x4086}; - /* log(2**-1074) = - -7.44440071921381262314E2 */ -/*unsigned short MINLOG[4] = {0x71c3,0x446d,0x4385,0xc087};*/ -unsigned short MINLOG[4] = {0x3052,0xd52d,0x4910,0xc087}; -#else - /* log(2**1022) = 7.08396418532264106224E2 */ -unsigned short MAXLOG[4] = {0xbcd2,0xdd7a,0x232b,0x4086}; - /* log(2**-1022) = - 7.08396418532264106224E2 */ -unsigned short MINLOG[4] = {0xbcd2,0xdd7a,0x232b,0xc086}; -#endif - /* 2**1024*(1-MACHEP) = 1.7976931348623158E308 */ -unsigned short MAXNUM[4] = {0xffff,0xffff,0xffff,0x7fef}; -unsigned short PI[4] = {0x2d18,0x5444,0x21fb,0x4009}; -unsigned short PIO2[4] = {0x2d18,0x5444,0x21fb,0x3ff9}; -unsigned short PIO4[4] = {0x2d18,0x5444,0x21fb,0x3fe9}; -unsigned short SQRT2[4] = {0x3bcd,0x667f,0xa09e,0x3ff6}; -unsigned short SQRTH[4] = {0x3bcd,0x667f,0xa09e,0x3fe6}; -unsigned short LOG2E[4] = {0x82fe,0x652b,0x1547,0x3ff7}; -unsigned short SQ2OPI[4] = {0x3651,0x33d4,0x8845,0x3fe9}; -unsigned short LOGE2[4] = {0x39ef,0xfefa,0x2e42,0x3fe6}; -unsigned short LOGSQ2[4] = {0x39ef,0xfefa,0x2e42,0x3fd6}; -unsigned short THPIO4[4] = {0x21d2,0x7f33,0xd97c,0x4002}; -unsigned short TWOOPI[4] = {0xc883,0x6dc9,0x5f30,0x3fe4}; -#ifdef INFINITIES -unsigned short INFINITY[4] = {0x0000,0x0000,0x0000,0x7ff0}; -#else -unsigned short INFINITY[4] = {0xffff,0xffff,0xffff,0x7fef}; -#endif -#ifdef NANS -unsigned short NAN[4] = {0x0000,0x0000,0x0000,0x7ffc}; -#else -unsigned short NAN[4] = {0x0000,0x0000,0x0000,0x0000}; -#endif -#ifdef MINUSZERO -unsigned short NEGZERO[4] = {0x0000,0x0000,0x0000,0x8000}; -#else -unsigned short NEGZERO[4] = {0x0000,0x0000,0x0000,0x0000}; -#endif -#endif - -#ifdef MIEEE - /* 2**-53 = 1.11022302462515654042E-16 */ -unsigned short MACHEP[4] = {0x3ca0,0x0000,0x0000,0x0000}; -unsigned short UFLOWTHRESH[4] = {0x0010,0x0000,0x0000,0x0000}; -#ifdef DENORMAL - /* log(2**1024) = 7.09782712893383996843E2 */ -unsigned short MAXLOG[4] = {0x4086,0x2e42,0xfefa,0x39ef}; - /* log(2**-1074) = - -7.44440071921381262314E2 */ -/* unsigned short MINLOG[4] = {0xc087,0x4385,0x446d,0x71c3}; */ -unsigned short MINLOG[4] = {0xc087,0x4910,0xd52d,0x3052}; -#else - /* log(2**1022) = 7.08396418532264106224E2 */ -unsigned short MAXLOG[4] = {0x4086,0x232b,0xdd7a,0xbcd2}; - /* log(2**-1022) = - 7.08396418532264106224E2 */ -unsigned short MINLOG[4] = {0xc086,0x232b,0xdd7a,0xbcd2}; -#endif - /* 2**1024*(1-MACHEP) = 1.7976931348623158E308 */ -unsigned short MAXNUM[4] = {0x7fef,0xffff,0xffff,0xffff}; -unsigned short PI[4] = {0x4009,0x21fb,0x5444,0x2d18}; -unsigned short PIO2[4] = {0x3ff9,0x21fb,0x5444,0x2d18}; -unsigned short PIO4[4] = {0x3fe9,0x21fb,0x5444,0x2d18}; -unsigned short SQRT2[4] = {0x3ff6,0xa09e,0x667f,0x3bcd}; -unsigned short SQRTH[4] = {0x3fe6,0xa09e,0x667f,0x3bcd}; -unsigned short LOG2E[4] = {0x3ff7,0x1547,0x652b,0x82fe}; -unsigned short SQ2OPI[4] = {0x3fe9,0x8845,0x33d4,0x3651}; -unsigned short LOGE2[4] = {0x3fe6,0x2e42,0xfefa,0x39ef}; -unsigned short LOGSQ2[4] = {0x3fd6,0x2e42,0xfefa,0x39ef}; -unsigned short THPIO4[4] = {0x4002,0xd97c,0x7f33,0x21d2}; -unsigned short TWOOPI[4] = {0x3fe4,0x5f30,0x6dc9,0xc883}; -#ifdef INFINITIES -unsigned short INFINITY[4] = {0x7ff0,0x0000,0x0000,0x0000}; -#else -unsigned short INFINITY[4] = {0x7fef,0xffff,0xffff,0xffff}; -#endif -#ifdef NANS -unsigned short NAN[4] = {0x7ff8,0x0000,0x0000,0x0000}; -#else -unsigned short NAN[4] = {0x0000,0x0000,0x0000,0x0000}; -#endif -#ifdef MINUSZERO -unsigned short NEGZERO[4] = {0x8000,0x0000,0x0000,0x0000}; -#else -unsigned short NEGZERO[4] = {0x0000,0x0000,0x0000,0x0000}; -#endif -#endif - -#ifdef DEC - /* 2**-56 = 1.38777878078144567553E-17 */ -unsigned short MACHEP[4] = {0022200,0000000,0000000,0000000}; -unsigned short UFLOWTHRESH[4] = {0x0080,0x0000,0x0000,0x0000}; - /* log 2**127 = 88.029691931113054295988 */ -unsigned short MAXLOG[4] = {041660,007463,0143742,025733,}; - /* log 2**-128 = -88.72283911167299960540 */ -unsigned short MINLOG[4] = {0141661,071027,0173721,0147572,}; - /* 2**127 = 1.701411834604692317316873e38 */ -unsigned short MAXNUM[4] = {077777,0177777,0177777,0177777,}; -unsigned short PI[4] = {040511,007732,0121041,064302,}; -unsigned short PIO2[4] = {040311,007732,0121041,064302,}; -unsigned short PIO4[4] = {040111,007732,0121041,064302,}; -unsigned short SQRT2[4] = {040265,002363,031771,0157145,}; -unsigned short SQRTH[4] = {040065,002363,031771,0157144,}; -unsigned short LOG2E[4] = {040270,0125073,024534,013761,}; -unsigned short SQ2OPI[4] = {040114,041051,0117241,0131204,}; -unsigned short LOGE2[4] = {040061,071027,0173721,0147572,}; -unsigned short LOGSQ2[4] = {037661,071027,0173721,0147572,}; -unsigned short THPIO4[4] = {040426,0145743,0174631,007222,}; -unsigned short TWOOPI[4] = {040042,0174603,067116,042025,}; -/* Approximate infinity by MAXNUM. */ -unsigned short INFINITY[4] = {077777,0177777,0177777,0177777,}; -unsigned short NAN[4] = {0000000,0000000,0000000,0000000}; -#ifdef MINUSZERO -unsigned short NEGZERO[4] = {0000000,0000000,0000000,0100000}; -#else -unsigned short NEGZERO[4] = {0000000,0000000,0000000,0000000}; -#endif -#endif - -#ifndef UNK -extern unsigned short MACHEP[]; -extern unsigned short UFLOWTHRESH[]; -extern unsigned short MAXLOG[]; -extern unsigned short UNDLOG[]; -extern unsigned short MINLOG[]; -extern unsigned short MAXNUM[]; -extern unsigned short PI[]; -extern unsigned short PIO2[]; -extern unsigned short PIO4[]; -extern unsigned short SQRT2[]; -extern unsigned short SQRTH[]; -extern unsigned short LOG2E[]; -extern unsigned short SQ2OPI[]; -extern unsigned short LOGE2[]; -extern unsigned short LOGSQ2[]; -extern unsigned short THPIO4[]; -extern unsigned short TWOOPI[]; -extern unsigned short INFINITY[]; -extern unsigned short NAN[]; -extern unsigned short NEGZERO[]; -#endif diff --git a/src/mconf.h b/src/mconf.h deleted file mode 100644 index 139d64f0..00000000 --- a/src/mconf.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - Cephes Math Library Release 2.3: June, 1995 - Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier - */ -/* mconf.h - * - * Common include file for math routines - * - * - * - * SYNOPSIS: - * - * #include "mconf.h" - * - * - * - * DESCRIPTION: - * - * This file contains definitions for error codes that are - * passed to the common error handling routine mtherr() - * (which see). - * - * The file also includes a conditional assembly definition - * for the type of computer arithmetic (IEEE, DEC, Motorola - * IEEE, or UNKnown). - * - * For Digital Equipment PDP-11 and VAX computers, certain - * IBM systems, and others that use numbers with a 56-bit - * significand, the symbol DEC should be defined. In this - * mode, most floating point constants are given as arrays - * of octal integers to eliminate decimal to binary conversion - * errors that might be introduced by the compiler. - * - * For little-endian computers, such as IBM PC, that follow the - * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE - * Std 754-1985), the symbol IBMPC should be defined. These - * numbers have 53-bit significands. In this mode, constants - * are provided as arrays of hexadecimal 16 bit integers. - * - * Big-endian IEEE format is denoted MIEEE. On some RISC - * systems such as Sun SPARC, double precision constants - * must be stored on 8-byte address boundaries. Since integer - * arrays may be aligned differently, the MIEEE configuration - * may fail on such machines. - * - * To accommodate other types of computer arithmetic, all - * constants are also provided in a normal decimal radix - * which one can hope are correctly converted to a suitable - * format by the available C language compiler. To invoke - * this mode, define the symbol UNK. - * - * An important difference among these modes is a predefined - * set of machine arithmetic constants for each. The numbers - * MACHEP (the machine roundoff error), MAXNUM (largest number - * represented), and several other parameters are preset by - * the configuration symbol. Check the file const.c to - * ensure that these values are correct for your computer. - * - * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL - * may fail on many systems. Verify that they are supposed - * to work on your computer. - */ - - - -/* Define if the `long double' type works. */ -#define HAVE_LONG_DOUBLE 1 - -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ - -/* Define if floating point words are bigendian. */ -/* #undef FLOAT_WORDS_BIGENDIAN */ - -/* The number of bytes in a int. */ -#define SIZEOF_INT 4 - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Name of package */ -#define PACKAGE "cephes" - -/* Version number of package */ -#define VERSION "2.7" - -/* Constant definitions for math error conditions - */ - -#define DOMAIN 1 /* argument domain error */ -#define SING 2 /* argument singularity */ -#define OVERFLOW 3 /* overflow range error */ -#define UNDERFLOW 4 /* underflow range error */ -#define TLOSS 5 /* total loss of precision */ -#define PLOSS 6 /* partial loss of precision */ - -#define EDOM 33 -#define ERANGE 34 -/* Complex numeral. */ -typedef struct - { - double r; - double i; - } cmplx; - -#ifdef HAVE_LONG_DOUBLE -/* Long double complex numeral. */ -typedef struct - { - long double r; - long double i; - } cmplxl; -#endif - - -/* Type of computer arithmetic */ - -/* PDP-11, Pro350, VAX: - */ -/* #define DEC 1 */ - -/* Intel IEEE, low order words come first: - */ -/* #define IBMPC 1 */ - -/* Motorola IEEE, high order words come first - * (Sun 680x0 workstation): - */ -/* #define MIEEE 1 */ - -/* UNKnown arithmetic, invokes coefficients given in - * normal decimal format. Beware of range boundary - * problems (MACHEP, MAXLOG, etc. in const.c) and - * roundoff problems in pow.c: - * (Sun SPARCstation) - */ -#define UNK 1 - -/* If you define UNK, then be sure to set BIGENDIAN properly. */ -#ifdef FLOAT_WORDS_BIGENDIAN -#define BIGENDIAN 1 -#else -#define BIGENDIAN 0 -#endif -/* Define this `volatile' if your compiler thinks - * that floating point arithmetic obeys the associative - * and distributive laws. It will defeat some optimizations - * (but probably not enough of them). - * - * #define VOLATILE volatile - */ -#define VOLATILE - -/* For 12-byte long doubles on an i386, pad a 16-bit short 0 - * to the end of real constants initialized by integer arrays. - * - * #define XPD 0, - * - * Otherwise, the type is 10 bytes long and XPD should be - * defined blank (e.g., Microsoft C). - * - * #define XPD - */ -#define XPD 0, - -/* Define to support tiny denormal numbers, else undefine. */ -#define DENORMAL 1 - -/* Define to ask for infinity support, else undefine. */ -#define INFINITIES 1 - -/* Define to ask for support of numbers that are Not-a-Number, - else undefine. This may automatically define INFINITIES in some files. */ -#define NANS 1 - -/* Define to distinguish between -0.0 and +0.0. */ -#define MINUSZERO 1 - -/* Define 1 for ANSI C atan2() function - See atan.c and clog.c. */ -#define ANSIC 1 - -/* Get ANSI function prototypes, if you want them. */ -#if 1 -/* #ifdef __STDC__ */ -#define ANSIPROT 1 -int mtherr ( char *, int ); -#else -int mtherr(); -#endif - -/* Variable for error reporting. See mtherr.c. */ -extern int merror;