dpmpar_.c 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /* dpmpar.f -- translated by f2c (version 20020621).
  2. You must link the resulting object file with the libraries:
  3. -lf2c -lm (in that order)
  4. */
  5. #include "minpack.h"
  6. #include <float.h>
  7. #define real __minpack_real__
  8. #define double_EPSILON DBL_EPSILON
  9. #define double_MIN DBL_MIN
  10. #define double_MAX DBL_MAX
  11. #define float_EPSILON FLT_EPSILON
  12. #define float_MIN FLT_MIN
  13. #define float_MAX FLT_MAX
  14. #define half_EPSILON HALF_EPSILON
  15. #define half_MIN HALF_NRM_MIN
  16. #define half_MAX HALF_MAX
  17. #define DPMPAR(type,X) _DPMPAR(type,X)
  18. #define _DPMPAR(type,X) type ## _ ## X
  19. __minpack_attr__
  20. real __minpack_func__(dpmpar)(const int *i)
  21. {
  22. /* ********** */
  23. /* Function dpmpar */
  24. /* This function provides double precision machine parameters */
  25. /* when the appropriate set of data statements is activated (by */
  26. /* removing the c from column 1) and all other data statements are */
  27. /* rendered inactive. Most of the parameter values were obtained */
  28. /* from the corresponding Bell Laboratories Port Library function. */
  29. /* The function statement is */
  30. /* double precision function dpmpar(i) */
  31. /* where */
  32. /* i is an integer input variable set to 1, 2, or 3 which */
  33. /* selects the desired machine parameter. If the machine has */
  34. /* t base b digits and its smallest and largest exponents are */
  35. /* emin and emax, respectively, then these parameters are */
  36. /* dpmpar(1) = b**(1 - t), the machine precision, */
  37. /* dpmpar(2) = b**(emin - 1), the smallest magnitude, */
  38. /* dpmpar(3) = b**emax*(1 - b**(-t)), the largest magnitude. */
  39. /* Argonne National Laboratory. MINPACK Project. November 1996. */
  40. /* Burton S. Garbow, Kenneth E. Hillstrom, Jorge J. More' */
  41. /* ********** */
  42. /* Machine constants for the IBM 360/370 series, */
  43. /* the Amdahl 470/V6, the ICL 2900, the Itel AS/6, */
  44. /* the Xerox Sigma 5/7/9 and the Sel systems 85/86. */
  45. /* data mcheps(1),mcheps(2) / z34100000, z00000000 / */
  46. /* data minmag(1),minmag(2) / z00100000, z00000000 / */
  47. /* data maxmag(1),maxmag(2) / z7fffffff, zffffffff / */
  48. /* Machine constants for the Honeywell 600/6000 series. */
  49. /* data mcheps(1),mcheps(2) / o606400000000, o000000000000 / */
  50. /* data minmag(1),minmag(2) / o402400000000, o000000000000 / */
  51. /* data maxmag(1),maxmag(2) / o376777777777, o777777777777 / */
  52. /* Machine constants for the CDC 6000/7000 series. */
  53. /* data mcheps(1) / 15614000000000000000b / */
  54. /* data mcheps(2) / 15010000000000000000b / */
  55. /* data minmag(1) / 00604000000000000000b / */
  56. /* data minmag(2) / 00000000000000000000b / */
  57. /* data maxmag(1) / 37767777777777777777b / */
  58. /* data maxmag(2) / 37167777777777777777b / */
  59. /* Machine constants for the PDP-10 (KA processor). */
  60. /* data mcheps(1),mcheps(2) / "114400000000, "000000000000 / */
  61. /* data minmag(1),minmag(2) / "033400000000, "000000000000 / */
  62. /* data maxmag(1),maxmag(2) / "377777777777, "344777777777 / */
  63. /* Machine constants for the PDP-10 (KI processor). */
  64. /* data mcheps(1),mcheps(2) / "104400000000, "000000000000 / */
  65. /* data minmag(1),minmag(2) / "000400000000, "000000000000 / */
  66. /* data maxmag(1),maxmag(2) / "377777777777, "377777777777 / */
  67. /* Machine constants for the PDP-11. */
  68. /* data mcheps(1),mcheps(2) / 9472, 0 / */
  69. /* data mcheps(3),mcheps(4) / 0, 0 / */
  70. /* data minmag(1),minmag(2) / 128, 0 / */
  71. /* data minmag(3),minmag(4) / 0, 0 / */
  72. /* data maxmag(1),maxmag(2) / 32767, -1 / */
  73. /* data maxmag(3),maxmag(4) / -1, -1 / */
  74. /* Machine constants for the Burroughs 6700/7700 systems. */
  75. /* data mcheps(1) / o1451000000000000 / */
  76. /* data mcheps(2) / o0000000000000000 / */
  77. /* data minmag(1) / o1771000000000000 / */
  78. /* data minmag(2) / o7770000000000000 / */
  79. /* data maxmag(1) / o0777777777777777 / */
  80. /* data maxmag(2) / o7777777777777777 / */
  81. /* Machine constants for the Burroughs 5700 system. */
  82. /* data mcheps(1) / o1451000000000000 / */
  83. /* data mcheps(2) / o0000000000000000 / */
  84. /* data minmag(1) / o1771000000000000 / */
  85. /* data minmag(2) / o0000000000000000 / */
  86. /* data maxmag(1) / o0777777777777777 / */
  87. /* data maxmag(2) / o0007777777777777 / */
  88. /* Machine constants for the Burroughs 1700 system. */
  89. /* data mcheps(1) / zcc6800000 / */
  90. /* data mcheps(2) / z000000000 / */
  91. /* data minmag(1) / zc00800000 / */
  92. /* data minmag(2) / z000000000 / */
  93. /* data maxmag(1) / zdffffffff / */
  94. /* data maxmag(2) / zfffffffff / */
  95. /* Machine constants for the Univac 1100 series. */
  96. /* data mcheps(1),mcheps(2) / o170640000000, o000000000000 / */
  97. /* data minmag(1),minmag(2) / o000040000000, o000000000000 / */
  98. /* data maxmag(1),maxmag(2) / o377777777777, o777777777777 / */
  99. /* Machine constants for the Data General Eclipse S/200. */
  100. /* Note - it may be appropriate to include the following card - */
  101. /* static dmach(3) */
  102. /* data minmag/20k,3*0/,maxmag/77777k,3*177777k/ */
  103. /* data mcheps/32020k,3*0/ */
  104. /* Machine constants for the Harris 220. */
  105. /* data mcheps(1),mcheps(2) / '20000000, '00000334 / */
  106. /* data minmag(1),minmag(2) / '20000000, '00000201 / */
  107. /* data maxmag(1),maxmag(2) / '37777777, '37777577 / */
  108. /* Machine constants for the Cray-1. */
  109. /* data mcheps(1) / 0376424000000000000000b / */
  110. /* data mcheps(2) / 0000000000000000000000b / */
  111. /* data minmag(1) / 0200034000000000000000b / */
  112. /* data minmag(2) / 0000000000000000000000b / */
  113. /* data maxmag(1) / 0577777777777777777777b / */
  114. /* data maxmag(2) / 0000007777777777777776b / */
  115. /* Machine constants for the Prime 400. */
  116. /* data mcheps(1),mcheps(2) / :10000000000, :00000000123 / */
  117. /* data minmag(1),minmag(2) / :10000000000, :00000100000 / */
  118. /* data maxmag(1),maxmag(2) / :17777777777, :37777677776 / */
  119. /* Machine constants for the VAX-11. */
  120. /* data mcheps(1),mcheps(2) / 9472, 0 / */
  121. /* data minmag(1),minmag(2) / 128, 0 / */
  122. /* data maxmag(1),maxmag(2) / -32769, -1 / */
  123. /* Machine constants for IEEE machines. */
  124. /* data dmach(1) /2.22044604926d-16/ */
  125. /* data dmach(2) /2.22507385852d-308/ */
  126. /* data dmach(3) /1.79769313485d+308/ */
  127. switch(*i) {
  128. case 1:
  129. return DPMPAR(real,EPSILON); /* 2.2204460492503131e-16 | 1.19209290e-07F */
  130. case 2:
  131. return DPMPAR(real,MIN); /* 2.2250738585072014e-308 | 1.17549435e-38F */
  132. default:
  133. return DPMPAR(real,MAX); /* 1.7976931348623157e+308 | 3.40282347e+38F */
  134. }
  135. /* Last card of function dpmpar. */
  136. } /* dpmpar_ */
  137. #undef mcheps
  138. #undef maxmag
  139. #undef minmag
  140. #undef dmach