2 * This file comes from the cephes math library, which was
3 * released under the GPLV2+ license as a part of the Debian labplot
4 * package (I've included the GPLV2 license reference here to make
5 * this clear) - Keith Packard <keithp@keithp.com>
7 * Cephes Math Library Release 2.0: April, 1987
8 * Copyright 1984, 1987 by Stephen L. Moshier
9 * Direct inquiries to 30 Frost Street, Cambridge, MA 02140
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; version 2 of the License.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 * Common include file for math routines
38 * This file contains definitions for error codes that are
39 * passed to the common error handling routine mtherr()
42 * The file also includes a conditional assembly definition
43 * for the type of computer arithmetic (IEEE, DEC, Motorola
46 * For Digital Equipment PDP-11 and VAX computers, certain
47 * IBM systems, and others that use numbers with a 56-bit
48 * significand, the symbol DEC should be defined. In this
49 * mode, most floating point constants are given as arrays
50 * of octal integers to eliminate decimal to binary conversion
51 * errors that might be introduced by the compiler.
53 * For little-endian computers, such as IBM PC, that follow the
54 * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE
55 * Std 754-1985), the symbol IBMPC should be defined. These
56 * numbers have 53-bit significands. In this mode, constants
57 * are provided as arrays of hexadecimal 16 bit integers.
59 * Big-endian IEEE format is denoted MIEEE. On some RISC
60 * systems such as Sun SPARC, double precision constants
61 * must be stored on 8-byte address boundaries. Since integer
62 * arrays may be aligned differently, the MIEEE configuration
63 * may fail on such machines.
65 * To accommodate other types of computer arithmetic, all
66 * constants are also provided in a normal decimal radix
67 * which one can hope are correctly converted to a suitable
68 * format by the available C language compiler. To invoke
69 * this mode, define the symbol UNK.
71 * An important difference among these modes is a predefined
72 * set of machine arithmetic constants for each. The numbers
73 * MACHEP (the machine roundoff error), MAXNUM (largest number
74 * represented), and several other parameters are preset by
75 * the configuration symbol. Check the file const.c to
76 * ensure that these values are correct for your computer.
78 * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL
79 * may fail on many systems. Verify that they are supposed
80 * to work on your computer.
84 Cephes Math Library Release 2.3: June, 1995
85 Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier
87 Adjusted for use with ACE/gr by Evgeny Stambulchik, October 1997
90 #define __GRACE_SOURCE_
94 /* Type of computer arithmetic */
95 /* In ACE/gr, defined as a compiler directive - no need to define here */
97 /* PDP-11, Pro350, VAX:
99 #if defined(HAVE_DEC_FPU)
103 /* Intel IEEE, low order words come first:
105 #if defined(HAVE_LIEEE_FPU)
109 /* Motorola IEEE, high order words come first
110 * (Sun 680x0 workstation):
112 #if defined(HAVE_BIEEE_FPU)
116 /* UNKnown arithmetic, invokes coefficients given in
117 * normal decimal format. Beware of range boundary
118 * problems (MACHEP, MAXLOG, etc. in const.c) and
119 * roundoff problems in pow.c:
123 #if (!defined (DEC) && !defined (IBMPC) && !defined (MIEEE))
127 /* Define this `volatile' if your compiler thinks
128 * that floating point arithmetic obeys the associative
129 * and distributive laws. It will defeat some optimizations
130 * (but probably not enough of them).
132 * #define VOLATILE volatile
151 /* Constant definitions for math error conditions
157 #define DOMAIN 1 /* argument domain error */
162 #define SING 2 /* argument singularity */
164 #if defined(OVERFLOW)
167 #define OVERFLOW 3 /* overflow range error */
169 #if defined(UNDERFLOW)
172 #define UNDERFLOW 4 /* underflow range error */
177 #define TLOSS 5 /* total loss of precision */
182 #define PLOSS 6 /* partial loss of precision */
195 /* Define to support tiny denormal numbers, else undefine. */
198 /* Define to ask for infinity support, else undefine. */
199 # define INFINITIES 1
201 /* Define to ask for support of numbers that are Not-a-Number,
202 else undefine. This may automatically define INFINITIES in some files. */
205 /* Define to distinguish between -0.0 and +0.0. */
209 /* Define 1 for ANSI C atan2() function
210 See atan.c and clog.c. */