const.c
Go to the documentation of this file.
1 /* const.c
2  *
3  * Globally declared constants
4  *
5  *
6  *
7  * SYNOPSIS:
8  *
9  * extern double nameofconstant;
10  *
11  *
12  *
13  *
14  * DESCRIPTION:
15  *
16  * This file contains a number of mathematical constants and
17  * also some needed size parameters of the computer arithmetic.
18  * The values are supplied as arrays of hexadecimal integers
19  * for IEEE arithmetic, and in a normal decimal scientific notation for
20  * other machines. The particular notation used is determined
21  * by a symbol (IBMPC, or UNK) defined in the include file
22  * mconf.h.
23  *
24  * The default size parameters are as follows.
25  *
26  * For UNK mode:
27  * MACHEP = 1.38777878078144567553E-17 2**-56
28  * MAXLOG = 8.8029691931113054295988E1 log(2**127)
29  * MINLOG = -8.872283911167299960540E1 log(2**-128)
30  *
31  * For IEEE arithmetic (IBMPC):
32  * MACHEP = 1.11022302462515654042E-16 2**-53
33  * MAXLOG = 7.09782712893383996843E2 log(2**1024)
34  * MINLOG = -7.08396418532264106224E2 log(2**-1022)
35  *
36  * The global symbols for mathematical constants are
37  * SQ2OPI = 7.9788456080286535587989E-1 sqrt( 2/pi )
38  * LOGSQ2 = 3.46573590279972654709E-1 log(2)/2
39  * THPIO4 = 2.35619449019234492885 3*pi/4
40  *
41  * These lists are subject to change.
42  */
43 
44 /* const.c */
45 
46 /*
47  * Cephes Math Library Release 2.3: March, 1995
48  * Copyright 1984, 1995 by Stephen L. Moshier
49  */
50 
51 #include "mconf.h"
52 
53 #ifdef UNK
54 double MACHEP = 1.11022302462515654042E-16; /* 2**-53 */
55 
56 #ifdef DENORMAL
57 double MAXLOG = 7.09782712893383996732E2; /* log(DBL_MAX) */
58 
59  /* double MINLOG = -7.44440071921381262314E2; *//* log(2**-1074) */
60 double MINLOG = -7.451332191019412076235E2; /* log(2**-1075) */
61 #else
62 double MAXLOG = 7.08396418532264106224E2; /* log 2**1022 */
63 double MINLOG = -7.08396418532264106224E2; /* log 2**-1022 */
64 #endif
65 double SQ2OPI = 7.9788456080286535587989E-1; /* sqrt( 2/pi ) */
66 double LOGSQ2 = 3.46573590279972654709E-1; /* log(2)/2 */
67 double THPIO4 = 2.35619449019234492885; /* 3*pi/4 */
68 
69 #endif
70 
71 #ifdef IBMPC
72  /* 2**-53 = 1.11022302462515654042E-16 */
73 unsigned short MACHEP[4] = { 0x0000, 0x0000, 0x0000, 0x3ca0 };
74 
75 #ifdef DENORMAL
76  /* log(DBL_MAX) = 7.09782712893383996732224E2 */
77 unsigned short MAXLOG[4] = { 0x39ef, 0xfefa, 0x2e42, 0x4086 };
78 
79  /* log(2**-1074) = - -7.44440071921381262314E2 */
80 /*unsigned short MINLOG[4] = {0x71c3,0x446d,0x4385,0xc087}; */
81 unsigned short MINLOG[4] = { 0x3052, 0xd52d, 0x4910, 0xc087 };
82 #else
83  /* log(2**1022) = 7.08396418532264106224E2 */
84 unsigned short MAXLOG[4] = { 0xbcd2, 0xdd7a, 0x232b, 0x4086 };
85 
86  /* log(2**-1022) = - 7.08396418532264106224E2 */
87 unsigned short MINLOG[4] = { 0xbcd2, 0xdd7a, 0x232b, 0xc086 };
88 #endif
89  /* 2**1024*(1-MACHEP) = 1.7976931348623158E308 */
90 unsigned short SQ2OPI[4] = { 0x3651, 0x33d4, 0x8845, 0x3fe9 };
91 unsigned short LOGSQ2[4] = { 0x39ef, 0xfefa, 0x2e42, 0x3fd6 };
92 unsigned short THPIO4[4] = { 0x21d2, 0x7f33, 0xd97c, 0x4002 };
93 
94 #endif
95 
96 #ifdef MIEEE
97  /* 2**-53 = 1.11022302462515654042E-16 */
98 unsigned short MACHEP[4] = { 0x3ca0, 0x0000, 0x0000, 0x0000 };
99 
100 #ifdef DENORMAL
101  /* log(2**1024) = 7.09782712893383996843E2 */
102 unsigned short MAXLOG[4] = { 0x4086, 0x2e42, 0xfefa, 0x39ef };
103 
104  /* log(2**-1074) = - -7.44440071921381262314E2 */
105 /* unsigned short MINLOG[4] = {0xc087,0x4385,0x446d,0x71c3}; */
106 unsigned short MINLOG[4] = { 0xc087, 0x4910, 0xd52d, 0x3052 };
107 #else
108  /* log(2**1022) = 7.08396418532264106224E2 */
109 unsigned short MAXLOG[4] = { 0x4086, 0x232b, 0xdd7a, 0xbcd2 };
110 
111  /* log(2**-1022) = - 7.08396418532264106224E2 */
112 unsigned short MINLOG[4] = { 0xc086, 0x232b, 0xdd7a, 0xbcd2 };
113 #endif
114  /* 2**1024*(1-MACHEP) = 1.7976931348623158E308 */
115 unsigned short SQ2OPI[4] = { 0x3fe9, 0x8845, 0x33d4, 0x3651 };
116 unsigned short LOGSQ2[4] = { 0x3fd6, 0x2e42, 0xfefa, 0x39ef };
117 unsigned short THPIO4[4] = { 0x4002, 0xd97c, 0x7f33, 0x21d2 };
118 
119 #endif
120 
121 #ifndef UNK
122 extern unsigned short MACHEP[];
123 extern unsigned short MAXLOG[];
124 extern unsigned short UNDLOG[];
125 extern unsigned short MINLOG[];
126 extern unsigned short SQ2OPI[];
127 extern unsigned short LOGSQ2[];
128 extern unsigned short THPIO4[];
129 #endif
LOGSQ2
double LOGSQ2
Definition: const.c:66
MINLOG
double MINLOG
Definition: const.c:60
MACHEP
double MACHEP
Definition: const.c:54
THPIO4
double THPIO4
Definition: const.c:67
SQ2OPI
double SQ2OPI
Definition: const.c:65
mconf.h
MAXLOG
double MAXLOG
Definition: const.c:57


gtsam
Author(s):
autogenerated on Thu Jun 13 2024 03:01:59