econst.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* econst.c */
  2. /* e type constants used by high precision check routines */
  3. #include "ehead.h"
  4. #if NE == 10
  5. /* 0.0 */
  6. unsigned short ezero[NE] =
  7. {0x0000, 0x0000, 0x0000, 0x0000,
  8. 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,};
  9. /* 5.0E-1 */
  10. unsigned short ehalf[NE] =
  11. {0x0000, 0x0000, 0x0000, 0x0000,
  12. 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3ffe,};
  13. /* 1.0E0 */
  14. unsigned short eone[NE] =
  15. {0x0000, 0x0000, 0x0000, 0x0000,
  16. 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3fff,};
  17. /* 2.0E0 */
  18. unsigned short etwo[NE] =
  19. {0x0000, 0x0000, 0x0000, 0x0000,
  20. 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x4000,};
  21. /* 3.2E1 */
  22. unsigned short e32[NE] =
  23. {0x0000, 0x0000, 0x0000, 0x0000,
  24. 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x4004,};
  25. /* 6.93147180559945309417232121458176568075500134360255E-1 */
  26. unsigned short elog2[NE] =
  27. {0x40f3, 0xf6af, 0x03f2, 0xb398,
  28. 0xc9e3, 0x79ab, 0150717, 0013767, 0130562, 0x3ffe,};
  29. /* 1.41421356237309504880168872420969807856967187537695E0 */
  30. unsigned short esqrt2[NE] =
  31. {0x1d6f, 0xbe9f, 0x754a, 0x89b3,
  32. 0x597d, 0x6484, 0174736, 0171463, 0132404, 0x3fff,};
  33. /* 3.14159265358979323846264338327950288419716939937511E0 */
  34. unsigned short epi[NE] =
  35. {0x2902, 0x1cd1, 0x80dc, 0x628b,
  36. 0xc4c6, 0xc234, 0020550, 0155242, 0144417, 0040000,};
  37. /* 5.7721566490153286060651209008240243104215933593992E-1 */
  38. unsigned short eeul[NE] = {
  39. 0xd1be,0xc7a4,0076660,0063743,0111704,0x3ffe,};
  40. #else
  41. /* 0.0 */
  42. unsigned short ezero[NE] = {
  43. 0, 0000000,0000000,0000000,0000000,0000000,};
  44. /* 5.0E-1 */
  45. unsigned short ehalf[NE] = {
  46. 0, 0000000,0000000,0000000,0100000,0x3ffe,};
  47. /* 1.0E0 */
  48. unsigned short eone[NE] = {
  49. 0, 0000000,0000000,0000000,0100000,0x3fff,};
  50. /* 2.0E0 */
  51. unsigned short etwo[NE] = {
  52. 0, 0000000,0000000,0000000,0100000,0040000,};
  53. /* 3.2E1 */
  54. unsigned short e32[NE] = {
  55. 0, 0000000,0000000,0000000,0100000,0040004,};
  56. /* 6.93147180559945309417232121458176568075500134360255E-1 */
  57. unsigned short elog2[NE] = {
  58. 0xc9e4,0x79ab,0150717,0013767,0130562,0x3ffe,};
  59. /* 1.41421356237309504880168872420969807856967187537695E0 */
  60. unsigned short esqrt2[NE] = {
  61. 0x597e,0x6484,0174736,0171463,0132404,0x3fff,};
  62. /* 2/sqrt(PI) =
  63. * 1.12837916709551257389615890312154517168810125865800E0 */
  64. unsigned short eoneopi[NE] = {
  65. 0x71d5,0x688d,0012333,0135202,0110156,0x3fff,};
  66. /* 3.14159265358979323846264338327950288419716939937511E0 */
  67. unsigned short epi[NE] = {
  68. 0xc4c6,0xc234,0020550,0155242,0144417,0040000,};
  69. /* 5.7721566490153286060651209008240243104215933593992E-1 */
  70. unsigned short eeul[NE] = {
  71. 0xd1be,0xc7a4,0076660,0063743,0111704,0x3ffe,};
  72. #endif
  73. extern unsigned short ezero[];
  74. extern unsigned short ehalf[];
  75. extern unsigned short eone[];
  76. extern unsigned short etwo[];
  77. extern unsigned short e32[];
  78. extern unsigned short elog2[];
  79. extern unsigned short esqrt2[];
  80. extern unsigned short eoneopi[];
  81. extern unsigned short epi[];
  82. extern unsigned short eeul[];