-
Notifications
You must be signed in to change notification settings - Fork 61
/
dpmpar.c
191 lines (127 loc) · 6.29 KB
/
dpmpar.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#include "cminpack.h"
#include <float.h>
#include "cminpackP.h"
#define DPMPAR(type,X) _DPMPAR(type,X)
#define _DPMPAR(type,X) type ## _ ## X
__cminpack_attr__
real __cminpack_func__(dpmpar)(int i)
{
/* ********** */
/* Function dpmpar */
/* This function provides double precision machine parameters */
/* when the appropriate set of data statements is activated (by */
/* removing the c from column 1) and all other data statements are */
/* rendered inactive. Most of the parameter values were obtained */
/* from the corresponding Bell Laboratories Port Library function. */
/* The function statement is */
/* double precision function dpmpar(i) */
/* where */
/* i is an integer input variable set to 1, 2, or 3 which */
/* selects the desired machine parameter. If the machine has */
/* t base b digits and its smallest and largest exponents are */
/* emin and emax, respectively, then these parameters are */
/* dpmpar(1) = b**(1 - t), the machine precision, */
/* dpmpar(2) = b**(emin - 1), the smallest magnitude, */
/* dpmpar(3) = b**emax*(1 - b**(-t)), the largest magnitude. */
/* Argonne National Laboratory. MINPACK Project. November 1996. */
/* Burton S. Garbow, Kenneth E. Hillstrom, Jorge J. More' */
/* ********** */
/* Machine constants for the IBM 360/370 series, */
/* the Amdahl 470/V6, the ICL 2900, the Itel AS/6, */
/* the Xerox Sigma 5/7/9 and the Sel systems 85/86. */
/* data mcheps(1),mcheps(2) / z34100000, z00000000 / */
/* data minmag(1),minmag(2) / z00100000, z00000000 / */
/* data maxmag(1),maxmag(2) / z7fffffff, zffffffff / */
/* Machine constants for the Honeywell 600/6000 series. */
/* data mcheps(1),mcheps(2) / o606400000000, o000000000000 / */
/* data minmag(1),minmag(2) / o402400000000, o000000000000 / */
/* data maxmag(1),maxmag(2) / o376777777777, o777777777777 / */
/* Machine constants for the CDC 6000/7000 series. */
/* data mcheps(1) / 15614000000000000000b / */
/* data mcheps(2) / 15010000000000000000b / */
/* data minmag(1) / 00604000000000000000b / */
/* data minmag(2) / 00000000000000000000b / */
/* data maxmag(1) / 37767777777777777777b / */
/* data maxmag(2) / 37167777777777777777b / */
/* Machine constants for the PDP-10 (KA processor). */
/* data mcheps(1),mcheps(2) / "114400000000, "000000000000 / */
/* data minmag(1),minmag(2) / "033400000000, "000000000000 / */
/* data maxmag(1),maxmag(2) / "377777777777, "344777777777 / */
/* Machine constants for the PDP-10 (KI processor). */
/* data mcheps(1),mcheps(2) / "104400000000, "000000000000 / */
/* data minmag(1),minmag(2) / "000400000000, "000000000000 / */
/* data maxmag(1),maxmag(2) / "377777777777, "377777777777 / */
/* Machine constants for the PDP-11. */
/* data mcheps(1),mcheps(2) / 9472, 0 / */
/* data mcheps(3),mcheps(4) / 0, 0 / */
/* data minmag(1),minmag(2) / 128, 0 / */
/* data minmag(3),minmag(4) / 0, 0 / */
/* data maxmag(1),maxmag(2) / 32767, -1 / */
/* data maxmag(3),maxmag(4) / -1, -1 / */
/* Machine constants for the Burroughs 6700/7700 systems. */
/* data mcheps(1) / o1451000000000000 / */
/* data mcheps(2) / o0000000000000000 / */
/* data minmag(1) / o1771000000000000 / */
/* data minmag(2) / o7770000000000000 / */
/* data maxmag(1) / o0777777777777777 / */
/* data maxmag(2) / o7777777777777777 / */
/* Machine constants for the Burroughs 5700 system. */
/* data mcheps(1) / o1451000000000000 / */
/* data mcheps(2) / o0000000000000000 / */
/* data minmag(1) / o1771000000000000 / */
/* data minmag(2) / o0000000000000000 / */
/* data maxmag(1) / o0777777777777777 / */
/* data maxmag(2) / o0007777777777777 / */
/* Machine constants for the Burroughs 1700 system. */
/* data mcheps(1) / zcc6800000 / */
/* data mcheps(2) / z000000000 / */
/* data minmag(1) / zc00800000 / */
/* data minmag(2) / z000000000 / */
/* data maxmag(1) / zdffffffff / */
/* data maxmag(2) / zfffffffff / */
/* Machine constants for the Univac 1100 series. */
/* data mcheps(1),mcheps(2) / o170640000000, o000000000000 / */
/* data minmag(1),minmag(2) / o000040000000, o000000000000 / */
/* data maxmag(1),maxmag(2) / o377777777777, o777777777777 / */
/* Machine constants for the Data General Eclipse S/200. */
/* Note - it may be appropriate to include the following card - */
/* static dmach(3) */
/* data minmag/20k,3*0/,maxmag/77777k,3*177777k/ */
/* data mcheps/32020k,3*0/ */
/* Machine constants for the Harris 220. */
/* data mcheps(1),mcheps(2) / '20000000, '00000334 / */
/* data minmag(1),minmag(2) / '20000000, '00000201 / */
/* data maxmag(1),maxmag(2) / '37777777, '37777577 / */
/* Machine constants for the Cray-1. */
/* data mcheps(1) / 0376424000000000000000b / */
/* data mcheps(2) / 0000000000000000000000b / */
/* data minmag(1) / 0200034000000000000000b / */
/* data minmag(2) / 0000000000000000000000b / */
/* data maxmag(1) / 0577777777777777777777b / */
/* data maxmag(2) / 0000007777777777777776b / */
/* Machine constants for the Prime 400. */
/* data mcheps(1),mcheps(2) / :10000000000, :00000000123 / */
/* data minmag(1),minmag(2) / :10000000000, :00000100000 / */
/* data maxmag(1),maxmag(2) / :17777777777, :37777677776 / */
/* Machine constants for the VAX-11. */
/* data mcheps(1),mcheps(2) / 9472, 0 / */
/* data minmag(1),minmag(2) / 128, 0 / */
/* data maxmag(1),maxmag(2) / -32769, -1 / */
/* Machine constants for IEEE machines. */
/* data dmach(1) /2.22044604926d-16/ */
/* data dmach(2) /2.22507385852d-308/ */
/* data dmach(3) /1.79769313485d+308/ */
switch(i) {
case 1:
return DPMPAR(realm,EPSILON); /* 2.2204460492503131e-16 | 1.19209290e-07F */
case 2:
return DPMPAR(realm,MIN); /* 2.2250738585072014e-308 | 1.17549435e-38F */
default:
return DPMPAR(realm,MAX); /* 1.7976931348623157e+308 | 3.40282347e+38F */
}
/* Last card of function dpmpar. */
} /* dpmpar_ */
#undef mcheps
#undef maxmag
#undef minmag
#undef dmach