home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / astrnomy / de118i.zip / RUNGE.C < prev    next >
C/C++ Source or Header  |  1993-01-30  |  43KB  |  1,481 lines

  1.  
  2.  
  3. /* Runge-Kutta numerical integration
  4.  * of a system of ordinary differential equations.
  5.  *
  6.  * Reference:
  7.  * Thomas, Benku, "The Runge-Kutta Methods," BYTE 11, #4, April 1986
  8.  * This program is adapted from code supplied with that article.
  9.  */
  10. #ifndef NOINCS
  11. #include "mconf.h"
  12. #include "prec.h"
  13. #include "int.h"
  14. #include "const.h"
  15. #endif
  16. #define ORDER 7
  17. #define ERRTERM 0
  18.  
  19. #if !(ORDER-4)
  20. /*
  21. Fourth order Runge-Kutta method specified by
  22. Felberg, E., COMPUTING,    6(1970)p61-71
  23. */
  24. #define INUM 6
  25. #define HMAXL ((DOUBLE )0.5)
  26. #define HLIM1 ((DOUBLE )3.0)
  27.  
  28. #if UNK
  29. DOUBLE rungal[5] = {
  30.  2.50000000000000000000E-1, /* 1.0/4.0 */
  31.  3.75000000000000000000E-1, /* 3.0/8.0 */
  32.  9.23076923076923076923E-1, /* 12.0/13.0 */
  33.  1.00000000000000000000E0, /* 1.0 */
  34.  5.00000000000000000000E-1, /* 1.0/2.0 */
  35. };
  36.  
  37. DOUBLE b[15] = {
  38.  2.50000000000000000000E-1, /* 1.0/4.0 */ /* b(1,1) */
  39.  
  40.  9.37500000000000000000E-2, /* 3.0/32.0 */ /* b(1,2) */
  41.  2.81250000000000000000E-1, /* 9.0/32.0 */ /* b(2,2) */
  42.  
  43.  8.79380974055530268548E-1, /* 1932.0/2197.0 */ /* b(1,3) */
  44. -3.27719617660446062813E0, /* -7200.0/2197.0 */
  45.  3.32089212562585343650E0, /* 7296.0/2197.0 */ /* b(3,3) */
  46.  
  47.  2.03240740740740740741E0, /* 439.0/216.0 */ /* b(1,4) */
  48. -8.00000000000000000000E0, /* -8.0 */
  49.  7.17348927875243664717E0, /* 3680.0/513.0 */
  50. -2.05896686159844054581E-1, /* -845.0/4104.0 */
  51.  
  52. -2.96296296296296296296E-1, /* -8.0/27.0 */ /* b(1,5) */
  53.  2.00000000000000000000E0, /* 2.0 */
  54. -1.38167641325536062378E0, /* -3544.0/2565.0 */
  55.  4.52972709551656920078E-1, /* 1859.0/4104.0 */
  56. -2.75000000000000000000E-1, /* -11.0/40.0 */ /* b(5,5) */
  57. };
  58.  
  59. #if ERRTERM
  60. DOUBLE er[6] = {
  61.  2.77777777777777777778E-3, /* 1.0/360.0 */
  62.  0.00000000000000000000E0, /* 0.0 */
  63. -2.99415204678362573099E-2, /* -384.0/12825.0 */
  64. -2.91998936735778841042E-2, /* -41743.0/1429560.0 */
  65.  2.00000000000000000000E-2, /* 1.0/50.0 */
  66.  3.63636363636363636364E-2, /* 2.0/55.0 */
  67. };
  68. #endif
  69.  
  70. DOUBLE runga[6] = {
  71.  1.18518518518518518519E-1, /* 16.0/135.0 */
  72.  0.00000000000000000000E0, /* 0.0 */
  73.  5.18986354775828460039E-1, /* 6656.0/12825.0 */
  74.  5.06131490342016657806E-1, /* 28561.0/56430.0 */
  75. -1.80000000000000000000E-1, /* -9.0/50.0 */
  76.  3.63636363636363636364E-2, /* 2.0/55.0 */
  77. };
  78. #endif /* UNK */
  79.  
  80. #if DEC
  81. short rungal[20] = {
  82. 0037600,0000000,0000000,0000000,
  83. 0037700,0000000,0000000,0000000,
  84. 0040154,0047304,0166116,0142354,
  85. 0040200,0000000,0000000,0000000,
  86. 0040000,0000000,0000000,0000000,
  87. };
  88. short rungb[60] = {
  89. 0037600,0000000,0000000,0000000,
  90. 0037300,0000000,0000000,0000000,
  91. 0037620,0000000,0000000,0000000,
  92. 0040141,0017434,0106113,0005137,
  93. 0140521,0136625,0004105,0164734,
  94. 0040524,0104577,0020106,0154200,
  95. 0040402,0011366,0102275,0120457,
  96. 0141000,0000000,0000000,0000000,
  97. 0040745,0106471,0061516,0054324,
  98. 0137522,0153224,0132645,0026551,
  99. 0137627,0132045,0166411,0075502,
  100. 0040400,0000000,0000000,0000000,
  101. 0140260,0155305,0150113,0006654,
  102. 0037747,0166011,0175402,0077301,
  103. 0137614,0146314,0146314,0146315,
  104. };
  105. #if ERRTERM
  106. short runger[24] = {
  107. 0036066,0005540,0133013,0060266,
  108. 0000000,0000000,0000000,0000000,
  109. 0136765,0043753,0063165,0135345,
  110. 0136757,0032235,0105775,0077355,
  111. 0036643,0153412,0036560,0121727,
  112. 0037024,0171011,0047440,0112362,
  113. };
  114. #endif
  115. short runga[24] = {
  116. 0037362,0134726,0044017,0025635,
  117. 0000000,0000000,0000000,0000000,
  118. 0040004,0156112,0026325,0015221,
  119. 0040001,0110725,0053176,0122300,
  120. 0137470,0050753,0102436,0134122,
  121. 0037024,0171011,0047440,0112362,
  122. };
  123. #endif /* DEC */
  124.  
  125. #if IBMPC
  126. short rungal[20] = {
  127. 0x0000,0x0000,0x0000,0x3fd0,
  128. 0x0000,0x0000,0x0000,0x3fd8,
  129. 0xd89e,0x9d89,0x89d8,0x3fed,
  130. 0x0000,0x0000,0x0000,0x3ff0,
  131. 0x0000,0x0000,0x0000,0x3fe0,
  132. };
  133. short rungb[60] = {
  134. 0x0000,0x0000,0x0000,0x3fd0,
  135. 0x0000,0x0000,0x0000,0x3fb8,
  136. 0x0000,0x0000,0x0000,0x3fd2,
  137. 0x614c,0x9189,0x23e3,0x3fec,
  138. 0xbd3c,0xa108,0x37b2,0xc00a,
  139. 0xdb10,0xe408,0x912f,0x400a,
  140. 0xb426,0xd097,0x425e,0x4000,
  141. 0x0000,0x0000,0x0000,0xc020,
  142. 0xcb1a,0x2c69,0xb1a7,0x401c,
  143. 0xa5ad,0x96b4,0x5ad2,0xbfca,
  144. 0x2f68,0xbda1,0xf684,0xbfd2,
  145. 0x0000,0x0000,0x0000,0x4000,
  146. 0x61b6,0xba09,0x1b58,0xbff6,
  147. 0x4fd8,0x3f60,0xfd81,0x3fdc,
  148. 0x999a,0x9999,0x9999,0xbfd1,
  149. };
  150. #if ERRTERM
  151. short runger[24] = {
  152. 0x6c17,0x16c1,0xc16c,0x3f66,
  153. 0x0000,0x0000,0x0000,0x0000,
  154. 0xb75d,0x6cce,0xa8fd,0xbf9e,
  155. 0xafde,0xb17f,0xe693,0xbf9d,
  156. 0x147b,0x47ae,0x7ae1,0x3f94,
  157. 0x129e,0x29e4,0x9e41,0x3fa2,
  158. };
  159. #endif
  160. short runga[24] = {
  161. 0xe574,0xc901,0x573a,0x3fbe,
  162. 0x0000,0x0000,0x0000,0x0000,
  163. 0xa352,0x459a,0x9b89,0x3fe0,
  164. 0xd498,0xaacf,0x323a,0x3fe0,
  165. 0xd70a,0x70a3,0x0a3d,0xbfc7,
  166. 0x129e,0x29e4,0x9e41,0x3fa2,
  167. };
  168. #endif /* IBMPC */
  169.  
  170. #if MIEEE
  171. short rungal[20] = {
  172. 0x3fd0,0x0000,0x0000,0x0000,
  173. 0x3fd8,0x0000,0x0000,0x0000,
  174. 0x3fed,0x89d8,0x9d89,0xd89e,
  175. 0x3ff0,0x0000,0x0000,0x0000,
  176. 0x3fe0,0x0000,0x0000,0x0000,
  177. };
  178. short rungb[60] = {
  179. 0x3fd0,0x0000,0x0000,0x0000,
  180. 0x3fb8,0x0000,0x0000,0x0000,
  181. 0x3fd2,0x0000,0x0000,0x0000,
  182. 0x3fec,0x23e3,0x9189,0x614c,
  183. 0xc00a,0x37b2,0xa108,0xbd3c,
  184. 0x400a,0x912f,0xe408,0xdb10,
  185. 0x4000,0x425e,0xd097,0xb426,
  186. 0xc020,0x0000,0x0000,0x0000,
  187. 0x401c,0xb1a7,0x2c69,0xcb1a,
  188. 0xbfca,0x5ad2,0x96b4,0xa5ad,
  189. 0xbfd2,0xf684,0xbda1,0x2f68,
  190. 0x4000,0x0000,0x0000,0x0000,
  191. 0xbff6,0x1b58,0xba09,0x61b6,
  192. 0x3fdc,0xfd81,0x3f60,0x4fd8,
  193. 0xbfd1,0x9999,0x9999,0x999a,
  194. };
  195. #if ERRTERM
  196. short runger[24] = {
  197. 0x3f66,0xc16c,0x16c1,0x6c17,
  198. 0x0000,0x0000,0x0000,0x0000,
  199. 0xbf9e,0xa8fd,0x6cce,0xb75d,
  200. 0xbf9d,0xe693,0xb17f,0xafde,
  201. 0x3f94,0x7ae1,0x47ae,0x147b,
  202. 0x3fa2,0x9e41,0x29e4,0x129e,
  203. };
  204. #endif
  205. short runga[24] = {
  206. 0x3fbe,0x573a,0xc901,0xe574,
  207. 0x0000,0x0000,0x0000,0x0000,
  208. 0x3fe0,0x9b89,0x459a,0xa352,
  209. 0x3fe0,0x323a,0xaacf,0xd498,
  210. 0xbfc7,0x0a3d,0x70a3,0xd70a,
  211. 0x3fa2,0x9e41,0x29e4,0x129e,
  212. };
  213. #endif /* MIEEE */
  214. #endif
  215.  
  216. #if !(ORDER-5)
  217. /*
  218. Fifth order Runge-Kutta method specified by
  219. Verner J.H., SIAM J. Numer. Anal. V15,(1978),p772.(table 5)
  220. */
  221. #define INUM 8
  222. #define HMAXL ((DOUBLE )1.0)
  223. #define HLIM1 ((DOUBLE )4.0)
  224.  
  225. #if UNK
  226. DOUBLE rungal[7] = {
  227.  5.55555555555555555556E-2, /* 1.0/18.0 */
  228.  1.66666666666666666667E-1, /* 1.0/6.0 */
  229.  2.22222222222222222222E-1, /* 2.0/9.0 */
  230.  6.66666666666666666667E-1, /* 2.0/3.0 */
  231.  1.00000000000000000000E0, /* 1.0 */
  232.  8.88888888888888888889E-1, /* 8.0/9.0 */
  233.  1.00000000000000000000E0, /* 1.0 */
  234. };
  235.  
  236. DOUBLE rungb[28] = {
  237.  5.55555555555555555556E-2, /* 1.0/18.0 */ /* b(1,1) */
  238.  
  239. -8.33333333333333333333E-2, /* -1.0/12.0 */ /* b(1,2) */
  240.  2.50000000000000000000E-1, /* 1.0/4.0 */
  241.  
  242. -2.46913580246913580247E-2, /* -2.0/81.0 */ /* b(1,3) */
  243.  1.48148148148148148148E-1, /* 4.0/27.0 */
  244.  9.87654320987654320988E-2, /* 8.0/81.0 */
  245.  
  246.  1.21212121212121212121E0, /* 40.0/33.0 */ /* b(1,4) */
  247. -3.63636363636363636364E-1, /* -4.0/11.0 */
  248. -5.09090909090909090909E0, /* -56.0/11.0 */
  249.  4.90909090909090909091E0, /* 54.0/11.0 */
  250.  
  251. -5.05479452054794520548E0, /* -369.0/73.0 */ /* b(1,5) */
  252.  9.86301369863013698630E-1, /* 72.0/73.0 */
  253.  2.45662100456621004566E1, /* 5380.0/219.0 */
  254. -2.10359589041095890411E1, /* -12285.0/584.0 */
  255.  1.53824200913242009132E0, /* 2695.0/1752.0 */
  256.  
  257. -9.78226711560044893378E0, /* -8716.0/891.0 */ /* b(1,6) */
  258.  2.20875420875420875421E0, /* 656.0/297.0 */
  259.  4.43546576879910213244E1, /* 39520.0/891.0 */
  260. -3.78181818181818181818E1, /* -416.0/11.0 */
  261.  1.92592592592592592593E0, /* 52.0/27.0 */
  262.  0.00000000000000000000E0, /* 0.0 */
  263.  
  264.  1.17773437500000000000E1, /* 3015.0/256.0 */ /* b(1,7) */
  265. -2.25000000000000000000E0, /* -9.0/4.0 */
  266. -5.40897435897435897436E1, /* -4219.0/78.0 */
  267.  4.67578125000000000000E1, /* 5985.0/128.0 */
  268. -1.40364583333333333333E0, /* -539.0/384.0 */
  269.  0.00000000000000000000E0, /* 0.0 */
  270.  2.08233173076923076923E-1, /* 693.0/3328.0 */
  271. };
  272.  
  273. #if ERRTERM
  274. DOUBLE runger[8] = {
  275.  5.15625000000000000000E-2, /* 33.0/640.0 */
  276.  0.00000000000000000000E0, /* 0.0 */
  277. -4.06153846153846153846E-1, /* -132.0/325.0 */
  278.  3.97767857142857142857E-1, /* 891.0/2240.0 */
  279. -1.03125000000000000000E-1, /* -33.0/320.0 */
  280. -1.04285714285714285714E-1, /* -73.0/700.0 */
  281.  1.07091346153846153846E-1, /* 891.0/8320.0 */
  282.  5.71428571428571428571E-2, /* 2.0/35.0 */
  283. };
  284. #endif
  285.  
  286. DOUBLE runga[8] = {
  287.  8.90625000000000000000E-2, /* 57.0/640.0 */
  288.  0.00000000000000000000E0, /* 0.0 */
  289. -2.46153846153846153846E-1, /* -16.0/65.0 */
  290.  6.14732142857142857143E-1, /* 1377.0/2240.0 */
  291.  3.78125000000000000000E-1, /* 121.0/320.0 */
  292.  0.00000000000000000000E0, /* 0.0 */
  293.  1.07091346153846153846E-1, /* 891.0/8320.0 */
  294.  5.71428571428571428571E-2, /* 2.0/35.0 */
  295. };
  296. #endif /* UNK */
  297.  
  298. #if DEC
  299. short rungal[28] = {
  300. 0037143,0107070,0161616,0034344,
  301. 0037452,0125252,0125252,0125253,
  302. 0037543,0107070,0161616,0034344,
  303. 0040052,0125252,0125252,0125253,
  304. 0040200,0000000,0000000,0000000,
  305. 0040143,0107070,0161616,0034344,
  306. 0040200,0000000,0000000,0000000,
  307. };
  308.  
  309. short rungb[112] = {
  310. 0037143,0107070,0161616,0034344,
  311.  
  312. 0137252,0125252,0125252,0125253,
  313. 0037600,0000000,0000000,0000000,
  314.  
  315. 0136712,0042607,0163267,0047403,
  316. 0037427,0132045,0166411,0075502,
  317. 0037312,0042607,0163267,0047403,
  318.  
  319. 0040233,0023311,0131154,0115447,
  320. 0137672,0027213,0121350,0135057,
  321. 0140642,0164272,0027213,0121351,
  322. 0040635,0013505,0150564,0056427,
  323.  
  324. 0140641,0140340,0070070,0016016,
  325. 0040174,0077077,0017617,0143744,
  326. 0041304,0103631,0020746,0044172,
  327. 0141250,0044644,0151151,0032232,
  328. 0040304,0162435,0034507,0047122,
  329.  
  330. 0141034,0102052,0102743,0153707,
  331. 0040415,0056072,0116340,0015625,
  332. 0041461,0065453,0061214,0144437,
  333. 0141427,0042721,0072135,0013506,
  334. 0040366,0102275,0120457,0064114,
  335. 0000000,0000000,0000000,0000000,
  336.  
  337. 0041074,0070000,0000000,0000000,
  338. 0140420,0000000,0000000,0000000,
  339. 0141530,0055745,0137133,0162676,
  340. 0041473,0004000,0000000,0000000,
  341. 0140263,0125252,0125252,0125253,
  342. 0000000,0000000,0000000,0000000,
  343. 0037525,0035423,0130473,0011661,
  344. };
  345.  
  346. #if ERRTERM
  347. short runger[8] = {
  348. 0037123,0031463,0031463,0031463,
  349. 0000000,0000000,0000000,0000000,
  350. 0137717,0171545,0116300,0031152,
  351. 0037713,0124072,0101650,0035204,
  352. 0137323,0031463,0031463,0031463,
  353. 0137325,0111677,0121140,0106157,
  354. 0037333,0051265,0025522,0132453,
  355. 0037152,0007240,0165016,0120352,
  356. };
  357. #endif
  358.  
  359. short runga[32] = {
  360. 0037266,0063146,0063146,0063146,
  361. 0000000,0000000,0000000,0000000,
  362. 0137574,0007700,0176017,0140374,
  363. 0040035,0057425,0170537,0012761,
  364. 0037701,0114631,0114631,0114632,
  365. 0000000,0000000,0000000,0000000,
  366. 0037333,0051265,0025522,0132453,
  367. 0037152,0007240,0165016,0120352,
  368. };
  369. #endif /* DEC */
  370.  
  371. #if IBMPC
  372. short rungal[28] = {
  373. 0xc71c,0x1c71,0x71c7,0x3fac,
  374. 0x5555,0x5555,0x5555,0x3fc5,
  375. 0xc71c,0x1c71,0x71c7,0x3fcc,
  376. 0x5555,0x5555,0x5555,0x3fe5,
  377. 0x0000,0x0000,0x0000,0x3ff0,
  378. 0xc71c,0x1c71,0x71c7,0x3fec,
  379. 0x0000,0x0000,0x0000,0x3ff0,
  380. };
  381.  
  382. short rungb[112] = {
  383. 0xc71c,0x1c71,0x71c7,0x3fac,
  384.  
  385. 0x5555,0x5555,0x5555,0xbfb5,
  386. 0x0000,0x0000,0x0000,0x3fd0,
  387.  
  388. 0xe9e0,0xfcd6,0x48b0,0xbf99,
  389. 0x2f68,0xbda1,0xf684,0x3fc2,
  390. 0xe9e0,0xfcd6,0x48b0,0x3fb9,
  391.  
  392. 0x9365,0x364d,0x64d9,0x3ff3,
  393. 0x1746,0x745d,0x45d1,0xbfd7,
  394. 0x745d,0x45d1,0x5d17,0xc014,
  395. 0x8ba3,0xba2e,0xa2e8,0x4013,
  396.  
  397. 0x0382,0x0e07,0x381c,0xc014,
  398. 0xf8fc,0xe3f1,0x8fc7,0x3fef,
  399. 0xc90f,0x243c,0x90f3,0x4038,
  400. 0x2693,0x9a4d,0x0934,0xc035,
  401. 0xe9ca,0xa728,0x9ca3,0x3ff8,
  402.  
  403. 0x7af9,0x50bc,0x9085,0xc023,
  404. 0x0373,0x539c,0xab87,0x4001,
  405. 0x9924,0x6c51,0x2d65,0x4046,
  406. 0xa2e9,0x2e8b,0xe8ba,0xc042,
  407. 0xed09,0xb425,0xd097,0x3ffe,
  408. 0x0000,0x0000,0x0000,0x0000,
  409.  
  410. 0x0000,0x0000,0x8e00,0x4027,
  411. 0x0000,0x0000,0x0000,0xc002,
  412. 0x7cb8,0xb7cb,0x0b7c,0xc04b,
  413. 0x0000,0x0000,0x6100,0x4047,
  414. 0x5555,0x5555,0x7555,0xbff6,
  415. 0x0000,0x0000,0x0000,0x0000,
  416. 0x6276,0x7627,0xa762,0x3fca,
  417. };
  418.  
  419. #if ERRTERM
  420. short runger[8] = {
  421. 0x6666,0x6666,0x6666,0x3faa,
  422. 0x0000,0x0000,0x0000,0x0000,
  423. 0x064d,0xb398,0xfe6c,0xbfd9,
  424. 0x0750,0x5075,0x7507,0x3fd9,
  425. 0x6666,0x6666,0x6666,0xbfba,
  426. 0x118e,0xf44c,0xb277,0xbfba,
  427. 0x56a5,0xa56a,0x6a56,0x3fbb,
  428. 0xd41d,0x1d41,0x41d4,0x3fad,
  429. };
  430. #endif
  431.  
  432. short runga[32] = {
  433. 0xcccd,0xcccc,0xcccc,0x3fb6,
  434. 0x0000,0x0000,0x0000,0x0000,
  435. 0xf820,0x1f81,0x81f8,0xbfcf,
  436. 0xe2be,0xbe2b,0xabe2,0x3fe3,
  437. 0x3333,0x3333,0x3333,0x3fd8,
  438. 0x0000,0x0000,0x0000,0x0000,
  439. 0x56a5,0xa56a,0x6a56,0x3fbb,
  440. 0xd41d,0x1d41,0x41d4,0x3fad,
  441. };
  442. #endif /* IBMPC */
  443.  
  444.  
  445. #if MIEEE
  446. short rungal[28] = {
  447. 0x3fac,0x71c7,0x1c71,0xc71c,
  448. 0x3fc5,0x5555,0x5555,0x5555,
  449. 0x3fcc,0x71c7,0x1c71,0xc71c,
  450. 0x3fe5,0x5555,0x5555,0x5555,
  451. 0x3ff0,0x0000,0x0000,0x0000,
  452. 0x3fec,0x71c7,0x1c71,0xc71c,
  453. 0x3ff0,0x0000,0x0000,0x0000,
  454. };
  455.  
  456. short rungb[112] = {
  457. 0x3fac,0x71c7,0x1c71,0xc71c,
  458.  
  459. 0xbfb5,0x5555,0x5555,0x5555,
  460. 0x3fd0,0x0000,0x0000,0x0000,
  461.  
  462. 0xbf99,0x48b0,0xfcd6,0xe9e0,
  463. 0x3fc2,0xf684,0xbda1,0x2f68,
  464. 0x3fb9,0x48b0,0xfcd6,0xe9e0,
  465.  
  466. 0x3ff3,0x64d9,0x364d,0x9365,
  467. 0xbfd7,0x45d1,0x745d,0x1746,
  468. 0xc014,0x5d17,0x45d1,0x745d,
  469. 0x4013,0xa2e8,0xba2e,0x8ba3,
  470.  
  471. 0xc014,0x381c,0x0e07,0x0382,
  472. 0x3fef,0x8fc7,0xe3f1,0xf8fc,
  473. 0x4038,0x90f3,0x243c,0xc90f,
  474. 0xc035,0x0934,0x9a4d,0x2693,
  475. 0x3ff8,0x9ca3,0xa728,0xe9ca,
  476.  
  477. 0xc023,0x9085,0x50bc,0x7af9,
  478. 0x4001,0xab87,0x539c,0x0373,
  479. 0x4046,0x2d65,0x6c51,0x9924,
  480. 0xc042,0xe8ba,0x2e8b,0xa2e9,
  481. 0x3ffe,0xd097,0xb425,0xed09,
  482. 0x0000,0x0000,0x0000,0x0000,
  483.  
  484. 0x4027,0x8e00,0x0000,0x0000,
  485. 0xc002,0x0000,0x0000,0x0000,
  486. 0xc04b,0x0b7c,0xb7cb,0x7cb8,
  487. 0x4047,0x6100,0x0000,0x0000,
  488. 0xbff6,0x7555,0x5555,0x5555,
  489. 0x0000,0x0000,0x0000,0x0000,
  490. 0x3fca,0xa762,0x7627,0x6276,
  491. };
  492.  
  493. #if ERRTERM
  494. short runger[8] = {
  495. 0x3faa,0x6666,0x6666,0x6666,
  496. 0x0000,0x0000,0x0000,0x0000,
  497. 0xbfd9,0xfe6c,0xb398,0x064d,
  498. 0x3fd9,0x7507,0x5075,0x0750,
  499. 0xbfba,0x6666,0x6666,0x6666,
  500. 0xbfba,0xb277,0xf44c,0x118e,
  501. 0x3fbb,0x6a56,0xa56a,0x56a5,
  502. 0x3fad,0x41d4,0x1d41,0xd41d,
  503. };
  504. #endif
  505.  
  506. short runga[8] = {
  507. 0x3fb6,0xcccc,0xcccc,0xcccd,
  508. 0x0000,0x0000,0x0000,0x0000,
  509. 0xbfcf,0x81f8,0x1f81,0xf820,
  510. 0x3fe3,0xabe2,0xbe2b,0xe2be,
  511. 0x3fd8,0x3333,0x3333,0x3333,
  512. 0x0000,0x0000,0x0000,0x0000,
  513. 0x3fbb,0x6a56,0xa56a,0x56a5,
  514. 0x3fad,0x41d4,0x1d41,0xd41d,
  515. };
  516. #endif /* MIEEE */
  517. #endif
  518.  
  519. #if !(ORDER-7)
  520. /*
  521. Seventh order Runge-Kutta method specified by
  522. Verner J.H., SIAM J. Numer. Anal. V15,(1978),p772.(table 7)
  523. */
  524. #if UNK
  525. DOUBLE rungal[12] = {
  526.  2.50000000000000000000E-1, /* 1.0/4.0 */
  527.  8.33333333333333333333E-2, /* 1.0/12.0 */
  528.  1.25000000000000000000E-1, /* 1.0/8.0 */
  529.  4.00000000000000000000E-1, /* 2.0/5.0 */
  530.  5.00000000000000000000E-1, /* 1.0/2.0 */
  531.  8.57142857142857142857E-1, /* 6.0/7.0 */
  532.  1.42857142857142857143E-1, /* 1.0/7.0 */
  533.  6.66666666666666666667E-1, /* 2.0/3.0 */
  534.  2.85714285714285714286E-1, /* 2.0/7.0 */
  535.  1.00000000000000000000E0, /* 1.0 */
  536.  3.33333333333333333333E-1, /* 1.0/3.0 */
  537.  1.00000000000000000000E0, /* 1.0 */
  538. };
  539.  
  540. DOUBLE rungb[78] = {
  541.  2.50000000000000000000E-1, /* 1.0/4.0 */ /* b(1,1) */
  542.  
  543.  6.94444444444444444444E-2, /* 5.0/72.0 */ /* b(1,2) */
  544.  1.38888888888888888889E-2, /* 1.0/72.0 */
  545.  
  546.  3.12500000000000000000E-2, /* 1.0/32.0 */ /* b(1,3) */
  547.  0.00000000000000000000E0, /* 0.0 */
  548.  9.37500000000000000000E-2, /* 3.0/32.0 */
  549.  
  550.  8.48000000000000000000E-1, /* 106.0/125.0 */ /* b(1,4) */
  551.  0.00000000000000000000E0, /* 0.0 */
  552. -3.26400000000000000000E0, /* -408.0/125.0 */
  553.  2.81600000000000000000E0, /* 352.0/125.0 */
  554.  
  555.  2.08333333333333333333E-2, /* 1.0/48.0 */ /* b(1,5) */
  556.  0.00000000000000000000E0, /* 0.0 */
  557.  0.00000000000000000000E0, /* 0.0 */
  558.  2.42424242424242424242E-1, /* 8.0/33.0 */
  559.  2.36742424242424242424E-1, /* 125.0/528.0 */
  560.  
  561. -5.26030820491461890879E-1, /* -1263.0/2401.0 */ /* b(1,6) */
  562.  0.00000000000000000000E0, /* 0.0 */
  563.  0.00000000000000000000E0, /* 0.0 */
  564.  1.51209723221385028965E0, /* 39936.0/26411.0 */
  565. -2.42796562038544545833E0, /* -64125.0/26411.0 */
  566.  2.29904206580591420242E0, /* 5520.0/2401.0 */
  567.  
  568.  9.43877551020408163265E-2, /* 37.0/392.0 */ /* b(1,7) */
  569.  0.00000000000000000000E0, /* 0.0 */
  570.  0.00000000000000000000E0, /* 0.0 */
  571.  0.00000000000000000000E0, /* 0.0 */
  572.  1.72725340136054421769E-1, /* 1625.0/9408.0 */
  573. -1.33333333333333333333E-1, /* -2.0/15.0 */
  574.  9.07738095238095238095E-3, /* 61.0/6720.0 */
  575.  
  576.  6.73172643543013913384E-1, /* 17176.0/25515.0 */ /* b(1,8) */
  577.  0.00000000000000000000E0, /* 0.0 */
  578.  0.00000000000000000000E0, /* 0.0 */
  579. -1.84612972761120909269E0, /* -47104.0/25515.0 */
  580.  2.62896825396825396825E0, /* 1325.0/504.0 */
  581. -1.63793846756809719773E0, /* -41792.0/25515.0 */
  582.  1.38799725651577503429E-1, /* 20237.0/145800.0 */
  583.  7.09794238683127572016E-1, /* 4312.0/6075.0 */
  584.  
  585. -1.32355962793280577537E-1, /* -23834.0/180075.0 */ /* b(1,9) */
  586.  0.00000000000000000000E0, /* 0.0 */
  587.  0.00000000000000000000E0, /* 0.0 */
  588. -3.92886802216248280388E-2, /* -77824.0/1980825.0 */
  589. -1.00437160021708126664E0, /* -636635.0/633864.0 */
  590.  8.46473969179508538109E-1, /* 254048.0/300125.0 */
  591. -2.61428571428571428571E-2, /* -183.0/7000.0 */
  592.  7.27272727272727272727E-1, /* 8.0/11.0 */
  593. -8.58733103631062814736E-2, /* -324.0/3773.0 */
  594.  
  595.  1.67539473684210526316E0, /* 12733.0/7600.0 */ /* b(1,10) */
  596.  0.00000000000000000000E0, /* 0.0 */
  597.  0.00000000000000000000E0, /* 0.0 */
  598. -3.83387559808612440191E0, /* -20032.0/5225.0 */
  599.  5.68786134370015948963E0, /* 456485.0/80256.0 */
  600. -5.97880701754385964912E0, /* -42599.0/7125.0 */
  601.  3.71959429824561403509E-1, /* 339227.0/912000.0 */
  602. -2.46172248803827751196E-1, /* -1029.0/4180.0 */
  603.  1.20809659090909090909E0, /* 1701.0/1408.0 */
  604.  2.11554276315789473684E0, /* 5145.0/2432.0 */
  605.  
  606. -1.32573976092494611013E-1, /* -27061.0/204120.0 */ /* b(1,11) */
  607.  0.00000000000000000000E0, /* 0.0 */
  608.  0.00000000000000000000E0, /* 0.0 */
  609.  1.44114870040795966722E-1, /* 40448.0/280665.0 */
  610. -1.13049726765004542782E0, /* -1353775.0/1197504.0 */
  611.  6.92220262590632961003E-1, /* 17662.0/25515.0 */
  612. -6.14600480109739368999E-2, /* -71687.0/1166400.0 */
  613.  4.35555555555555555556E-1, /* 98.0/225.0 */
  614.  6.25000000000000000000E-2, /* 1.0/16.0 */
  615.  3.23473936899862825789E-1, /* 3773.0/11664.0 */
  616.  0.00000000000000000000E0, /* 0.0 */
  617.  
  618.  1.29066820276497695853E0, /* 11203.0/8680.0 */ /* b(1,12) */
  619.  0.00000000000000000000E0, /* 0.0 */
  620.  0.00000000000000000000E0, /* 0.0 */
  621. -3.19597821533305404273E0, /* -38144.0/11935.0 */
  622.  5.13725605711492808267E0, /* 2354425.0/458304.0 */
  623. -5.16411674347158218126E0, /* -84046.0/16275.0 */
  624.  4.11356915933528836755E-1, /* 673309.0/1636800.0 */
  625.  5.51788856304985337243E-1, /* 4704.0/8525.0 */
  626.  8.68493401759530791789E-1, /* 9477.0/10912.0 */
  627. -1.03729838709677419355E0, /* -1029.0/992.0 */
  628.  0.00000000000000000000E0, /* 0.0 */
  629.  2.13782991202346041056E0, /* 729.0/341.0 */ /* b(12,12) */
  630. };
  631. #if ERRTERM
  632. DOUBLE runger[13] = {
  633. -2.08333333333333333333E-3, /* -1.0/480.0 */
  634.  0.00000000000000000000E0, /* 0.0 */
  635.  0.00000000000000000000E0, /* 0.0 */
  636.  0.00000000000000000000E0, /* 0.0 */
  637.  0.00000000000000000000E0, /* 0.0 */
  638. -4.26666666666666666667E-2, /* -16.0/375.0 */
  639. -4.54734848484848484848E-3, /* -2401.0/528000.0 */
  640.  1.81893939393939393939E-2, /* 2401.0/132000.0 */
  641.  1.72585227272727272727E-2, /* 243.0/14080.0 */
  642. -1.25052083333333333333E-1, /* -2401.0/19200.0 */
  643. -4.22222222222222222222E-2, /* -19.0/450.0 */
  644.  1.38068181818181818182E-1, /* 243.0/1760.0 */
  645.  4.30555555555555555556E-2, /* 31.0/720.0 */
  646. };
  647. #endif
  648. DOUBLE runga[13] = {
  649.  4.30555555555555555556E-2, /* 31.0/720.0 */
  650.  0.00000000000000000000E0, /* 0.0 */
  651.  0.00000000000000000000E0, /* 0.0 */
  652.  0.00000000000000000000E0, /* 0.0 */
  653.  0.00000000000000000000E0, /* 0.0 */
  654.  2.13333333333333333333E-1, /* 16.0/75.0 */
  655.  2.12209595959595959596E-1, /* 16807.0/79200.0 */
  656.  2.12209595959595959596E-1, /* 16807.0/79200.0 */
  657.  1.38068181818181818182E-1, /* 243.0/1760.0 */
  658.  0.00000000000000000000E0, /* 0.0 */
  659.  0.00000000000000000000E0, /* 0.0 */
  660.  1.38068181818181818182E-1, /* 243.0/1760.0 */
  661.  4.30555555555555555556E-2, /* 31.0/720.0 */
  662. };
  663. #endif /* UNK */
  664.  
  665. #if DEC
  666. short rungal[48] = {
  667. 0037600,0000000,0000000,0000000,
  668. 0037252,0125252,0125252,0125253,
  669. 0037400,0000000,0000000,0000000,
  670. 0037714,0146314,0146314,0146315,
  671. 0040000,0000000,0000000,0000000,
  672. 0040133,0066666,0155555,0133333,
  673. 0037422,0044444,0111111,0022222,
  674. 0040052,0125252,0125252,0125253,
  675. 0037622,0044444,0111111,0022222,
  676. 0040200,0000000,0000000,0000000,
  677. 0037652,0125252,0125252,0125253,
  678. 0040200,0000000,0000000,0000000,
  679. };
  680.  
  681. short rungb[312] = {
  682. 0037600,0000000,0000000,0000000,
  683.  
  684. 0037216,0034343,0107070,0161616,
  685. 0036543,0107070,0161616,0034344,
  686.  
  687. 0037000,0000000,0000000,0000000,
  688. 0000000,0000000,0000000,0000000,
  689. 0037300,0000000,0000000,0000000,
  690.  
  691. 0040131,0013207,0025402,0006112,
  692. 0000000,0000000,0000000,0000000,
  693. 0140520,0162540,0040611,0033514,
  694. 0040464,0034530,0010142,0046723,
  695.  
  696. 0036652,0125252,0125252,0125253,
  697. 0000000,0000000,0000000,0000000,
  698. 0000000,0000000,0000000,0000000,
  699. 0037570,0037017,0101740,0174076,
  700. 0037562,0066233,0023311,0131155,
  701.  
  702. 0140006,0124764,0131262,0164601,
  703. 0000000,0000000,0000000,0000000,
  704. 0000000,0000000,0000000,0000000,
  705. 0040301,0106146,0170135,0102164,
  706. 0140433,0061711,0164727,0105255,
  707. 0040423,0021601,0052460,0170212,
  708.  
  709. 0037301,0047136,0005162,0170124,
  710. 0000000,0000000,0000000,0000000,
  711. 0000000,0000000,0000000,0000000,
  712. 0000000,0000000,0000000,0000000,
  713. 0037460,0157351,0056114,0120070,
  714. 0137410,0104210,0104210,0104211,
  715. 0036424,0134513,0112271,0045625,
  716.  
  717. 0040054,0052412,0154224,0040223,
  718. 0000000,0000000,0000000,0000000,
  719. 0000000,0000000,0000000,0000000,
  720. 0140354,0046772,0115041,0135544,
  721. 0040450,0040404,0010101,0002020,
  722. 0140321,0123767,0135610,0056336,
  723. 0037416,0020603,0164570,0016341,
  724. 0040065,0132423,0041010,0101444,
  725.  
  726. 0137407,0104122,0047202,0146151,
  727. 0000000,0000000,0000000,0000000,
  728. 0000000,0000000,0000000,0000000,
  729. 0137040,0166452,0145172,0062047,
  730. 0140200,0107477,0121773,0052640,
  731. 0040130,0131204,0117212,0111266,
  732. 0136726,0024613,0107173,0073424,
  733. 0040072,0027213,0121350,0135057,
  734. 0137257,0157130,0116336,0151063,
  735.  
  736. 0040326,0071525,0130520,0046634,
  737. 0000000,0000000,0000000,0000000,
  738. 0000000,0000000,0000000,0000000,
  739. 0140565,0057067,0140655,0113415,
  740. 0040666,0001365,0145353,0177136,
  741. 0140677,0051143,0014056,0043422,
  742. 0037676,0070567,0062422,0011235,
  743. 0137574,0012223,0173456,0046354,
  744. 0040232,0121350,0135056,0105643,
  745. 0040407,0062415,0074503,0057121,
  746.  
  747. 0137407,0140570,0167170,0143762,
  748. 0000000,0000000,0000000,0000000,
  749. 0000000,0000000,0000000,0000000,
  750. 0037423,0111331,0033305,0020413,
  751. 0140220,0132042,0066143,0016144,
  752. 0040061,0032530,0156564,0107230,
  753. 0137173,0136610,0001573,0145404,
  754. 0037737,0000443,0042547,0104654,
  755. 0037200,0000000,0000000,0000000,
  756. 0037645,0117140,0034057,0141062,
  757. 0000000,0000000,0000000,0000000,
  758.  
  759. 0040245,0032235,0116156,0066020,
  760. 0000000,0000000,0000000,0000000,
  761. 0000000,0000000,0000000,0000000,
  762. 0140514,0105350,0033145,0057324,
  763. 0040644,0062146,0150217,0110633,
  764. 0140645,0040161,0140675,0173612,
  765. 0037722,0116537,0124725,0175235,
  766. 0040015,0041010,0152040,0106502,
  767. 0040136,0052625,0062531,0053126,
  768. 0140204,0143061,0106143,0014306,
  769. 0000000,0000000,0000000,0000000,
  770. 0040410,0151064,0106443,0044322,
  771. };
  772. #if ERRTERM
  773. short runger[52] = {
  774. 0136010,0104210,0104210,0104211,
  775. 0000000,0000000,0000000,0000000,
  776. 0000000,0000000,0000000,0000000,
  777. 0000000,0000000,0000000,0000000,
  778. 0000000,0000000,0000000,0000000,
  779. 0137056,0141476,0017547,0012452,
  780. 0136225,0000754,0101521,0175550,
  781. 0036625,0000754,0101521,0175550,
  782. 0036615,0060676,0153033,0166542,
  783. 0137400,0006647,0040332,0072016,
  784. 0137054,0170465,0074676,0001107,
  785. 0037415,0060676,0153033,0166542,
  786. 0037060,0055405,0130133,0002660,
  787. };
  788. #endif
  789. short runga[52] = {
  790. 0037060,0055405,0130133,0002660,
  791. 0000000,0000000,0000000,0000000,
  792. 0000000,0000000,0000000,0000000,
  793. 0000000,0000000,0000000,0000000,
  794. 0000000,0000000,0000000,0000000,
  795. 0037532,0072015,0123500,0155164,
  796. 0037531,0046570,0165054,0161770,
  797. 0037531,0046570,0165054,0161770,
  798. 0037415,0060676,0153033,0166542,
  799. 0000000,0000000,0000000,0000000,
  800. 0000000,0000000,0000000,0000000,
  801. 0037415,0060676,0153033,0166542,
  802. 0037060,0055405,0130133,0002660,
  803. };
  804. #endif /* DEC */
  805.  
  806. #if LDOUBLE
  807. #if IBMPC
  808. short rungal[] = {
  809. 0x0000,0x0000,0x0000,0x8000,0x3ffd, XPD
  810. 0xaaab,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD
  811. 0x0000,0x0000,0x0000,0x8000,0x3ffc, XPD
  812. 0xcccd,0xcccc,0xcccc,0xcccc,0x3ffd, XPD
  813. 0x0000,0x0000,0x0000,0x8000,0x3ffe, XPD
  814. 0xdb6e,0x6db6,0xb6db,0xdb6d,0x3ffe, XPD
  815. 0x9249,0x4924,0x2492,0x9249,0x3ffc, XPD
  816. 0xaaab,0xaaaa,0xaaaa,0xaaaa,0x3ffe, XPD
  817. 0x9249,0x4924,0x2492,0x9249,0x3ffd, XPD
  818. 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
  819. 0xaaab,0xaaaa,0xaaaa,0xaaaa,0x3ffd, XPD
  820. 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD
  821. };
  822. short rungb[] = {
  823. 0x0000,0x0000,0x0000,0x8000,0x3ffd, XPD
  824. 0x8e39,0x38e3,0xe38e,0x8e38,0x3ffb, XPD
  825. 0xe38e,0x8e38,0x38e3,0xe38e,0x3ff8, XPD
  826. 0x0000,0x0000,0x0000,0x8000,0x3ffa, XPD
  827. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  828. 0x0000,0x0000,0x0000,0xc000,0x3ffb, XPD
  829. 0x49ba,0x020c,0x872b,0xd916,0x3ffe, XPD
  830. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  831. 0x4bc7,0x8937,0x6041,0xd0e5,0xc000, XPD
  832. 0xd2f2,0x624d,0x5810,0xb439,0x4000, XPD
  833. 0xaaab,0xaaaa,0xaaaa,0xaaaa,0x3ff9, XPD
  834. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  835. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  836. 0x3e10,0xe0f8,0x0f83,0xf83e,0x3ffc, XPD
  837. 0x6c9b,0xc9b2,0x9b26,0xf26c,0x3ffc, XPD
  838. 0x80b1,0xb2e9,0xf4b2,0x86a9,0xbffe, XPD
  839. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  840. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  841. 0x7433,0x5d84,0x66f0,0xc18c,0x3fff, XPD
  842. 0xad40,0xd78a,0xc9e9,0x9b63,0xc000, XPD
  843. 0x8a2f,0x30f0,0x8155,0x9323,0x4000, XPD
  844. 0x5398,0x72f0,0x5e0a,0xc14e,0x3ffb, XPD
  845. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  846. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  847. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  848. 0x37ba,0x4ca0,0xe95c,0xb0de,0x3ffc, XPD
  849. 0x8889,0x8888,0x8888,0x8888,0xbffc, XPD
  850. 0x94b9,0xb94b,0x4b94,0x94b9,0x3ff8, XPD
  851. 0x930c,0x9440,0x0ad8,0xac55,0x3ffe, XPD
  852. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  853. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  854. 0x6467,0x21bb,0xfa9a,0xec4d,0xbfff, XPD
  855. 0x1041,0x4104,0x0410,0xa841,0x4000, XPD
  856. 0xde4c,0x885c,0xf7bb,0xd1a7,0xbfff, XPD
  857. 0xe140,0x781c,0x83e9,0x8e21,0x3ffc, XPD
  858. 0x23b1,0x0883,0x1342,0xb5b5,0x3ffe, XPD
  859. 0x6915,0x82cc,0x524e,0x8788,0xbffc, XPD
  860. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  861. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  862. 0x26da,0x7a64,0x2aca,0xa0ed,0xbffa, XPD
  863. 0x9fc6,0xfb55,0x3fa3,0x808f,0xbfff, XPD
  864. 0xb5e3,0x8a92,0x849e,0xd8b2,0x3ffe, XPD
  865. 0x139a,0x7b77,0x8b8e,0xd629,0xbff9, XPD
  866. 0x2e8c,0xe8ba,0x8ba2,0xba2e,0x3ffe, XPD
  867. 0x336e,0xded2,0x589c,0xafde,0xbffb, XPD
  868. 0x9bc1,0x504d,0x55b1,0xd673,0x3fff, XPD
  869. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  870. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  871. 0x0d60,0xad97,0x37c1,0xf55e,0xc000, XPD
  872. 0x5de8,0xebfe,0xf5ca,0xb602,0x4001, XPD
  873. 0x11b7,0x2e47,0x6318,0xbf52,0xc001, XPD
  874. 0x9c95,0x1212,0x7765,0xbe71,0x3ffd, XPD
  875. 0xec28,0x2e4c,0x93f7,0xfc14,0xbffc, XPD
  876. 0xa2e9,0x2e8b,0xe8ba,0x9aa2,0x3fff, XPD
  877. 0x50d8,0x435e,0x0d79,0x8765,0x4000, XPD
  878. 0xf1a2,0x78c7,0x78ee,0x87c1,0xbffc, XPD
  879. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  880. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  881. 0x0b19,0xc521,0xd936,0x9392,0x3ffc, XPD
  882. 0x63c5,0x631c,0x226c,0x90b4,0xbfff, XPD
  883. 0x97ed,0x748e,0x58dd,0xb135,0x3ffe, XPD
  884. 0x041e,0x7bcb,0x8803,0xfbbd,0xbffa, XPD
  885. 0xabce,0x6789,0x2345,0xdf01,0x3ffd, XPD
  886. 0x0000,0x0000,0x0000,0x8000,0x3ffb, XPD
  887. 0x31de,0x2fc2,0x6038,0xa59e,0x3ffd, XPD
  888. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  889. 0x100b,0x6e6c,0x9d9c,0xa534,0x3fff, XPD
  890. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  891. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  892. 0xd40d,0x655e,0xe836,0xcc8a,0xc000, XPD
  893. 0x9b42,0x8f91,0x66d0,0xa464,0x4001, XPD
  894. 0x8996,0xbdf7,0x71c1,0xa540,0xc001, XPD
  895. 0x9d60,0xd5fa,0x5fa9,0xd29d,0x3ffd, XPD
  896. 0x4209,0x208d,0x08d4,0x8d42,0x3ffe, XPD
  897. 0x5595,0x5956,0x9565,0xde55,0x3ffe, XPD
  898. 0xc632,0x6318,0x318c,0x84c6,0xbfff, XPD
  899. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  900. 0xd235,0x2348,0x348d,0x88d2,0x4000, XPD
  901. };
  902. #if ERRTERM
  903. short runger[] = {
  904. 0x8889,0x8888,0x8888,0x8888,0xbff6, XPD
  905. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  906. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  907. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  908. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  909. 0x29a5,0x6715,0x3e1f,0xaec3,0xbffa, XPD
  910. 0x6853,0x51fb,0xec83,0x9501,0xbff7, XPD
  911. 0x6853,0x51fb,0xec83,0x9501,0x3ff9, XPD
  912. 0x61bf,0x1bed,0xbed6,0x8d61,0x3ff9, XPD
  913. 0x0da7,0xda74,0xa740,0x800d,0xbffc, XPD
  914. 0x468b,0xbe02,0x3579,0xacf1,0xbffa, XPD
  915. 0x61bf,0x1bed,0xbed6,0x8d61,0x3ffc, XPD
  916. 0xb05b,0x5b05,0x05b0,0xb05b,0x3ffa, XPD
  917. };
  918. #endif /* ERRTERM */
  919. short runga[] = {
  920. 0xb05b,0x5b05,0x05b0,0xb05b,0x3ffa, XPD
  921. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  922. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  923. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  924. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  925. 0x740e,0x40da,0x0da7,0xda74,0x3ffc, XPD
  926. 0xf824,0x2ce3,0x78ea,0xd94d,0x3ffc, XPD
  927. 0xf824,0x2ce3,0x78ea,0xd94d,0x3ffc, XPD
  928. 0x61bf,0x1bed,0xbed6,0x8d61,0x3ffc, XPD
  929. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  930. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  931. 0x61bf,0x1bed,0xbed6,0x8d61,0x3ffc, XPD
  932. 0xb05b,0x5b05,0x05b0,0xb05b,0x3ffa, XPD
  933. };
  934. #endif /* IBMPC LDOUBLE */
  935. #if MIEEE
  936. long rungal[5*12] = {
  937. 0x3ffd0000,0x80000000,0x00000000,
  938. 0x3ffb0000,0xaaaaaaaa,0xaaaaaaab,
  939. 0x3ffc0000,0x80000000,0x00000000,
  940. 0x3ffd0000,0xcccccccc,0xcccccccd,
  941. 0x3ffe0000,0x80000000,0x00000000,
  942. 0x3ffe0000,0xdb6db6db,0x6db6db6e,
  943. 0x3ffc0000,0x92492492,0x49249249,
  944. 0x3ffe0000,0xaaaaaaaa,0xaaaaaaab,
  945. 0x3ffd0000,0x92492492,0x49249249,
  946. 0x3fff0000,0x80000000,0x00000000,
  947. 0x3ffd0000,0xaaaaaaaa,0xaaaaaaab,
  948. 0x3fff0000,0x80000000,0x00000000,
  949. };
  950. long rungb[5*78] = {
  951. 0x3ffd0000,0x80000000,0x00000000,
  952. 0x3ffb0000,0x8e38e38e,0x38e38e39,
  953. 0x3ff80000,0xe38e38e3,0x8e38e38e,
  954. 0x3ffa0000,0x80000000,0x00000000,
  955. 0x00000000,0x00000000,0x00000000,
  956. 0x3ffb0000,0xc0000000,0x00000000,
  957. 0x3ffe0000,0xd916872b,0x020c49ba,
  958. 0x00000000,0x00000000,0x00000000,
  959. 0xc0000000,0xd0e56041,0x89374bc7,
  960. 0x40000000,0xb4395810,0x624dd2f2,
  961. 0x3ff90000,0xaaaaaaaa,0xaaaaaaab,
  962. 0x00000000,0x00000000,0x00000000,
  963. 0x00000000,0x00000000,0x00000000,
  964. 0x3ffc0000,0xf83e0f83,0xe0f83e10,
  965. 0x3ffc0000,0xf26c9b26,0xc9b26c9b,
  966. 0xbffe0000,0x86a9f4b2,0xb2e980b1,
  967. 0x00000000,0x00000000,0x00000000,
  968. 0x00000000,0x00000000,0x00000000,
  969. 0x3fff0000,0xc18c66f0,0x5d847433,
  970. 0xc0000000,0x9b63c9e9,0xd78aad40,
  971. 0x40000000,0x93238155,0x30f08a2f,
  972. 0x3ffb0000,0xc14e5e0a,0x72f05398,
  973. 0x00000000,0x00000000,0x00000000,
  974. 0x00000000,0x00000000,0x00000000,
  975. 0x00000000,0x00000000,0x00000000,
  976. 0x3ffc0000,0xb0dee95c,0x4ca037ba,
  977. 0xbffc0000,0x88888888,0x88888889,
  978. 0x3ff80000,0x94b94b94,0xb94b94b9,
  979. 0x3ffe0000,0xac550ad8,0x9440930c,
  980. 0x00000000,0x00000000,0x00000000,
  981. 0x00000000,0x00000000,0x00000000,
  982. 0xbfff0000,0xec4dfa9a,0x21bb6467,
  983. 0x40000000,0xa8410410,0x41041041,
  984. 0xbfff0000,0xd1a7f7bb,0x885cde4c,
  985. 0x3ffc0000,0x8e2183e9,0x781ce140,
  986. 0x3ffe0000,0xb5b51342,0x088323b1,
  987. 0xbffc0000,0x8788524e,0x82cc6915,
  988. 0x00000000,0x00000000,0x00000000,
  989. 0x00000000,0x00000000,0x00000000,
  990. 0xbffa0000,0xa0ed2aca,0x7a6426da,
  991. 0xbfff0000,0x808f3fa3,0xfb559fc6,
  992. 0x3ffe0000,0xd8b2849e,0x8a92b5e3,
  993. 0xbff90000,0xd6298b8e,0x7b77139a,
  994. 0x3ffe0000,0xba2e8ba2,0xe8ba2e8c,
  995. 0xbffb0000,0xafde589c,0xded2336e,
  996. 0x3fff0000,0xd67355b1,0x504d9bc1,
  997. 0x00000000,0x00000000,0x00000000,
  998. 0x00000000,0x00000000,0x00000000,
  999. 0xc0000000,0xf55e37c1,0xad970d60,
  1000. 0x40010000,0xb602f5ca,0xebfe5de8,
  1001. 0xc0010000,0xbf526318,0x2e4711b7,
  1002. 0x3ffd0000,0xbe717765,0x12129c95,
  1003. 0xbffc0000,0xfc1493f7,0x2e4cec28,
  1004. 0x3fff0000,0x9aa2e8ba,0x2e8ba2e9,
  1005. 0x40000000,0x87650d79,0x435e50d8,
  1006. 0xbffc0000,0x87c178ee,0x78c7f1a2,
  1007. 0x00000000,0x00000000,0x00000000,
  1008. 0x00000000,0x00000000,0x00000000,
  1009. 0x3ffc0000,0x9392d936,0xc5210b19,
  1010. 0xbfff0000,0x90b4226c,0x631c63c5,
  1011. 0x3ffe0000,0xb13558dd,0x748e97ed,
  1012. 0xbffa0000,0xfbbd8803,0x7bcb041e,
  1013. 0x3ffd0000,0xdf012345,0x6789abce,
  1014. 0x3ffb0000,0x80000000,0x00000000,
  1015. 0x3ffd0000,0xa59e6038,0x2fc231de,
  1016. 0x00000000,0x00000000,0x00000000,
  1017. 0x3fff0000,0xa5349d9c,0x6e6c100b,
  1018. 0x00000000,0x00000000,0x00000000,
  1019. 0x00000000,0x00000000,0x00000000,
  1020. 0xc0000000,0xcc8ae836,0x655ed40d,
  1021. 0x40010000,0xa46466d0,0x8f919b42,
  1022. 0xc0010000,0xa54071c1,0xbdf78996,
  1023. 0x3ffd0000,0xd29d5fa9,0xd5fa9d60,
  1024. 0x3ffe0000,0x8d4208d4,0x208d4209,
  1025. 0x3ffe0000,0xde559565,0x59565595,
  1026. 0xbfff0000,0x84c6318c,0x6318c632,
  1027. 0x00000000,0x00000000,0x00000000,
  1028. 0x40000000,0x88d2348d,0x2348d235,
  1029. };
  1030. #if ERRTERM
  1031. long runger[5*13] = {
  1032. 0xbff60000,0x88888888,0x88888889,
  1033. 0x00000000,0x00000000,0x00000000,
  1034. 0x00000000,0x00000000,0x00000000,
  1035. 0x00000000,0x00000000,0x00000000,
  1036. 0x00000000,0x00000000,0x00000000,
  1037. 0xbffa0000,0xaec33e1f,0x671529a5,
  1038. 0xbff70000,0x9501ec83,0x51fb6853,
  1039. 0x3ff90000,0x9501ec83,0x51fb6853,
  1040. 0x3ff90000,0x8d61bed6,0x1bed61bf,
  1041. 0xbffc0000,0x800da740,0xda740da7,
  1042. 0xbffa0000,0xacf13579,0xbe02468b,
  1043. 0x3ffc0000,0x8d61bed6,0x1bed61bf,
  1044. 0x3ffa0000,0xb05b05b0,0x5b05b05b,
  1045. };
  1046. #endif /* ERRTERM */
  1047. long runga[5*13] = {
  1048. 0x3ffa0000,0xb05b05b0,0x5b05b05b,
  1049. 0x00000000,0x00000000,0x00000000,
  1050. 0x00000000,0x00000000,0x00000000,
  1051. 0x00000000,0x00000000,0x00000000,
  1052. 0x00000000,0x00000000,0x00000000,
  1053. 0x3ffc0000,0xda740da7,0x40da740e,
  1054. 0x3ffc0000,0xd94d78ea,0x2ce3f824,
  1055. 0x3ffc0000,0xd94d78ea,0x2ce3f824,
  1056. 0x3ffc0000,0x8d61bed6,0x1bed61bf,
  1057. 0x00000000,0x00000000,0x00000000,
  1058. 0x00000000,0x00000000,0x00000000,
  1059. 0x3ffc0000,0x8d61bed6,0x1bed61bf,
  1060. 0x3ffa0000,0xb05b05b0,0x5b05b05b,
  1061. };
  1062. #endif /* MIEEE LDOUBLE */
  1063.  
  1064. #define INUM 13
  1065. #define HMAXL Two
  1066. #define HLIM1 Five
  1067. #else
  1068. #if IBMPC
  1069. short rungal[48] = {
  1070. 0x0000,0x0000,0x0000,0x3fd0,
  1071. 0x5555,0x5555,0x5555,0x3fb5,
  1072. 0x0000,0x0000,0x0000,0x3fc0,
  1073. 0x999a,0x9999,0x9999,0x3fd9,
  1074. 0x0000,0x0000,0x0000,0x3fe0,
  1075. 0xb6db,0xdb6d,0x6db6,0x3feb,
  1076. 0x2492,0x9249,0x4924,0x3fc2,
  1077. 0x5555,0x5555,0x5555,0x3fe5,
  1078. 0x2492,0x9249,0x4924,0x3fd2,
  1079. 0x0000,0x0000,0x0000,0x3ff0,
  1080. 0x5555,0x5555,0x5555,0x3fd5,
  1081. 0x0000,0x0000,0x0000,0x3ff0,
  1082. };
  1083.  
  1084. short rungb[312] = {
  1085. 0x0000,0x0000,0x0000,0x3fd0,
  1086.  
  1087. 0x1c72,0x71c7,0xc71c,0x3fb1,
  1088. 0xc71c,0x1c71,0x71c7,0x3f8c,
  1089.  
  1090. 0x0000,0x0000,0x0000,0x3fa0,
  1091. 0x0000,0x0000,0x0000,0x0000,
  1092. 0x0000,0x0000,0x0000,0x3fb8,
  1093.  
  1094. 0x4189,0xe560,0x22d0,0x3feb,
  1095. 0x0000,0x0000,0x0000,0x0000,
  1096. 0x26e9,0x0831,0x1cac,0xc00a,
  1097. 0x49ba,0x020c,0x872b,0x4006,
  1098.  
  1099. 0x5555,0x5555,0x5555,0x3f95,
  1100. 0x0000,0x0000,0x0000,0x0000,
  1101. 0x0000,0x0000,0x0000,0x0000,
  1102. 0x1f08,0xf07c,0x07c1,0x3fcf,
  1103. 0x364e,0x64d9,0x4d93,0x3fce,
  1104.  
  1105. 0x5d30,0x9656,0xd53e,0xbfe0,
  1106. 0x0000,0x0000,0x0000,0x0000,
  1107. 0x0000,0x0000,0x0000,0x0000,
  1108. 0xb08f,0xde0b,0x318c,0x3ff8,
  1109. 0xf156,0x3d3a,0x6c79,0xc003,
  1110. 0x1e11,0x2aa6,0x6470,0x4002,
  1111.  
  1112. 0x5e0a,0xc14e,0x29cb,0x3fb8,
  1113. 0x0000,0x0000,0x0000,0x0000,
  1114. 0x0000,0x0000,0x0000,0x0000,
  1115. 0x0000,0x0000,0x0000,0x0000,
  1116. 0x9407,0x2b89,0x1bdd,0x3fc6,
  1117. 0x1111,0x1111,0x1111,0xbfc1,
  1118. 0x2973,0x7297,0x9729,0x3f82,
  1119.  
  1120. 0x8812,0x5b12,0x8aa1,0x3fe5,
  1121. 0x0000,0x0000,0x0000,0x0000,
  1122. 0x0000,0x0000,0x0000,0x0000,
  1123. 0x376d,0x5344,0x89bf,0xbffd,
  1124. 0x2082,0x8208,0x0820,0x4005,
  1125. 0x0b9c,0xf771,0x34fe,0xbffa,
  1126. 0x039c,0x7d2f,0xc430,0x3fc1,
  1127. 0x1064,0x6841,0xb6a2,0x3fe6,
  1128.  
  1129. 0x598d,0x49d0,0xf10a,0xbfc0,
  1130. 0x0000,0x0000,0x0000,0x0000,
  1131. 0x0000,0x0000,0x0000,0x0000,
  1132. 0x4c85,0x594f,0x1da5,0xbfa4,
  1133. 0x6ab4,0xf47f,0x11e7,0xbff0,
  1134. 0x5257,0x93d1,0x1650,0x3feb,
  1135. 0x6ee2,0x71cf,0xc531,0xbf9a,
  1136. 0x1746,0x745d,0x45d1,0x3fe7,
  1137. 0xda46,0x139b,0xfbcb,0xbfb5,
  1138.  
  1139. 0x09b3,0xb62a,0xce6a,0x3ffa,
  1140. 0x0000,0x0000,0x0000,0x0000,
  1141. 0x0000,0x0000,0x0000,0x0000,
  1142. 0xb2e2,0xf835,0xabc6,0xc00e,
  1143. 0x7fcc,0xb95d,0xc05e,0x4016,
  1144. 0xc8e2,0x6305,0xea4c,0xc017,
  1145. 0x4254,0xeca2,0xce2e,0x3fd7,
  1146. 0xc99e,0x7ee5,0x8292,0xbfcf,
  1147. 0xd174,0x1745,0x545d,0x3ff3,
  1148. 0x6bca,0xaf28,0xeca1,0x4000,
  1149.  
  1150. 0x18fe,0x1dcf,0xf82f,0xbfc0,
  1151. 0x0000,0x0000,0x0000,0x0000,
  1152. 0x0000,0x0000,0x0000,0x0000,
  1153. 0xa421,0x26d8,0x725b,0x3fc2,
  1154. 0x638c,0x4d8c,0x1684,0xbff2,
  1155. 0x91d3,0x1bae,0x26ab,0x3fe6,
  1156. 0x7961,0x006f,0x77b1,0xbfaf,
  1157. 0xf135,0x68ac,0xe024,0x3fdb,
  1158. 0x0000,0x0000,0x0000,0x3fb0,
  1159. 0xf846,0x0705,0xb3cc,0x3fd4,
  1160. 0x0000,0x0000,0x0000,0x0000,
  1161.  
  1162. 0xcd82,0xb38d,0xa693,0x3ff4,
  1163. 0x0000,0x0000,0x0000,0x0000,
  1164. 0x0000,0x0000,0x0000,0x0000,
  1165. 0xabdb,0x06cc,0x915d,0xc009,
  1166. 0xf233,0xda11,0x8c8c,0x4014,
  1167. 0xbef1,0x3837,0xa80e,0xc014,
  1168. 0xbf54,0xf53a,0x53ab,0x3fda,
  1169. 0x11a8,0x1a84,0xa841,0x3fe1,
  1170. 0x2acb,0xacab,0xcab2,0x3feb,
  1171. 0x6319,0x318c,0x98c6,0xbff0,
  1172. 0x0000,0x0000,0x0000,0x0000,
  1173. 0x691a,0x91a4,0x1a46,0x4001,
  1174. };
  1175. #if ERRTERM
  1176. short runger[52] = {
  1177. 0x1111,0x1111,0x1111,0xbf61,
  1178. 0x0000,0x0000,0x0000,0x0000,
  1179. 0x0000,0x0000,0x0000,0x0000,
  1180. 0x0000,0x0000,0x0000,0x0000,
  1181. 0x0000,0x0000,0x0000,0x0000,
  1182. 0xe2a5,0xc3ec,0xd867,0xbfa5,
  1183. 0x3f6d,0x906a,0xa03d,0xbf72,
  1184. 0x3f6d,0x906a,0xa03d,0x3f92,
  1185. 0x7dac,0xdac3,0xac37,0x3f91,
  1186. 0x4e82,0xe81b,0x01b4,0xbfc0,
  1187. 0xc049,0xaf37,0x9e26,0xbfa5,
  1188. 0x7dac,0xdac3,0xac37,0x3fc1,
  1189. 0x60b6,0xb60b,0x0b60,0x3fa6,
  1190. };
  1191. #endif
  1192. short runga[52] = {
  1193. 0x60b6,0xb60b,0x0b60,0x3fa6,
  1194. 0x0000,0x0000,0x0000,0x0000,
  1195. 0x0000,0x0000,0x0000,0x0000,
  1196. 0x0000,0x0000,0x0000,0x0000,
  1197. 0x0000,0x0000,0x0000,0x0000,
  1198. 0x1b4f,0xb4e8,0x4e81,0x3fcb,
  1199. 0x9c7f,0x1d45,0x29af,0x3fcb,
  1200. 0x9c7f,0x1d45,0x29af,0x3fcb,
  1201. 0x7dac,0xdac3,0xac37,0x3fc1,
  1202. 0x0000,0x0000,0x0000,0x0000,
  1203. 0x0000,0x0000,0x0000,0x0000,
  1204. 0x7dac,0xdac3,0xac37,0x3fc1,
  1205. 0x60b6,0xb60b,0x0b60,0x3fa6,
  1206. };
  1207. #endif /* IBMPC */
  1208.  
  1209.  
  1210. #if MIEEE
  1211. short rungal[48] = {
  1212. 0x3fd0,0x0000,0x0000,0x0000,
  1213. 0x3fb5,0x5555,0x5555,0x5555,
  1214. 0x3fc0,0x0000,0x0000,0x0000,
  1215. 0x3fd9,0x9999,0x9999,0x999a,
  1216. 0x3fe0,0x0000,0x0000,0x0000,
  1217. 0x3feb,0x6db6,0xdb6d,0xb6db,
  1218. 0x3fc2,0x4924,0x9249,0x2492,
  1219. 0x3fe5,0x5555,0x5555,0x5555,
  1220. 0x3fd2,0x4924,0x9249,0x2492,
  1221. 0x3ff0,0x0000,0x0000,0x0000,
  1222. 0x3fd5,0x5555,0x5555,0x5555,
  1223. 0x3ff0,0x0000,0x0000,0x0000,
  1224. };
  1225.  
  1226. short rungb[312] = {
  1227. 0x3fd0,0x0000,0x0000,0x0000,
  1228.  
  1229. 0x3fb1,0xc71c,0x71c7,0x1c72,
  1230. 0x3f8c,0x71c7,0x1c71,0xc71c,
  1231.  
  1232. 0x3fa0,0x0000,0x0000,0x0000,
  1233. 0x0000,0x0000,0x0000,0x0000,
  1234. 0x3fb8,0x0000,0x0000,0x0000,
  1235.  
  1236. 0x3feb,0x22d0,0xe560,0x4189,
  1237. 0x0000,0x0000,0x0000,0x0000,
  1238. 0xc00a,0x1cac,0x0831,0x26e9,
  1239. 0x4006,0x872b,0x020c,0x49ba,
  1240.  
  1241. 0x3f95,0x5555,0x5555,0x5555,
  1242. 0x0000,0x0000,0x0000,0x0000,
  1243. 0x0000,0x0000,0x0000,0x0000,
  1244. 0x3fcf,0x07c1,0xf07c,0x1f08,
  1245. 0x3fce,0x4d93,0x64d9,0x364e,
  1246.  
  1247. 0xbfe0,0xd53e,0x9656,0x5d30,
  1248. 0x0000,0x0000,0x0000,0x0000,
  1249. 0x0000,0x0000,0x0000,0x0000,
  1250. 0x3ff8,0x318c,0xde0b,0xb08f,
  1251. 0xc003,0x6c79,0x3d3a,0xf156,
  1252. 0x4002,0x6470,0x2aa6,0x1e11,
  1253.  
  1254. 0x3fb8,0x29cb,0xc14e,0x5e0a,
  1255. 0x0000,0x0000,0x0000,0x0000,
  1256. 0x0000,0x0000,0x0000,0x0000,
  1257. 0x0000,0x0000,0x0000,0x0000,
  1258. 0x3fc6,0x1bdd,0x2b89,0x9407,
  1259. 0xbfc1,0x1111,0x1111,0x1111,
  1260. 0x3f82,0x9729,0x7297,0x2973,
  1261.  
  1262. 0x3fe5,0x8aa1,0x5b12,0x8812,
  1263. 0x0000,0x0000,0x0000,0x0000,
  1264. 0x0000,0x0000,0x0000,0x0000,
  1265. 0xbffd,0x89bf,0x5344,0x376d,
  1266. 0x4005,0x0820,0x8208,0x2082,
  1267. 0xbffa,0x34fe,0xf771,0x0b9c,
  1268. 0x3fc1,0xc430,0x7d2f,0x039c,
  1269. 0x3fe6,0xb6a2,0x6841,0x1064,
  1270.  
  1271. 0xbfc0,0xf10a,0x49d0,0x598d,
  1272. 0x0000,0x0000,0x0000,0x0000,
  1273. 0x0000,0x0000,0x0000,0x0000,
  1274. 0xbfa4,0x1da5,0x594f,0x4c85,
  1275. 0xbff0,0x11e7,0xf47f,0x6ab4,
  1276. 0x3feb,0x1650,0x93d1,0x5257,
  1277. 0xbf9a,0xc531,0x71cf,0x6ee2,
  1278. 0x3fe7,0x45d1,0x745d,0x1746,
  1279. 0xbfb5,0xfbcb,0x139b,0xda46,
  1280.  
  1281. 0x3ffa,0xce6a,0xb62a,0x09b3,
  1282. 0x0000,0x0000,0x0000,0x0000,
  1283. 0x0000,0x0000,0x0000,0x0000,
  1284. 0xc00e,0xabc6,0xf835,0xb2e2,
  1285. 0x4016,0xc05e,0xb95d,0x7fcc,
  1286. 0xc017,0xea4c,0x6305,0xc8e2,
  1287. 0x3fd7,0xce2e,0xeca2,0x4254,
  1288. 0xbfcf,0x8292,0x7ee5,0xc99e,
  1289. 0x3ff3,0x545d,0x1745,0xd174,
  1290. 0x4000,0xeca1,0xaf28,0x6bca,
  1291.  
  1292. 0xbfc0,0xf82f,0x1dcf,0x18fe,
  1293. 0x0000,0x0000,0x0000,0x0000,
  1294. 0x0000,0x0000,0x0000,0x0000,
  1295. 0x3fc2,0x725b,0x26d8,0xa421,
  1296. 0xbff2,0x1684,0x4d8c,0x638c,
  1297. 0x3fe6,0x26ab,0x1bae,0x91d3,
  1298. 0xbfaf,0x77b1,0x006f,0x7961,
  1299. 0x3fdb,0xe024,0x68ac,0xf135,
  1300. 0x3fb0,0x0000,0x0000,0x0000,
  1301. 0x3fd4,0xb3cc,0x0705,0xf846,
  1302. 0x0000,0x0000,0x0000,0x0000,
  1303.  
  1304. 0x3ff4,0xa693,0xb38d,0xcd82,
  1305. 0x0000,0x0000,0x0000,0x0000,
  1306. 0x0000,0x0000,0x0000,0x0000,
  1307. 0xc009,0x915d,0x06cc,0xabdb,
  1308. 0x4014,0x8c8c,0xda11,0xf233,
  1309. 0xc014,0xa80e,0x3837,0xbef1,
  1310. 0x3fda,0x53ab,0xf53a,0xbf54,
  1311. 0x3fe1,0xa841,0x1a84,0x11a8,
  1312. 0x3feb,0xcab2,0xacab,0x2acb,
  1313. 0xbff0,0x98c6,0x318c,0x6319,
  1314. 0x0000,0x0000,0x0000,0x0000,
  1315. 0x4001,0x1a46,0x91a4,0x691a,
  1316. };
  1317. #if ERRTERM
  1318. short runger[52] = {
  1319. 0xbf61,0x1111,0x1111,0x1111,
  1320. 0x0000,0x0000,0x0000,0x0000,
  1321. 0x0000,0x0000,0x0000,0x0000,
  1322. 0x0000,0x0000,0x0000,0x0000,
  1323. 0x0000,0x0000,0x0000,0x0000,
  1324. 0xbfa5,0xd867,0xc3ec,0xe2a5,
  1325. 0xbf72,0xa03d,0x906a,0x3f6d,
  1326. 0x3f92,0xa03d,0x906a,0x3f6d,
  1327. 0x3f91,0xac37,0xdac3,0x7dac,
  1328. 0xbfc0,0x01b4,0xe81b,0x4e82,
  1329. 0xbfa5,0x9e26,0xaf37,0xc049,
  1330. 0x3fc1,0xac37,0xdac3,0x7dac,
  1331. 0x3fa6,0x0b60,0xb60b,0x60b6,
  1332. };
  1333. #endif
  1334. short runga[52] = {
  1335. 0x3fa6,0x0b60,0xb60b,0x60b6,
  1336. 0x0000,0x0000,0x0000,0x0000,
  1337. 0x0000,0x0000,0x0000,0x0000,
  1338. 0x0000,0x0000,0x0000,0x0000,
  1339. 0x0000,0x0000,0x0000,0x0000,
  1340. 0x3fcb,0x4e81,0xb4e8,0x1b4f,
  1341. 0x3fcb,0x29af,0x1d45,0x9c7f,
  1342. 0x3fcb,0x29af,0x1d45,0x9c7f,
  1343. 0x3fc1,0xac37,0xdac3,0x7dac,
  1344. 0x0000,0x0000,0x0000,0x0000,
  1345. 0x0000,0x0000,0x0000,0x0000,
  1346. 0x3fc1,0xac37,0xdac3,0x7dac,
  1347. 0x3fa6,0x0b60,0xb60b,0x60b6,
  1348. };
  1349. #endif /* MIEEE */
  1350. #define INUM 13
  1351. #define HMAXL ((DOUBLE )2.0)
  1352. #define HLIM1 ((DOUBLE )5.0)
  1353. #endif /* not LDOUBLE */
  1354.  
  1355. #endif /* ORDER = 7 */
  1356.  
  1357. int inum = INUM;
  1358.  
  1359. DOUBLE *rungw;
  1360. DOUBLE *rungau;
  1361. DOUBLE *rungays;
  1362.  
  1363. /* Initialize pointers in work array.
  1364.  * neq >= neqn in rungek() below.  If neq > neqn, unused space
  1365.  * is left for extra variables that are not actually integrated.
  1366.  */
  1367. rkstart( neq, work )
  1368. int neq;
  1369. DOUBLE work[];
  1370. {
  1371. int m;
  1372.  
  1373. rungw = &work[0];
  1374. m = neq*inum;
  1375. rungau = &work[m];
  1376. m += neq;
  1377. rungays = &work[m];
  1378. }
  1379.  
  1380.  
  1381. /* Make a step.
  1382.  */
  1383. rungek(  neqn, x, yold, h, ynew, delta )
  1384. int neqn; /* number of first order equations */
  1385. DOUBLE x; /* independent variable */
  1386. DOUBLE yold[]; /* initial solution vector at x, size neqn */
  1387. DOUBLE h; /* step to take in independent variable */
  1388. DOUBLE ynew[]; /* output new solution vector at x+h, size neqn */
  1389. DOUBLE delta[]; /* the step, size neqn */
  1390. /*DOUBLE err[];*/ /* estimated error, size neqn */
  1391. {
  1392. DOUBLE *pa, *pal, *pb, *per, *pw, *pb0, *pu, *pys;
  1393. DOUBLE xs, usum, esum;
  1394. int i, j, m;
  1395.  
  1396. /*
  1397.  * w[]: neqn blocks of size inum
  1398.  *      block of size neqn for temp solution vector ys[]
  1399.  *      block of size neqn for output function vector u[] of func()
  1400.  */
  1401. xs = x;
  1402.  
  1403. pys = rungays;
  1404. pb = yold;
  1405. for( i=0; i<neqn; i++ )
  1406.     *pys++ = *pb++;  /* ys[i] = yold[i] */
  1407.  
  1408. func( xs, rungays, rungau );
  1409.  
  1410. pw = rungw;
  1411. pu = rungau;
  1412. for( i=0; i<neqn; i++ )
  1413.     {
  1414.     *pw = *pu++;  /* w[i*inum] = u[i] */
  1415.     pw += inum;
  1416.     }
  1417.  
  1418. pb0 = (DOUBLE *)&rungb[0];
  1419. pal = (DOUBLE *)&rungal[0];
  1420. for( j=1; j<inum; j++ )
  1421.     {
  1422.     xs = x + h * *pal++;
  1423.     pys = rungays;
  1424.     for( i=0; i<neqn; i++ )
  1425.         {
  1426.         usum = Zero;
  1427.         pw = rungw + i*inum;
  1428.         pb = pb0;
  1429.         for( m=0; m<j; m++ )
  1430.             usum += (*pb++) * (*pw++);
  1431.         *pys++ = yold[i] + h * usum;
  1432.         }
  1433.     func( xs, rungays, rungau );
  1434.     pw = rungw + j;
  1435.     pu = rungau;
  1436.     for( i=0; i<neqn; i++ )
  1437.         {
  1438.         *pw = *pu++;  /* w[j+i*inum] = u[i] */
  1439.         pw += inum;
  1440.         }
  1441.     pb0 += j;
  1442.     }
  1443.  
  1444. /* evaluate YNEW[i] and the error estimates EST[i] */
  1445. pw = rungw;
  1446. for( i=0; i<neqn; i++ )
  1447.     {
  1448.     pa = (DOUBLE *)&runga[0];
  1449. #if ERRTERM
  1450.     per = (DOUBLE *)&er[0];
  1451. #endif
  1452.     usum = Zero;
  1453.     esum = Zero;
  1454.     for( j=0; j<inum; j++ )
  1455.         {
  1456.         if( *pa != 0 )
  1457.             {
  1458. #if ERRTERM
  1459.             esum += (*per++) * (*pw);
  1460. #endif
  1461.             usum += (*pa++) * (*pw++);
  1462.             }
  1463.         else
  1464.             { /* skip if coefficient = 0 */
  1465.             ++pa;
  1466. #if ERRTERM
  1467.             ++per;
  1468. #endif
  1469.             ++pw;
  1470.             }
  1471.         }
  1472.     xs = h * usum; /* the step in this coordinate */
  1473.     delta[i] = xs;
  1474.     ynew[i] = yold[i] + xs;
  1475.  
  1476. #if ERRTERM
  1477.     err[i] = h * esum;
  1478. #endif
  1479.     }
  1480. }
  1481.