alglib 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. data/History.txt +7 -0
  2. data/Manifest.txt +253 -0
  3. data/README.txt +33 -0
  4. data/Rakefile +27 -0
  5. data/ext/Rakefile +24 -0
  6. data/ext/alglib.i +24 -0
  7. data/ext/alglib/Makefile +157 -0
  8. data/ext/alglib/airyf.cpp +372 -0
  9. data/ext/alglib/airyf.h +81 -0
  10. data/ext/alglib/alglib.cpp +8558 -0
  11. data/ext/alglib/alglib_util.cpp +19 -0
  12. data/ext/alglib/alglib_util.h +14 -0
  13. data/ext/alglib/ap.cpp +877 -0
  14. data/ext/alglib/ap.english.html +364 -0
  15. data/ext/alglib/ap.h +666 -0
  16. data/ext/alglib/ap.russian.html +442 -0
  17. data/ext/alglib/apvt.h +754 -0
  18. data/ext/alglib/bdss.cpp +1500 -0
  19. data/ext/alglib/bdss.h +251 -0
  20. data/ext/alglib/bdsvd.cpp +1339 -0
  21. data/ext/alglib/bdsvd.h +164 -0
  22. data/ext/alglib/bessel.cpp +1226 -0
  23. data/ext/alglib/bessel.h +331 -0
  24. data/ext/alglib/betaf.cpp +105 -0
  25. data/ext/alglib/betaf.h +74 -0
  26. data/ext/alglib/bidiagonal.cpp +1328 -0
  27. data/ext/alglib/bidiagonal.h +350 -0
  28. data/ext/alglib/binomialdistr.cpp +247 -0
  29. data/ext/alglib/binomialdistr.h +153 -0
  30. data/ext/alglib/blas.cpp +576 -0
  31. data/ext/alglib/blas.h +132 -0
  32. data/ext/alglib/cblas.cpp +226 -0
  33. data/ext/alglib/cblas.h +57 -0
  34. data/ext/alglib/cdet.cpp +138 -0
  35. data/ext/alglib/cdet.h +92 -0
  36. data/ext/alglib/chebyshev.cpp +216 -0
  37. data/ext/alglib/chebyshev.h +76 -0
  38. data/ext/alglib/chisquaredistr.cpp +157 -0
  39. data/ext/alglib/chisquaredistr.h +144 -0
  40. data/ext/alglib/cholesky.cpp +285 -0
  41. data/ext/alglib/cholesky.h +86 -0
  42. data/ext/alglib/cinverse.cpp +298 -0
  43. data/ext/alglib/cinverse.h +111 -0
  44. data/ext/alglib/clu.cpp +337 -0
  45. data/ext/alglib/clu.h +120 -0
  46. data/ext/alglib/correlation.cpp +280 -0
  47. data/ext/alglib/correlation.h +77 -0
  48. data/ext/alglib/correlationtests.cpp +726 -0
  49. data/ext/alglib/correlationtests.h +134 -0
  50. data/ext/alglib/crcond.cpp +826 -0
  51. data/ext/alglib/crcond.h +148 -0
  52. data/ext/alglib/creflections.cpp +310 -0
  53. data/ext/alglib/creflections.h +165 -0
  54. data/ext/alglib/csolve.cpp +312 -0
  55. data/ext/alglib/csolve.h +99 -0
  56. data/ext/alglib/ctrinverse.cpp +387 -0
  57. data/ext/alglib/ctrinverse.h +98 -0
  58. data/ext/alglib/ctrlinsolve.cpp +297 -0
  59. data/ext/alglib/ctrlinsolve.h +81 -0
  60. data/ext/alglib/dawson.cpp +234 -0
  61. data/ext/alglib/dawson.h +74 -0
  62. data/ext/alglib/descriptivestatistics.cpp +436 -0
  63. data/ext/alglib/descriptivestatistics.h +112 -0
  64. data/ext/alglib/det.cpp +140 -0
  65. data/ext/alglib/det.h +94 -0
  66. data/ext/alglib/dforest.cpp +1819 -0
  67. data/ext/alglib/dforest.h +316 -0
  68. data/ext/alglib/elliptic.cpp +497 -0
  69. data/ext/alglib/elliptic.h +217 -0
  70. data/ext/alglib/estnorm.cpp +429 -0
  71. data/ext/alglib/estnorm.h +107 -0
  72. data/ext/alglib/expintegrals.cpp +422 -0
  73. data/ext/alglib/expintegrals.h +108 -0
  74. data/ext/alglib/faq.english.html +258 -0
  75. data/ext/alglib/faq.russian.html +272 -0
  76. data/ext/alglib/fdistr.cpp +202 -0
  77. data/ext/alglib/fdistr.h +163 -0
  78. data/ext/alglib/fresnel.cpp +211 -0
  79. data/ext/alglib/fresnel.h +91 -0
  80. data/ext/alglib/gammaf.cpp +338 -0
  81. data/ext/alglib/gammaf.h +104 -0
  82. data/ext/alglib/gqgengauss.cpp +235 -0
  83. data/ext/alglib/gqgengauss.h +92 -0
  84. data/ext/alglib/gqgenhermite.cpp +268 -0
  85. data/ext/alglib/gqgenhermite.h +63 -0
  86. data/ext/alglib/gqgenjacobi.cpp +297 -0
  87. data/ext/alglib/gqgenjacobi.h +72 -0
  88. data/ext/alglib/gqgenlaguerre.cpp +265 -0
  89. data/ext/alglib/gqgenlaguerre.h +69 -0
  90. data/ext/alglib/gqgenlegendre.cpp +300 -0
  91. data/ext/alglib/gqgenlegendre.h +62 -0
  92. data/ext/alglib/gqgenlobatto.cpp +305 -0
  93. data/ext/alglib/gqgenlobatto.h +97 -0
  94. data/ext/alglib/gqgenradau.cpp +232 -0
  95. data/ext/alglib/gqgenradau.h +95 -0
  96. data/ext/alglib/hbisinv.cpp +480 -0
  97. data/ext/alglib/hbisinv.h +183 -0
  98. data/ext/alglib/hblas.cpp +228 -0
  99. data/ext/alglib/hblas.h +64 -0
  100. data/ext/alglib/hcholesky.cpp +339 -0
  101. data/ext/alglib/hcholesky.h +91 -0
  102. data/ext/alglib/hermite.cpp +114 -0
  103. data/ext/alglib/hermite.h +49 -0
  104. data/ext/alglib/hessenberg.cpp +370 -0
  105. data/ext/alglib/hessenberg.h +152 -0
  106. data/ext/alglib/hevd.cpp +247 -0
  107. data/ext/alglib/hevd.h +107 -0
  108. data/ext/alglib/hsschur.cpp +1316 -0
  109. data/ext/alglib/hsschur.h +108 -0
  110. data/ext/alglib/htridiagonal.cpp +734 -0
  111. data/ext/alglib/htridiagonal.h +180 -0
  112. data/ext/alglib/ialglib.cpp +6 -0
  113. data/ext/alglib/ialglib.h +9 -0
  114. data/ext/alglib/ibetaf.cpp +960 -0
  115. data/ext/alglib/ibetaf.h +125 -0
  116. data/ext/alglib/igammaf.cpp +430 -0
  117. data/ext/alglib/igammaf.h +157 -0
  118. data/ext/alglib/inv.cpp +274 -0
  119. data/ext/alglib/inv.h +115 -0
  120. data/ext/alglib/inverseupdate.cpp +480 -0
  121. data/ext/alglib/inverseupdate.h +185 -0
  122. data/ext/alglib/jacobianelliptic.cpp +164 -0
  123. data/ext/alglib/jacobianelliptic.h +94 -0
  124. data/ext/alglib/jarquebera.cpp +2271 -0
  125. data/ext/alglib/jarquebera.h +80 -0
  126. data/ext/alglib/kmeans.cpp +356 -0
  127. data/ext/alglib/kmeans.h +76 -0
  128. data/ext/alglib/laguerre.cpp +94 -0
  129. data/ext/alglib/laguerre.h +48 -0
  130. data/ext/alglib/lbfgs.cpp +1167 -0
  131. data/ext/alglib/lbfgs.h +218 -0
  132. data/ext/alglib/lda.cpp +434 -0
  133. data/ext/alglib/lda.h +133 -0
  134. data/ext/alglib/ldlt.cpp +1130 -0
  135. data/ext/alglib/ldlt.h +124 -0
  136. data/ext/alglib/leastsquares.cpp +1252 -0
  137. data/ext/alglib/leastsquares.h +290 -0
  138. data/ext/alglib/legendre.cpp +107 -0
  139. data/ext/alglib/legendre.h +49 -0
  140. data/ext/alglib/linreg.cpp +1185 -0
  141. data/ext/alglib/linreg.h +380 -0
  142. data/ext/alglib/logit.cpp +1523 -0
  143. data/ext/alglib/logit.h +333 -0
  144. data/ext/alglib/lq.cpp +399 -0
  145. data/ext/alglib/lq.h +160 -0
  146. data/ext/alglib/lu.cpp +462 -0
  147. data/ext/alglib/lu.h +119 -0
  148. data/ext/alglib/mannwhitneyu.cpp +4490 -0
  149. data/ext/alglib/mannwhitneyu.h +115 -0
  150. data/ext/alglib/minlm.cpp +918 -0
  151. data/ext/alglib/minlm.h +312 -0
  152. data/ext/alglib/mlpbase.cpp +3375 -0
  153. data/ext/alglib/mlpbase.h +589 -0
  154. data/ext/alglib/mlpe.cpp +1369 -0
  155. data/ext/alglib/mlpe.h +552 -0
  156. data/ext/alglib/mlptrain.cpp +1056 -0
  157. data/ext/alglib/mlptrain.h +283 -0
  158. data/ext/alglib/nearunityunit.cpp +91 -0
  159. data/ext/alglib/nearunityunit.h +17 -0
  160. data/ext/alglib/normaldistr.cpp +377 -0
  161. data/ext/alglib/normaldistr.h +175 -0
  162. data/ext/alglib/nsevd.cpp +1869 -0
  163. data/ext/alglib/nsevd.h +140 -0
  164. data/ext/alglib/pca.cpp +168 -0
  165. data/ext/alglib/pca.h +87 -0
  166. data/ext/alglib/poissondistr.cpp +143 -0
  167. data/ext/alglib/poissondistr.h +130 -0
  168. data/ext/alglib/polinterpolation.cpp +685 -0
  169. data/ext/alglib/polinterpolation.h +206 -0
  170. data/ext/alglib/psif.cpp +173 -0
  171. data/ext/alglib/psif.h +88 -0
  172. data/ext/alglib/qr.cpp +414 -0
  173. data/ext/alglib/qr.h +168 -0
  174. data/ext/alglib/ratinterpolation.cpp +134 -0
  175. data/ext/alglib/ratinterpolation.h +72 -0
  176. data/ext/alglib/rcond.cpp +705 -0
  177. data/ext/alglib/rcond.h +140 -0
  178. data/ext/alglib/reflections.cpp +504 -0
  179. data/ext/alglib/reflections.h +165 -0
  180. data/ext/alglib/rotations.cpp +473 -0
  181. data/ext/alglib/rotations.h +128 -0
  182. data/ext/alglib/rsolve.cpp +221 -0
  183. data/ext/alglib/rsolve.h +99 -0
  184. data/ext/alglib/sbisinv.cpp +217 -0
  185. data/ext/alglib/sbisinv.h +171 -0
  186. data/ext/alglib/sblas.cpp +185 -0
  187. data/ext/alglib/sblas.h +64 -0
  188. data/ext/alglib/schur.cpp +156 -0
  189. data/ext/alglib/schur.h +102 -0
  190. data/ext/alglib/sdet.cpp +193 -0
  191. data/ext/alglib/sdet.h +101 -0
  192. data/ext/alglib/sevd.cpp +116 -0
  193. data/ext/alglib/sevd.h +99 -0
  194. data/ext/alglib/sinverse.cpp +672 -0
  195. data/ext/alglib/sinverse.h +138 -0
  196. data/ext/alglib/spddet.cpp +138 -0
  197. data/ext/alglib/spddet.h +96 -0
  198. data/ext/alglib/spdgevd.cpp +842 -0
  199. data/ext/alglib/spdgevd.h +200 -0
  200. data/ext/alglib/spdinverse.cpp +509 -0
  201. data/ext/alglib/spdinverse.h +122 -0
  202. data/ext/alglib/spdrcond.cpp +421 -0
  203. data/ext/alglib/spdrcond.h +118 -0
  204. data/ext/alglib/spdsolve.cpp +275 -0
  205. data/ext/alglib/spdsolve.h +105 -0
  206. data/ext/alglib/spline2d.cpp +1192 -0
  207. data/ext/alglib/spline2d.h +301 -0
  208. data/ext/alglib/spline3.cpp +1264 -0
  209. data/ext/alglib/spline3.h +290 -0
  210. data/ext/alglib/srcond.cpp +595 -0
  211. data/ext/alglib/srcond.h +127 -0
  212. data/ext/alglib/ssolve.cpp +895 -0
  213. data/ext/alglib/ssolve.h +139 -0
  214. data/ext/alglib/stdafx.h +0 -0
  215. data/ext/alglib/stest.cpp +131 -0
  216. data/ext/alglib/stest.h +94 -0
  217. data/ext/alglib/studenttdistr.cpp +222 -0
  218. data/ext/alglib/studenttdistr.h +115 -0
  219. data/ext/alglib/studentttests.cpp +377 -0
  220. data/ext/alglib/studentttests.h +178 -0
  221. data/ext/alglib/svd.cpp +620 -0
  222. data/ext/alglib/svd.h +126 -0
  223. data/ext/alglib/tdbisinv.cpp +2608 -0
  224. data/ext/alglib/tdbisinv.h +228 -0
  225. data/ext/alglib/tdevd.cpp +1229 -0
  226. data/ext/alglib/tdevd.h +115 -0
  227. data/ext/alglib/tridiagonal.cpp +594 -0
  228. data/ext/alglib/tridiagonal.h +171 -0
  229. data/ext/alglib/trigintegrals.cpp +490 -0
  230. data/ext/alglib/trigintegrals.h +131 -0
  231. data/ext/alglib/trinverse.cpp +345 -0
  232. data/ext/alglib/trinverse.h +98 -0
  233. data/ext/alglib/trlinsolve.cpp +926 -0
  234. data/ext/alglib/trlinsolve.h +73 -0
  235. data/ext/alglib/tsort.cpp +405 -0
  236. data/ext/alglib/tsort.h +54 -0
  237. data/ext/alglib/variancetests.cpp +245 -0
  238. data/ext/alglib/variancetests.h +134 -0
  239. data/ext/alglib/wsr.cpp +6285 -0
  240. data/ext/alglib/wsr.h +96 -0
  241. data/ext/ap.i +97 -0
  242. data/ext/correlation.i +24 -0
  243. data/ext/extconf.rb +6 -0
  244. data/ext/logit.i +89 -0
  245. data/lib/alglib.rb +71 -0
  246. data/lib/alglib/correlation.rb +26 -0
  247. data/lib/alglib/linearregression.rb +63 -0
  248. data/lib/alglib/logit.rb +42 -0
  249. data/test/test_alglib.rb +52 -0
  250. data/test/test_correlation.rb +44 -0
  251. data/test/test_correlationtest.rb +45 -0
  252. data/test/test_linreg.rb +35 -0
  253. data/test/test_logit.rb +43 -0
  254. data/test/test_pca.rb +27 -0
  255. metadata +326 -0
@@ -0,0 +1,185 @@
1
+ /*************************************************************************
2
+ Copyright (c) 2005-2007, Sergey Bochkanov (ALGLIB project).
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are
6
+ met:
7
+
8
+ - Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+
11
+ - Redistributions in binary form must reproduce the above copyright
12
+ notice, this list of conditions and the following disclaimer listed
13
+ in this license in the documentation and/or other materials
14
+ provided with the distribution.
15
+
16
+ - Neither the name of the copyright holders nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ *************************************************************************/
32
+
33
+ #ifndef _inverseupdate_h
34
+ #define _inverseupdate_h
35
+
36
+ #include "ap.h"
37
+ #include "ialglib.h"
38
+
39
+ /*************************************************************************
40
+ Inverse matrix update by the Sherman-Morrison formula
41
+
42
+ The algorithm updates matrix A^-1 when adding a number to an element
43
+ of matrix A.
44
+
45
+ Input parameters:
46
+ InvA - inverse of matrix A.
47
+ Array whose indexes range within [0..N-1, 0..N-1].
48
+ N - size of matrix A.
49
+ UpdRow - row where the element to be updated is stored.
50
+ UpdColumn - column where the element to be updated is stored.
51
+ UpdVal - a number to be added to the element.
52
+
53
+
54
+ Output parameters:
55
+ InvA - inverse of modified matrix A.
56
+
57
+ -- ALGLIB --
58
+ Copyright 2005 by Bochkanov Sergey
59
+ *************************************************************************/
60
+ void rmatrixinvupdatesimple(ap::real_2d_array& inva,
61
+ int n,
62
+ int updrow,
63
+ int updcolumn,
64
+ double updval);
65
+
66
+
67
+ /*************************************************************************
68
+ Inverse matrix update by the Sherman-Morrison formula
69
+
70
+ The algorithm updates matrix A^-1 when adding a vector to a row
71
+ of matrix A.
72
+
73
+ Input parameters:
74
+ InvA - inverse of matrix A.
75
+ Array whose indexes range within [0..N-1, 0..N-1].
76
+ N - size of matrix A.
77
+ UpdRow - the row of A whose vector V was added.
78
+ 0 <= Row <= N-1
79
+ V - the vector to be added to a row.
80
+ Array whose index ranges within [0..N-1].
81
+
82
+ Output parameters:
83
+ InvA - inverse of modified matrix A.
84
+
85
+ -- ALGLIB --
86
+ Copyright 2005 by Bochkanov Sergey
87
+ *************************************************************************/
88
+ void rmatrixinvupdaterow(ap::real_2d_array& inva,
89
+ int n,
90
+ int updrow,
91
+ const ap::real_1d_array& v);
92
+
93
+
94
+ /*************************************************************************
95
+ Inverse matrix update by the Sherman-Morrison formula
96
+
97
+ The algorithm updates matrix A^-1 when adding a vector to a column
98
+ of matrix A.
99
+
100
+ Input parameters:
101
+ InvA - inverse of matrix A.
102
+ Array whose indexes range within [0..N-1, 0..N-1].
103
+ N - size of matrix A.
104
+ UpdColumn - the column of A whose vector U was added.
105
+ 0 <= UpdColumn <= N-1
106
+ U - the vector to be added to a column.
107
+ Array whose index ranges within [0..N-1].
108
+
109
+ Output parameters:
110
+ InvA - inverse of modified matrix A.
111
+
112
+ -- ALGLIB --
113
+ Copyright 2005 by Bochkanov Sergey
114
+ *************************************************************************/
115
+ void rmatrixinvupdatecolumn(ap::real_2d_array& inva,
116
+ int n,
117
+ int updcolumn,
118
+ const ap::real_1d_array& u);
119
+
120
+
121
+ /*************************************************************************
122
+ Inverse matrix update by the Sherman-Morrison formula
123
+
124
+ The algorithm computes the inverse of matrix A+u*v� by using the given matrix
125
+ A^-1 and the vectors u and v.
126
+
127
+ Input parameters:
128
+ InvA - inverse of matrix A.
129
+ Array whose indexes range within [0..N-1, 0..N-1].
130
+ N - size of matrix A.
131
+ U - the vector modifying the matrix.
132
+ Array whose index ranges within [0..N-1].
133
+ V - the vector modifying the matrix.
134
+ Array whose index ranges within [0..N-1].
135
+
136
+ Output parameters:
137
+ InvA - inverse of matrix A + u*v'.
138
+
139
+ -- ALGLIB --
140
+ Copyright 2005 by Bochkanov Sergey
141
+ *************************************************************************/
142
+ void rmatrixinvupdateuv(ap::real_2d_array& inva,
143
+ int n,
144
+ const ap::real_1d_array& u,
145
+ const ap::real_1d_array& v);
146
+
147
+
148
+ /*************************************************************************
149
+ Obsolete 1-based subroutine
150
+ *************************************************************************/
151
+ void shermanmorrisonsimpleupdate(ap::real_2d_array& inva,
152
+ int n,
153
+ int updrow,
154
+ int updcolumn,
155
+ double updval);
156
+
157
+
158
+ /*************************************************************************
159
+ Obsolete 1-based subroutine
160
+ *************************************************************************/
161
+ void shermanmorrisonupdaterow(ap::real_2d_array& inva,
162
+ int n,
163
+ int updrow,
164
+ const ap::real_1d_array& v);
165
+
166
+
167
+ /*************************************************************************
168
+ Obsolete 1-based subroutine
169
+ *************************************************************************/
170
+ void shermanmorrisonupdatecolumn(ap::real_2d_array& inva,
171
+ int n,
172
+ int updcolumn,
173
+ const ap::real_1d_array& u);
174
+
175
+
176
+ /*************************************************************************
177
+ Obsolete 1-based subroutine
178
+ *************************************************************************/
179
+ void shermanmorrisonupdateuv(ap::real_2d_array& inva,
180
+ int n,
181
+ const ap::real_1d_array& u,
182
+ const ap::real_1d_array& v);
183
+
184
+
185
+ #endif
@@ -0,0 +1,164 @@
1
+ /*************************************************************************
2
+ Cephes Math Library Release 2.8: June, 2000
3
+ Copyright 1984, 1987, 2000 by Stephen L. Moshier
4
+
5
+ Contributors:
6
+ * Sergey Bochkanov (ALGLIB project). Translation from C to
7
+ pseudocode.
8
+
9
+ See subroutines comments for additional copyrights.
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are
13
+ met:
14
+
15
+ - Redistributions of source code must retain the above copyright
16
+ notice, this list of conditions and the following disclaimer.
17
+
18
+ - Redistributions in binary form must reproduce the above copyright
19
+ notice, this list of conditions and the following disclaimer listed
20
+ in this license in the documentation and/or other materials
21
+ provided with the distribution.
22
+
23
+ - Neither the name of the copyright holders nor the names of its
24
+ contributors may be used to endorse or promote products derived from
25
+ this software without specific prior written permission.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ *************************************************************************/
39
+
40
+ #include <stdafx.h>
41
+ #include "jacobianelliptic.h"
42
+
43
+ /*************************************************************************
44
+ Jacobian Elliptic Functions
45
+
46
+ Evaluates the Jacobian elliptic functions sn(u|m), cn(u|m),
47
+ and dn(u|m) of parameter m between 0 and 1, and real
48
+ argument u.
49
+
50
+ These functions are periodic, with quarter-period on the
51
+ real axis equal to the complete elliptic integral
52
+ ellpk(1.0-m).
53
+
54
+ Relation to incomplete elliptic integral:
55
+ If u = ellik(phi,m), then sn(u|m) = sin(phi),
56
+ and cn(u|m) = cos(phi). Phi is called the amplitude of u.
57
+
58
+ Computation is by means of the arithmetic-geometric mean
59
+ algorithm, except when m is within 1e-9 of 0 or 1. In the
60
+ latter case with m close to 1, the approximation applies
61
+ only for phi < pi/2.
62
+
63
+ ACCURACY:
64
+
65
+ Tested at random points with u between 0 and 10, m between
66
+ 0 and 1.
67
+
68
+ Absolute error (* = relative error):
69
+ arithmetic function # trials peak rms
70
+ IEEE phi 10000 9.2e-16* 1.4e-16*
71
+ IEEE sn 50000 4.1e-15 4.6e-16
72
+ IEEE cn 40000 3.6e-15 4.4e-16
73
+ IEEE dn 10000 1.3e-12 1.8e-14
74
+
75
+ Peak error observed in consistency check using addition
76
+ theorem for sn(u+v) was 4e-16 (absolute). Also tested by
77
+ the above relation to the incomplete elliptic integral.
78
+ Accuracy deteriorates when u is large.
79
+
80
+ Cephes Math Library Release 2.8: June, 2000
81
+ Copyright 1984, 1987, 2000 by Stephen L. Moshier
82
+ *************************************************************************/
83
+ void jacobianellipticfunctions(double u,
84
+ double m,
85
+ double& sn,
86
+ double& cn,
87
+ double& dn,
88
+ double& ph)
89
+ {
90
+ double ai;
91
+ double b;
92
+ double phi;
93
+ double t;
94
+ double twon;
95
+ ap::real_1d_array a;
96
+ ap::real_1d_array c;
97
+ int i;
98
+
99
+ ap::ap_error::make_assertion(m>=0&&m<=1, "Domain error in JacobianEllipticFunctions: m<0 or m>1");
100
+ a.setbounds(0, 8);
101
+ c.setbounds(0, 8);
102
+ if( m<1.0e-9 )
103
+ {
104
+ t = sin(u);
105
+ b = cos(u);
106
+ ai = 0.25*m*(u-t*b);
107
+ sn = t-ai*b;
108
+ cn = b+ai*t;
109
+ ph = u-ai;
110
+ dn = 1.0-0.5*m*t*t;
111
+ return;
112
+ }
113
+ if( m>=0.9999999999 )
114
+ {
115
+ ai = 0.25*(1.0-m);
116
+ b = cosh(u);
117
+ t = tanh(u);
118
+ phi = 1.0/b;
119
+ twon = b*sinh(u);
120
+ sn = t+ai*(twon-u)/(b*b);
121
+ ph = 2.0*atan(exp(u))-1.57079632679489661923+ai*(twon-u)/b;
122
+ ai = ai*t*phi;
123
+ cn = phi-ai*(twon-u);
124
+ dn = phi+ai*(twon+u);
125
+ return;
126
+ }
127
+ a(0) = 1.0;
128
+ b = sqrt(1.0-m);
129
+ c(0) = sqrt(m);
130
+ twon = 1.0;
131
+ i = 0;
132
+ while(fabs(c(i)/a(i))>ap::machineepsilon)
133
+ {
134
+ if( i>7 )
135
+ {
136
+ ap::ap_error::make_assertion(false, "Overflow in JacobianEllipticFunctions");
137
+ break;
138
+ }
139
+ ai = a(i);
140
+ i = i+1;
141
+ c(i) = 0.5*(ai-b);
142
+ t = sqrt(ai*b);
143
+ a(i) = 0.5*(ai+b);
144
+ b = t;
145
+ twon = twon*2.0;
146
+ }
147
+ phi = twon*a(i)*u;
148
+ do
149
+ {
150
+ t = c(i)*sin(phi)/a(i);
151
+ b = phi;
152
+ phi = (asin(t)+phi)/2.0;
153
+ i = i-1;
154
+ }
155
+ while(i!=0);
156
+ sn = sin(phi);
157
+ t = cos(phi);
158
+ cn = t;
159
+ dn = t/cos(phi-b);
160
+ ph = phi;
161
+ }
162
+
163
+
164
+
@@ -0,0 +1,94 @@
1
+ /*************************************************************************
2
+ Cephes Math Library Release 2.8: June, 2000
3
+ Copyright 1984, 1987, 2000 by Stephen L. Moshier
4
+
5
+ Contributors:
6
+ * Sergey Bochkanov (ALGLIB project). Translation from C to
7
+ pseudocode.
8
+
9
+ See subroutines comments for additional copyrights.
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are
13
+ met:
14
+
15
+ - Redistributions of source code must retain the above copyright
16
+ notice, this list of conditions and the following disclaimer.
17
+
18
+ - Redistributions in binary form must reproduce the above copyright
19
+ notice, this list of conditions and the following disclaimer listed
20
+ in this license in the documentation and/or other materials
21
+ provided with the distribution.
22
+
23
+ - Neither the name of the copyright holders nor the names of its
24
+ contributors may be used to endorse or promote products derived from
25
+ this software without specific prior written permission.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ *************************************************************************/
39
+
40
+ #ifndef _jacobianelliptic_h
41
+ #define _jacobianelliptic_h
42
+
43
+ #include "ap.h"
44
+ #include "ialglib.h"
45
+
46
+ /*************************************************************************
47
+ Jacobian Elliptic Functions
48
+
49
+ Evaluates the Jacobian elliptic functions sn(u|m), cn(u|m),
50
+ and dn(u|m) of parameter m between 0 and 1, and real
51
+ argument u.
52
+
53
+ These functions are periodic, with quarter-period on the
54
+ real axis equal to the complete elliptic integral
55
+ ellpk(1.0-m).
56
+
57
+ Relation to incomplete elliptic integral:
58
+ If u = ellik(phi,m), then sn(u|m) = sin(phi),
59
+ and cn(u|m) = cos(phi). Phi is called the amplitude of u.
60
+
61
+ Computation is by means of the arithmetic-geometric mean
62
+ algorithm, except when m is within 1e-9 of 0 or 1. In the
63
+ latter case with m close to 1, the approximation applies
64
+ only for phi < pi/2.
65
+
66
+ ACCURACY:
67
+
68
+ Tested at random points with u between 0 and 10, m between
69
+ 0 and 1.
70
+
71
+ Absolute error (* = relative error):
72
+ arithmetic function # trials peak rms
73
+ IEEE phi 10000 9.2e-16* 1.4e-16*
74
+ IEEE sn 50000 4.1e-15 4.6e-16
75
+ IEEE cn 40000 3.6e-15 4.4e-16
76
+ IEEE dn 10000 1.3e-12 1.8e-14
77
+
78
+ Peak error observed in consistency check using addition
79
+ theorem for sn(u+v) was 4e-16 (absolute). Also tested by
80
+ the above relation to the incomplete elliptic integral.
81
+ Accuracy deteriorates when u is large.
82
+
83
+ Cephes Math Library Release 2.8: June, 2000
84
+ Copyright 1984, 1987, 2000 by Stephen L. Moshier
85
+ *************************************************************************/
86
+ void jacobianellipticfunctions(double u,
87
+ double m,
88
+ double& sn,
89
+ double& cn,
90
+ double& dn,
91
+ double& ph);
92
+
93
+
94
+ #endif
@@ -0,0 +1,2271 @@
1
+ /*************************************************************************
2
+ Copyright (c) 2007, Sergey Bochkanov (ALGLIB project).
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are
6
+ met:
7
+
8
+ - Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+
11
+ - Redistributions in binary form must reproduce the above copyright
12
+ notice, this list of conditions and the following disclaimer listed
13
+ in this license in the documentation and/or other materials
14
+ provided with the distribution.
15
+
16
+ - Neither the name of the copyright holders nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ *************************************************************************/
32
+
33
+ #include <stdafx.h>
34
+ #include "jarquebera.h"
35
+
36
+ static void jarqueberastatistic(const ap::real_1d_array& x, int n, double& s);
37
+ static double jarqueberaapprox(int n, double s);
38
+ static double jbtbl5(double s);
39
+ static double jbtbl6(double s);
40
+ static double jbtbl7(double s);
41
+ static double jbtbl8(double s);
42
+ static double jbtbl9(double s);
43
+ static double jbtbl10(double s);
44
+ static double jbtbl11(double s);
45
+ static double jbtbl12(double s);
46
+ static double jbtbl13(double s);
47
+ static double jbtbl14(double s);
48
+ static double jbtbl15(double s);
49
+ static double jbtbl16(double s);
50
+ static double jbtbl17(double s);
51
+ static double jbtbl18(double s);
52
+ static double jbtbl19(double s);
53
+ static double jbtbl20(double s);
54
+ static double jbtbl30(double s);
55
+ static double jbtbl50(double s);
56
+ static double jbtbl65(double s);
57
+ static double jbtbl100(double s);
58
+ static double jbtbl130(double s);
59
+ static double jbtbl200(double s);
60
+ static double jbtbl301(double s);
61
+ static double jbtbl501(double s);
62
+ static double jbtbl701(double s);
63
+ static double jbtbl1401(double s);
64
+ static void jbcheb(double x, double c, double& tj, double& tj1, double& r);
65
+
66
+ /*************************************************************************
67
+ Jarque-Bera test
68
+
69
+ This test checks hypotheses about the fact that a given sample X is a
70
+ sample of normal random variable.
71
+
72
+ Requirements:
73
+ * the number of elements in the sample is not less than 5.
74
+
75
+ Input parameters:
76
+ X - sample. Array whose index goes from 0 to N-1.
77
+ N - size of the sample. N>=5
78
+
79
+ Output parameters:
80
+ BothTails - p-value for two-tailed test.
81
+ If BothTails is less than the given significance level
82
+ the null hypothesis is rejected.
83
+ LeftTail - p-value for left-tailed test.
84
+ If LeftTail is less than the given significance level,
85
+ the null hypothesis is rejected.
86
+ RightTail - p-value for right-tailed test.
87
+ If RightTail is less than the given significance level
88
+ the null hypothesis is rejected.
89
+
90
+ Accuracy of the approximation used (5<=N<=1951):
91
+
92
+ p-value relative error (5<=N<=1951)
93
+ [1, 0.1] < 1%
94
+ [0.1, 0.01] < 2%
95
+ [0.01, 0.001] < 6%
96
+ [0.001, 0] wasn't measured
97
+
98
+ For N>1951 accuracy wasn't measured but it shouldn't be sharply different
99
+ from table values.
100
+
101
+ -- ALGLIB --
102
+ Copyright 09.04.2007 by Bochkanov Sergey
103
+ *************************************************************************/
104
+ void jarqueberatest(const ap::real_1d_array& x, int n, double& p)
105
+ {
106
+ double s;
107
+
108
+
109
+ //
110
+ // N is too small
111
+ //
112
+ if( n<5 )
113
+ {
114
+ p = 1.0;
115
+ return;
116
+ }
117
+
118
+ //
119
+ // N is large enough
120
+ //
121
+ jarqueberastatistic(x, n, s);
122
+ p = jarqueberaapprox(n, s);
123
+ }
124
+
125
+
126
+ static void jarqueberastatistic(const ap::real_1d_array& x, int n, double& s)
127
+ {
128
+ int i;
129
+ double v;
130
+ double v1;
131
+ double v2;
132
+ double stddev;
133
+ double mean;
134
+ double variance;
135
+ double skewness;
136
+ double kurtosis;
137
+
138
+ mean = 0;
139
+ variance = 0;
140
+ skewness = 0;
141
+ kurtosis = 0;
142
+ stddev = 0;
143
+ ap::ap_error::make_assertion(n>1, "");
144
+
145
+ //
146
+ // Mean
147
+ //
148
+ for(i = 0; i <= n-1; i++)
149
+ {
150
+ mean = mean+x(i);
151
+ }
152
+ mean = mean/n;
153
+
154
+ //
155
+ // Variance (using corrected two-pass algorithm)
156
+ //
157
+ if( n!=1 )
158
+ {
159
+ v1 = 0;
160
+ for(i = 0; i <= n-1; i++)
161
+ {
162
+ v1 = v1+ap::sqr(x(i)-mean);
163
+ }
164
+ v2 = 0;
165
+ for(i = 0; i <= n-1; i++)
166
+ {
167
+ v2 = v2+(x(i)-mean);
168
+ }
169
+ v2 = ap::sqr(v2)/n;
170
+ variance = (v1-v2)/(n-1);
171
+ if( variance<0 )
172
+ {
173
+ variance = 0;
174
+ }
175
+ stddev = sqrt(variance);
176
+ }
177
+
178
+ //
179
+ // Skewness and kurtosis
180
+ //
181
+ if( stddev!=0 )
182
+ {
183
+ for(i = 0; i <= n-1; i++)
184
+ {
185
+ v = (x(i)-mean)/stddev;
186
+ v2 = ap::sqr(v);
187
+ skewness = skewness+v2*v;
188
+ kurtosis = kurtosis+ap::sqr(v2);
189
+ }
190
+ skewness = skewness/n;
191
+ kurtosis = kurtosis/n-3;
192
+ }
193
+
194
+ //
195
+ // Statistic
196
+ //
197
+ s = double(n)/double(6)*(ap::sqr(skewness)+ap::sqr(kurtosis)/4);
198
+ }
199
+
200
+
201
+ static double jarqueberaapprox(int n, double s)
202
+ {
203
+ double result;
204
+ ap::real_1d_array vx;
205
+ ap::real_1d_array vy;
206
+ ap::real_2d_array ctbl;
207
+ double t1;
208
+ double t2;
209
+ double t3;
210
+ double t;
211
+ double f1;
212
+ double f2;
213
+ double f3;
214
+ double f;
215
+ double f12;
216
+ double f23;
217
+ double x;
218
+
219
+ result = 1;
220
+ x = s;
221
+ if( n<5 )
222
+ {
223
+ return result;
224
+ }
225
+
226
+ //
227
+ // N = 5..20 are tabulated
228
+ //
229
+ if( n>=5&&n<=20 )
230
+ {
231
+ if( n==5 )
232
+ {
233
+ result = exp(jbtbl5(x));
234
+ }
235
+ if( n==6 )
236
+ {
237
+ result = exp(jbtbl6(x));
238
+ }
239
+ if( n==7 )
240
+ {
241
+ result = exp(jbtbl7(x));
242
+ }
243
+ if( n==8 )
244
+ {
245
+ result = exp(jbtbl8(x));
246
+ }
247
+ if( n==9 )
248
+ {
249
+ result = exp(jbtbl9(x));
250
+ }
251
+ if( n==10 )
252
+ {
253
+ result = exp(jbtbl10(x));
254
+ }
255
+ if( n==11 )
256
+ {
257
+ result = exp(jbtbl11(x));
258
+ }
259
+ if( n==12 )
260
+ {
261
+ result = exp(jbtbl12(x));
262
+ }
263
+ if( n==13 )
264
+ {
265
+ result = exp(jbtbl13(x));
266
+ }
267
+ if( n==14 )
268
+ {
269
+ result = exp(jbtbl14(x));
270
+ }
271
+ if( n==15 )
272
+ {
273
+ result = exp(jbtbl15(x));
274
+ }
275
+ if( n==16 )
276
+ {
277
+ result = exp(jbtbl16(x));
278
+ }
279
+ if( n==17 )
280
+ {
281
+ result = exp(jbtbl17(x));
282
+ }
283
+ if( n==18 )
284
+ {
285
+ result = exp(jbtbl18(x));
286
+ }
287
+ if( n==19 )
288
+ {
289
+ result = exp(jbtbl19(x));
290
+ }
291
+ if( n==20 )
292
+ {
293
+ result = exp(jbtbl20(x));
294
+ }
295
+ return result;
296
+ }
297
+
298
+ //
299
+ // N = 20, 30, 50 are tabulated.
300
+ // In-between values are interpolated
301
+ // using interpolating polynomial of the second degree.
302
+ //
303
+ if( n>20&&n<=50 )
304
+ {
305
+ t1 = -1.0/20.0;
306
+ t2 = -1.0/30.0;
307
+ t3 = -1.0/50.0;
308
+ t = -1.0/n;
309
+ f1 = jbtbl20(x);
310
+ f2 = jbtbl30(x);
311
+ f3 = jbtbl50(x);
312
+ f12 = ((t-t2)*f1+(t1-t)*f2)/(t1-t2);
313
+ f23 = ((t-t3)*f2+(t2-t)*f3)/(t2-t3);
314
+ result = ((t-t3)*f12+(t1-t)*f23)/(t1-t3);
315
+ if( result>0 )
316
+ {
317
+ result = 0;
318
+ }
319
+ result = exp(result);
320
+ return result;
321
+ }
322
+
323
+ //
324
+ // N = 50, 65, 100 are tabulated.
325
+ // In-between values are interpolated
326
+ // using interpolating polynomial of the second degree.
327
+ //
328
+ if( n>50&&n<=100 )
329
+ {
330
+ t1 = -1.0/50.0;
331
+ t2 = -1.0/65.0;
332
+ t3 = -1.0/100.0;
333
+ t = -1.0/n;
334
+ f1 = jbtbl50(x);
335
+ f2 = jbtbl65(x);
336
+ f3 = jbtbl100(x);
337
+ f12 = ((t-t2)*f1+(t1-t)*f2)/(t1-t2);
338
+ f23 = ((t-t3)*f2+(t2-t)*f3)/(t2-t3);
339
+ result = ((t-t3)*f12+(t1-t)*f23)/(t1-t3);
340
+ if( result>0 )
341
+ {
342
+ result = 0;
343
+ }
344
+ result = exp(result);
345
+ return result;
346
+ }
347
+
348
+ //
349
+ // N = 100, 130, 200 are tabulated.
350
+ // In-between values are interpolated
351
+ // using interpolating polynomial of the second degree.
352
+ //
353
+ if( n>100&&n<=200 )
354
+ {
355
+ t1 = -1.0/100.0;
356
+ t2 = -1.0/130.0;
357
+ t3 = -1.0/200.0;
358
+ t = -1.0/n;
359
+ f1 = jbtbl100(x);
360
+ f2 = jbtbl130(x);
361
+ f3 = jbtbl200(x);
362
+ f12 = ((t-t2)*f1+(t1-t)*f2)/(t1-t2);
363
+ f23 = ((t-t3)*f2+(t2-t)*f3)/(t2-t3);
364
+ result = ((t-t3)*f12+(t1-t)*f23)/(t1-t3);
365
+ if( result>0 )
366
+ {
367
+ result = 0;
368
+ }
369
+ result = exp(result);
370
+ return result;
371
+ }
372
+
373
+ //
374
+ // N = 200, 301, 501 are tabulated.
375
+ // In-between values are interpolated
376
+ // using interpolating polynomial of the second degree.
377
+ //
378
+ if( n>200&&n<=501 )
379
+ {
380
+ t1 = -1.0/200.0;
381
+ t2 = -1.0/301.0;
382
+ t3 = -1.0/501.0;
383
+ t = -1.0/n;
384
+ f1 = jbtbl200(x);
385
+ f2 = jbtbl301(x);
386
+ f3 = jbtbl501(x);
387
+ f12 = ((t-t2)*f1+(t1-t)*f2)/(t1-t2);
388
+ f23 = ((t-t3)*f2+(t2-t)*f3)/(t2-t3);
389
+ result = ((t-t3)*f12+(t1-t)*f23)/(t1-t3);
390
+ if( result>0 )
391
+ {
392
+ result = 0;
393
+ }
394
+ result = exp(result);
395
+ return result;
396
+ }
397
+
398
+ //
399
+ // N = 501, 701, 1401 are tabulated.
400
+ // In-between values are interpolated
401
+ // using interpolating polynomial of the second degree.
402
+ //
403
+ if( n>501&&n<=1401 )
404
+ {
405
+ t1 = -1.0/501.0;
406
+ t2 = -1.0/701.0;
407
+ t3 = -1.0/1401.0;
408
+ t = -1.0/n;
409
+ f1 = jbtbl501(x);
410
+ f2 = jbtbl701(x);
411
+ f3 = jbtbl1401(x);
412
+ f12 = ((t-t2)*f1+(t1-t)*f2)/(t1-t2);
413
+ f23 = ((t-t3)*f2+(t2-t)*f3)/(t2-t3);
414
+ result = ((t-t3)*f12+(t1-t)*f23)/(t1-t3);
415
+ if( result>0 )
416
+ {
417
+ result = 0;
418
+ }
419
+ result = exp(result);
420
+ return result;
421
+ }
422
+
423
+ //
424
+ // Asymptotic expansion
425
+ //
426
+ if( n>1401 )
427
+ {
428
+ result = -0.5*x+(jbtbl1401(x)+0.5*x)*sqrt(double(1401)/double(n));
429
+ if( result>0 )
430
+ {
431
+ result = 0;
432
+ }
433
+ result = exp(result);
434
+ return result;
435
+ }
436
+ return result;
437
+ }
438
+
439
+
440
+ static double jbtbl5(double s)
441
+ {
442
+ double result;
443
+ double x;
444
+ double tj;
445
+ double tj1;
446
+
447
+ result = 0;
448
+ if( s<=0.4000 )
449
+ {
450
+ x = 2*(s-0.000000)/0.400000-1;
451
+ tj = 1;
452
+ tj1 = x;
453
+ jbcheb(x, -1.097885e-20, tj, tj1, result);
454
+ jbcheb(x, -2.854501e-20, tj, tj1, result);
455
+ jbcheb(x, -1.756616e-20, tj, tj1, result);
456
+ if( result>0 )
457
+ {
458
+ result = 0;
459
+ }
460
+ return result;
461
+ }
462
+ if( s<=1.1000 )
463
+ {
464
+ x = 2*(s-0.400000)/0.700000-1;
465
+ tj = 1;
466
+ tj1 = x;
467
+ jbcheb(x, -1.324545e+00, tj, tj1, result);
468
+ jbcheb(x, -1.075941e+00, tj, tj1, result);
469
+ jbcheb(x, -9.772272e-01, tj, tj1, result);
470
+ jbcheb(x, 3.175686e-01, tj, tj1, result);
471
+ jbcheb(x, -1.576162e-01, tj, tj1, result);
472
+ jbcheb(x, 1.126861e-01, tj, tj1, result);
473
+ jbcheb(x, -3.434425e-02, tj, tj1, result);
474
+ jbcheb(x, -2.790359e-01, tj, tj1, result);
475
+ jbcheb(x, 2.809178e-02, tj, tj1, result);
476
+ jbcheb(x, -5.479704e-01, tj, tj1, result);
477
+ jbcheb(x, 3.717040e-02, tj, tj1, result);
478
+ jbcheb(x, -5.294170e-01, tj, tj1, result);
479
+ jbcheb(x, 2.880632e-02, tj, tj1, result);
480
+ jbcheb(x, -3.023344e-01, tj, tj1, result);
481
+ jbcheb(x, 1.601531e-02, tj, tj1, result);
482
+ jbcheb(x, -7.920403e-02, tj, tj1, result);
483
+ if( result>0 )
484
+ {
485
+ result = 0;
486
+ }
487
+ return result;
488
+ }
489
+ result = -5.188419e+02*(s-1.100000e+00)-4.767297e+00;
490
+ return result;
491
+ }
492
+
493
+
494
+ static double jbtbl6(double s)
495
+ {
496
+ double result;
497
+ double x;
498
+ double tj;
499
+ double tj1;
500
+
501
+ result = 0;
502
+ if( s<=0.2500 )
503
+ {
504
+ x = 2*(s-0.000000)/0.250000-1;
505
+ tj = 1;
506
+ tj1 = x;
507
+ jbcheb(x, -2.274707e-04, tj, tj1, result);
508
+ jbcheb(x, -5.700471e-04, tj, tj1, result);
509
+ jbcheb(x, -3.425764e-04, tj, tj1, result);
510
+ if( result>0 )
511
+ {
512
+ result = 0;
513
+ }
514
+ return result;
515
+ }
516
+ if( s<=1.3000 )
517
+ {
518
+ x = 2*(s-0.250000)/1.050000-1;
519
+ tj = 1;
520
+ tj1 = x;
521
+ jbcheb(x, -1.339000e+00, tj, tj1, result);
522
+ jbcheb(x, -2.011104e+00, tj, tj1, result);
523
+ jbcheb(x, -8.168177e-01, tj, tj1, result);
524
+ jbcheb(x, -1.085666e-01, tj, tj1, result);
525
+ jbcheb(x, 7.738606e-02, tj, tj1, result);
526
+ jbcheb(x, 7.022876e-02, tj, tj1, result);
527
+ jbcheb(x, 3.462402e-02, tj, tj1, result);
528
+ jbcheb(x, 6.908270e-03, tj, tj1, result);
529
+ jbcheb(x, -8.230772e-03, tj, tj1, result);
530
+ jbcheb(x, -1.006996e-02, tj, tj1, result);
531
+ jbcheb(x, -5.410222e-03, tj, tj1, result);
532
+ jbcheb(x, -2.893768e-03, tj, tj1, result);
533
+ jbcheb(x, 8.114564e-04, tj, tj1, result);
534
+ if( result>0 )
535
+ {
536
+ result = 0;
537
+ }
538
+ return result;
539
+ }
540
+ if( s<=1.8500 )
541
+ {
542
+ x = 2*(s-1.300000)/0.550000-1;
543
+ tj = 1;
544
+ tj1 = x;
545
+ jbcheb(x, -6.794311e+00, tj, tj1, result);
546
+ jbcheb(x, -3.578700e+00, tj, tj1, result);
547
+ jbcheb(x, -1.394664e+00, tj, tj1, result);
548
+ jbcheb(x, -7.928290e-01, tj, tj1, result);
549
+ jbcheb(x, -4.813273e-01, tj, tj1, result);
550
+ jbcheb(x, -3.076063e-01, tj, tj1, result);
551
+ jbcheb(x, -1.835380e-01, tj, tj1, result);
552
+ jbcheb(x, -1.013013e-01, tj, tj1, result);
553
+ jbcheb(x, -5.058903e-02, tj, tj1, result);
554
+ jbcheb(x, -1.856915e-02, tj, tj1, result);
555
+ jbcheb(x, -6.710887e-03, tj, tj1, result);
556
+ if( result>0 )
557
+ {
558
+ result = 0;
559
+ }
560
+ return result;
561
+ }
562
+ result = -1.770029e+02*(s-1.850000e+00)-1.371015e+01;
563
+ return result;
564
+ }
565
+
566
+
567
+ static double jbtbl7(double s)
568
+ {
569
+ double result;
570
+ double x;
571
+ double tj;
572
+ double tj1;
573
+
574
+ result = 0;
575
+ if( s<=1.4000 )
576
+ {
577
+ x = 2*(s-0.000000)/1.400000-1;
578
+ tj = 1;
579
+ tj1 = x;
580
+ jbcheb(x, -1.093681e+00, tj, tj1, result);
581
+ jbcheb(x, -1.695911e+00, tj, tj1, result);
582
+ jbcheb(x, -7.473192e-01, tj, tj1, result);
583
+ jbcheb(x, -1.203236e-01, tj, tj1, result);
584
+ jbcheb(x, 6.590379e-02, tj, tj1, result);
585
+ jbcheb(x, 6.291876e-02, tj, tj1, result);
586
+ jbcheb(x, 3.132007e-02, tj, tj1, result);
587
+ jbcheb(x, 9.411147e-03, tj, tj1, result);
588
+ jbcheb(x, -1.180067e-03, tj, tj1, result);
589
+ jbcheb(x, -3.487610e-03, tj, tj1, result);
590
+ jbcheb(x, -2.436561e-03, tj, tj1, result);
591
+ if( result>0 )
592
+ {
593
+ result = 0;
594
+ }
595
+ return result;
596
+ }
597
+ if( s<=3.0000 )
598
+ {
599
+ x = 2*(s-1.400000)/1.600000-1;
600
+ tj = 1;
601
+ tj1 = x;
602
+ jbcheb(x, -5.947854e+00, tj, tj1, result);
603
+ jbcheb(x, -2.772675e+00, tj, tj1, result);
604
+ jbcheb(x, -4.707912e-01, tj, tj1, result);
605
+ jbcheb(x, -1.691171e-01, tj, tj1, result);
606
+ jbcheb(x, -4.132795e-02, tj, tj1, result);
607
+ jbcheb(x, -1.481310e-02, tj, tj1, result);
608
+ jbcheb(x, 2.867536e-03, tj, tj1, result);
609
+ jbcheb(x, 8.772327e-04, tj, tj1, result);
610
+ jbcheb(x, 5.033387e-03, tj, tj1, result);
611
+ jbcheb(x, -1.378277e-03, tj, tj1, result);
612
+ jbcheb(x, -2.497964e-03, tj, tj1, result);
613
+ jbcheb(x, -3.636814e-03, tj, tj1, result);
614
+ jbcheb(x, -9.581640e-04, tj, tj1, result);
615
+ if( result>0 )
616
+ {
617
+ result = 0;
618
+ }
619
+ return result;
620
+ }
621
+ if( s<=3.2000 )
622
+ {
623
+ x = 2*(s-3.000000)/0.200000-1;
624
+ tj = 1;
625
+ tj1 = x;
626
+ jbcheb(x, -7.511008e+00, tj, tj1, result);
627
+ jbcheb(x, -8.140472e-01, tj, tj1, result);
628
+ jbcheb(x, 1.682053e+00, tj, tj1, result);
629
+ jbcheb(x, -2.568561e-02, tj, tj1, result);
630
+ jbcheb(x, -1.933930e+00, tj, tj1, result);
631
+ jbcheb(x, -8.140472e-01, tj, tj1, result);
632
+ jbcheb(x, -3.895025e+00, tj, tj1, result);
633
+ jbcheb(x, -8.140472e-01, tj, tj1, result);
634
+ jbcheb(x, -1.933930e+00, tj, tj1, result);
635
+ jbcheb(x, -2.568561e-02, tj, tj1, result);
636
+ jbcheb(x, 1.682053e+00, tj, tj1, result);
637
+ if( result>0 )
638
+ {
639
+ result = 0;
640
+ }
641
+ return result;
642
+ }
643
+ result = -1.824116e+03*(s-3.200000e+00)-1.440330e+01;
644
+ return result;
645
+ }
646
+
647
+
648
+ static double jbtbl8(double s)
649
+ {
650
+ double result;
651
+ double x;
652
+ double tj;
653
+ double tj1;
654
+
655
+ result = 0;
656
+ if( s<=1.3000 )
657
+ {
658
+ x = 2*(s-0.000000)/1.300000-1;
659
+ tj = 1;
660
+ tj1 = x;
661
+ jbcheb(x, -7.199015e-01, tj, tj1, result);
662
+ jbcheb(x, -1.095921e+00, tj, tj1, result);
663
+ jbcheb(x, -4.736828e-01, tj, tj1, result);
664
+ jbcheb(x, -1.047438e-01, tj, tj1, result);
665
+ jbcheb(x, -2.484320e-03, tj, tj1, result);
666
+ jbcheb(x, 7.937923e-03, tj, tj1, result);
667
+ jbcheb(x, 4.810470e-03, tj, tj1, result);
668
+ jbcheb(x, 2.139780e-03, tj, tj1, result);
669
+ jbcheb(x, 6.708443e-04, tj, tj1, result);
670
+ if( result>0 )
671
+ {
672
+ result = 0;
673
+ }
674
+ return result;
675
+ }
676
+ if( s<=2.0000 )
677
+ {
678
+ x = 2*(s-1.300000)/0.700000-1;
679
+ tj = 1;
680
+ tj1 = x;
681
+ jbcheb(x, -3.378966e+00, tj, tj1, result);
682
+ jbcheb(x, -7.802461e-01, tj, tj1, result);
683
+ jbcheb(x, 1.547593e-01, tj, tj1, result);
684
+ jbcheb(x, -6.241042e-02, tj, tj1, result);
685
+ jbcheb(x, 1.203274e-02, tj, tj1, result);
686
+ jbcheb(x, 5.201990e-03, tj, tj1, result);
687
+ jbcheb(x, -5.125597e-03, tj, tj1, result);
688
+ jbcheb(x, 1.584426e-03, tj, tj1, result);
689
+ jbcheb(x, 2.546069e-04, tj, tj1, result);
690
+ if( result>0 )
691
+ {
692
+ result = 0;
693
+ }
694
+ return result;
695
+ }
696
+ if( s<=5.0000 )
697
+ {
698
+ x = 2*(s-2.000000)/3.000000-1;
699
+ tj = 1;
700
+ tj1 = x;
701
+ jbcheb(x, -6.828366e+00, tj, tj1, result);
702
+ jbcheb(x, -3.137533e+00, tj, tj1, result);
703
+ jbcheb(x, -5.016671e-01, tj, tj1, result);
704
+ jbcheb(x, -1.745637e-01, tj, tj1, result);
705
+ jbcheb(x, -5.189801e-02, tj, tj1, result);
706
+ jbcheb(x, -1.621610e-02, tj, tj1, result);
707
+ jbcheb(x, -6.741122e-03, tj, tj1, result);
708
+ jbcheb(x, -4.516368e-03, tj, tj1, result);
709
+ jbcheb(x, 3.552085e-04, tj, tj1, result);
710
+ jbcheb(x, 2.787029e-03, tj, tj1, result);
711
+ jbcheb(x, 5.359774e-03, tj, tj1, result);
712
+ if( result>0 )
713
+ {
714
+ result = 0;
715
+ }
716
+ return result;
717
+ }
718
+ result = -5.087028e+00*(s-5.000000e+00)-1.071300e+01;
719
+ return result;
720
+ }
721
+
722
+
723
+ static double jbtbl9(double s)
724
+ {
725
+ double result;
726
+ double x;
727
+ double tj;
728
+ double tj1;
729
+
730
+ result = 0;
731
+ if( s<=1.3000 )
732
+ {
733
+ x = 2*(s-0.000000)/1.300000-1;
734
+ tj = 1;
735
+ tj1 = x;
736
+ jbcheb(x, -6.279320e-01, tj, tj1, result);
737
+ jbcheb(x, -9.277151e-01, tj, tj1, result);
738
+ jbcheb(x, -3.669339e-01, tj, tj1, result);
739
+ jbcheb(x, -7.086149e-02, tj, tj1, result);
740
+ jbcheb(x, -1.333816e-03, tj, tj1, result);
741
+ jbcheb(x, 3.871249e-03, tj, tj1, result);
742
+ jbcheb(x, 2.007048e-03, tj, tj1, result);
743
+ jbcheb(x, 7.482245e-04, tj, tj1, result);
744
+ jbcheb(x, 2.355615e-04, tj, tj1, result);
745
+ if( result>0 )
746
+ {
747
+ result = 0;
748
+ }
749
+ return result;
750
+ }
751
+ if( s<=2.0000 )
752
+ {
753
+ x = 2*(s-1.300000)/0.700000-1;
754
+ tj = 1;
755
+ tj1 = x;
756
+ jbcheb(x, -2.981430e+00, tj, tj1, result);
757
+ jbcheb(x, -7.972248e-01, tj, tj1, result);
758
+ jbcheb(x, 1.747737e-01, tj, tj1, result);
759
+ jbcheb(x, -3.808530e-02, tj, tj1, result);
760
+ jbcheb(x, -7.888305e-03, tj, tj1, result);
761
+ jbcheb(x, 9.001302e-03, tj, tj1, result);
762
+ jbcheb(x, -1.378767e-03, tj, tj1, result);
763
+ jbcheb(x, -1.108510e-03, tj, tj1, result);
764
+ jbcheb(x, 5.915372e-04, tj, tj1, result);
765
+ if( result>0 )
766
+ {
767
+ result = 0;
768
+ }
769
+ return result;
770
+ }
771
+ if( s<=7.0000 )
772
+ {
773
+ x = 2*(s-2.000000)/5.000000-1;
774
+ tj = 1;
775
+ tj1 = x;
776
+ jbcheb(x, -6.387463e+00, tj, tj1, result);
777
+ jbcheb(x, -2.845231e+00, tj, tj1, result);
778
+ jbcheb(x, -1.809956e-01, tj, tj1, result);
779
+ jbcheb(x, -7.543461e-02, tj, tj1, result);
780
+ jbcheb(x, -4.880397e-03, tj, tj1, result);
781
+ jbcheb(x, -1.160074e-02, tj, tj1, result);
782
+ jbcheb(x, -7.356527e-03, tj, tj1, result);
783
+ jbcheb(x, -4.394428e-03, tj, tj1, result);
784
+ jbcheb(x, 9.619892e-04, tj, tj1, result);
785
+ jbcheb(x, -2.758763e-04, tj, tj1, result);
786
+ jbcheb(x, 4.790977e-05, tj, tj1, result);
787
+ if( result>0 )
788
+ {
789
+ result = 0;
790
+ }
791
+ return result;
792
+ }
793
+ result = -2.020952e+00*(s-7.000000e+00)-9.516623e+00;
794
+ return result;
795
+ }
796
+
797
+
798
+ static double jbtbl10(double s)
799
+ {
800
+ double result;
801
+ double x;
802
+ double tj;
803
+ double tj1;
804
+
805
+ result = 0;
806
+ if( s<=1.2000 )
807
+ {
808
+ x = 2*(s-0.000000)/1.200000-1;
809
+ tj = 1;
810
+ tj1 = x;
811
+ jbcheb(x, -4.590993e-01, tj, tj1, result);
812
+ jbcheb(x, -6.562730e-01, tj, tj1, result);
813
+ jbcheb(x, -2.353934e-01, tj, tj1, result);
814
+ jbcheb(x, -4.069933e-02, tj, tj1, result);
815
+ jbcheb(x, -1.849151e-03, tj, tj1, result);
816
+ jbcheb(x, 8.931406e-04, tj, tj1, result);
817
+ jbcheb(x, 3.636295e-04, tj, tj1, result);
818
+ jbcheb(x, 1.178340e-05, tj, tj1, result);
819
+ jbcheb(x, -8.917749e-05, tj, tj1, result);
820
+ if( result>0 )
821
+ {
822
+ result = 0;
823
+ }
824
+ return result;
825
+ }
826
+ if( s<=2.0000 )
827
+ {
828
+ x = 2*(s-1.200000)/0.800000-1;
829
+ tj = 1;
830
+ tj1 = x;
831
+ jbcheb(x, -2.537658e+00, tj, tj1, result);
832
+ jbcheb(x, -9.962401e-01, tj, tj1, result);
833
+ jbcheb(x, 1.838715e-01, tj, tj1, result);
834
+ jbcheb(x, 1.055792e-02, tj, tj1, result);
835
+ jbcheb(x, -2.580316e-02, tj, tj1, result);
836
+ jbcheb(x, 1.781701e-03, tj, tj1, result);
837
+ jbcheb(x, 3.770362e-03, tj, tj1, result);
838
+ jbcheb(x, -4.838983e-04, tj, tj1, result);
839
+ jbcheb(x, -6.999052e-04, tj, tj1, result);
840
+ if( result>0 )
841
+ {
842
+ result = 0;
843
+ }
844
+ return result;
845
+ }
846
+ if( s<=7.0000 )
847
+ {
848
+ x = 2*(s-2.000000)/5.000000-1;
849
+ tj = 1;
850
+ tj1 = x;
851
+ jbcheb(x, -5.337524e+00, tj, tj1, result);
852
+ jbcheb(x, -1.877029e+00, tj, tj1, result);
853
+ jbcheb(x, 4.734650e-02, tj, tj1, result);
854
+ jbcheb(x, -4.249254e-02, tj, tj1, result);
855
+ jbcheb(x, 3.320250e-03, tj, tj1, result);
856
+ jbcheb(x, -6.432266e-03, tj, tj1, result);
857
+ if( result>0 )
858
+ {
859
+ result = 0;
860
+ }
861
+ return result;
862
+ }
863
+ result = -8.711035e-01*(s-7.000000e+00)-7.212811e+00;
864
+ return result;
865
+ }
866
+
867
+
868
+ static double jbtbl11(double s)
869
+ {
870
+ double result;
871
+ double x;
872
+ double tj;
873
+ double tj1;
874
+
875
+ result = 0;
876
+ if( s<=1.2000 )
877
+ {
878
+ x = 2*(s-0.000000)/1.200000-1;
879
+ tj = 1;
880
+ tj1 = x;
881
+ jbcheb(x, -4.339517e-01, tj, tj1, result);
882
+ jbcheb(x, -6.051558e-01, tj, tj1, result);
883
+ jbcheb(x, -2.000992e-01, tj, tj1, result);
884
+ jbcheb(x, -3.022547e-02, tj, tj1, result);
885
+ jbcheb(x, -9.808401e-04, tj, tj1, result);
886
+ jbcheb(x, 5.592870e-04, tj, tj1, result);
887
+ jbcheb(x, 3.575081e-04, tj, tj1, result);
888
+ jbcheb(x, 2.086173e-04, tj, tj1, result);
889
+ jbcheb(x, 6.089011e-05, tj, tj1, result);
890
+ if( result>0 )
891
+ {
892
+ result = 0;
893
+ }
894
+ return result;
895
+ }
896
+ if( s<=2.2500 )
897
+ {
898
+ x = 2*(s-1.200000)/1.050000-1;
899
+ tj = 1;
900
+ tj1 = x;
901
+ jbcheb(x, -2.523221e+00, tj, tj1, result);
902
+ jbcheb(x, -1.068388e+00, tj, tj1, result);
903
+ jbcheb(x, 2.179661e-01, tj, tj1, result);
904
+ jbcheb(x, -1.555524e-03, tj, tj1, result);
905
+ jbcheb(x, -3.238964e-02, tj, tj1, result);
906
+ jbcheb(x, 7.364320e-03, tj, tj1, result);
907
+ jbcheb(x, 4.895771e-03, tj, tj1, result);
908
+ jbcheb(x, -1.762774e-03, tj, tj1, result);
909
+ jbcheb(x, -8.201340e-04, tj, tj1, result);
910
+ if( result>0 )
911
+ {
912
+ result = 0;
913
+ }
914
+ return result;
915
+ }
916
+ if( s<=8.0000 )
917
+ {
918
+ x = 2*(s-2.250000)/5.750000-1;
919
+ tj = 1;
920
+ tj1 = x;
921
+ jbcheb(x, -5.212179e+00, tj, tj1, result);
922
+ jbcheb(x, -1.684579e+00, tj, tj1, result);
923
+ jbcheb(x, 8.299519e-02, tj, tj1, result);
924
+ jbcheb(x, -3.606261e-02, tj, tj1, result);
925
+ jbcheb(x, 7.310869e-03, tj, tj1, result);
926
+ jbcheb(x, -3.320115e-03, tj, tj1, result);
927
+ if( result>0 )
928
+ {
929
+ result = 0;
930
+ }
931
+ return result;
932
+ }
933
+ result = -5.715445e-01*(s-8.000000e+00)-6.845834e+00;
934
+ return result;
935
+ }
936
+
937
+
938
+ static double jbtbl12(double s)
939
+ {
940
+ double result;
941
+ double x;
942
+ double tj;
943
+ double tj1;
944
+
945
+ result = 0;
946
+ if( s<=1.0000 )
947
+ {
948
+ x = 2*(s-0.000000)/1.000000-1;
949
+ tj = 1;
950
+ tj1 = x;
951
+ jbcheb(x, -2.736742e-01, tj, tj1, result);
952
+ jbcheb(x, -3.657836e-01, tj, tj1, result);
953
+ jbcheb(x, -1.047209e-01, tj, tj1, result);
954
+ jbcheb(x, -1.319599e-02, tj, tj1, result);
955
+ jbcheb(x, -5.545631e-04, tj, tj1, result);
956
+ jbcheb(x, 9.280445e-05, tj, tj1, result);
957
+ jbcheb(x, 2.815679e-05, tj, tj1, result);
958
+ jbcheb(x, -2.213519e-05, tj, tj1, result);
959
+ jbcheb(x, 1.256838e-05, tj, tj1, result);
960
+ if( result>0 )
961
+ {
962
+ result = 0;
963
+ }
964
+ return result;
965
+ }
966
+ if( s<=3.0000 )
967
+ {
968
+ x = 2*(s-1.000000)/2.000000-1;
969
+ tj = 1;
970
+ tj1 = x;
971
+ jbcheb(x, -2.573947e+00, tj, tj1, result);
972
+ jbcheb(x, -1.515287e+00, tj, tj1, result);
973
+ jbcheb(x, 3.611880e-01, tj, tj1, result);
974
+ jbcheb(x, -3.271311e-02, tj, tj1, result);
975
+ jbcheb(x, -6.495815e-02, tj, tj1, result);
976
+ jbcheb(x, 4.141186e-02, tj, tj1, result);
977
+ jbcheb(x, 7.180886e-04, tj, tj1, result);
978
+ jbcheb(x, -1.388211e-02, tj, tj1, result);
979
+ jbcheb(x, 4.890761e-03, tj, tj1, result);
980
+ jbcheb(x, 3.233175e-03, tj, tj1, result);
981
+ jbcheb(x, -2.946156e-03, tj, tj1, result);
982
+ if( result>0 )
983
+ {
984
+ result = 0;
985
+ }
986
+ return result;
987
+ }
988
+ if( s<=12.0000 )
989
+ {
990
+ x = 2*(s-3.000000)/9.000000-1;
991
+ tj = 1;
992
+ tj1 = x;
993
+ jbcheb(x, -5.947819e+00, tj, tj1, result);
994
+ jbcheb(x, -2.034157e+00, tj, tj1, result);
995
+ jbcheb(x, 6.878986e-02, tj, tj1, result);
996
+ jbcheb(x, -4.078603e-02, tj, tj1, result);
997
+ jbcheb(x, 6.990977e-03, tj, tj1, result);
998
+ jbcheb(x, -2.866215e-03, tj, tj1, result);
999
+ jbcheb(x, 3.897866e-03, tj, tj1, result);
1000
+ jbcheb(x, 2.512252e-03, tj, tj1, result);
1001
+ jbcheb(x, 2.073743e-03, tj, tj1, result);
1002
+ jbcheb(x, 3.022621e-03, tj, tj1, result);
1003
+ jbcheb(x, 1.501343e-03, tj, tj1, result);
1004
+ if( result>0 )
1005
+ {
1006
+ result = 0;
1007
+ }
1008
+ return result;
1009
+ }
1010
+ result = -2.877243e-01*(s-1.200000e+01)-7.936839e+00;
1011
+ return result;
1012
+ }
1013
+
1014
+
1015
+ static double jbtbl13(double s)
1016
+ {
1017
+ double result;
1018
+ double x;
1019
+ double tj;
1020
+ double tj1;
1021
+
1022
+ result = 0;
1023
+ if( s<=1.0000 )
1024
+ {
1025
+ x = 2*(s-0.000000)/1.000000-1;
1026
+ tj = 1;
1027
+ tj1 = x;
1028
+ jbcheb(x, -2.713276e-01, tj, tj1, result);
1029
+ jbcheb(x, -3.557541e-01, tj, tj1, result);
1030
+ jbcheb(x, -9.459092e-02, tj, tj1, result);
1031
+ jbcheb(x, -1.044145e-02, tj, tj1, result);
1032
+ jbcheb(x, -2.546132e-04, tj, tj1, result);
1033
+ jbcheb(x, 1.002374e-04, tj, tj1, result);
1034
+ jbcheb(x, 2.349456e-05, tj, tj1, result);
1035
+ jbcheb(x, -7.025669e-05, tj, tj1, result);
1036
+ jbcheb(x, -1.590242e-05, tj, tj1, result);
1037
+ if( result>0 )
1038
+ {
1039
+ result = 0;
1040
+ }
1041
+ return result;
1042
+ }
1043
+ if( s<=3.0000 )
1044
+ {
1045
+ x = 2*(s-1.000000)/2.000000-1;
1046
+ tj = 1;
1047
+ tj1 = x;
1048
+ jbcheb(x, -2.454383e+00, tj, tj1, result);
1049
+ jbcheb(x, -1.467539e+00, tj, tj1, result);
1050
+ jbcheb(x, 3.270774e-01, tj, tj1, result);
1051
+ jbcheb(x, -8.075763e-03, tj, tj1, result);
1052
+ jbcheb(x, -6.611647e-02, tj, tj1, result);
1053
+ jbcheb(x, 2.990785e-02, tj, tj1, result);
1054
+ jbcheb(x, 8.109212e-03, tj, tj1, result);
1055
+ jbcheb(x, -1.135031e-02, tj, tj1, result);
1056
+ jbcheb(x, 5.915919e-04, tj, tj1, result);
1057
+ jbcheb(x, 3.522390e-03, tj, tj1, result);
1058
+ jbcheb(x, -1.144701e-03, tj, tj1, result);
1059
+ if( result>0 )
1060
+ {
1061
+ result = 0;
1062
+ }
1063
+ return result;
1064
+ }
1065
+ if( s<=13.0000 )
1066
+ {
1067
+ x = 2*(s-3.000000)/10.000000-1;
1068
+ tj = 1;
1069
+ tj1 = x;
1070
+ jbcheb(x, -5.736127e+00, tj, tj1, result);
1071
+ jbcheb(x, -1.920809e+00, tj, tj1, result);
1072
+ jbcheb(x, 1.175858e-01, tj, tj1, result);
1073
+ jbcheb(x, -4.002049e-02, tj, tj1, result);
1074
+ jbcheb(x, 1.158966e-02, tj, tj1, result);
1075
+ jbcheb(x, -3.157781e-03, tj, tj1, result);
1076
+ jbcheb(x, 2.762172e-03, tj, tj1, result);
1077
+ jbcheb(x, 5.780347e-04, tj, tj1, result);
1078
+ jbcheb(x, -1.193310e-03, tj, tj1, result);
1079
+ jbcheb(x, -2.442421e-05, tj, tj1, result);
1080
+ jbcheb(x, 2.547756e-03, tj, tj1, result);
1081
+ if( result>0 )
1082
+ {
1083
+ result = 0;
1084
+ }
1085
+ return result;
1086
+ }
1087
+ result = -2.799944e-01*(s-1.300000e+01)-7.566269e+00;
1088
+ return result;
1089
+ }
1090
+
1091
+
1092
+ static double jbtbl14(double s)
1093
+ {
1094
+ double result;
1095
+ double x;
1096
+ double tj;
1097
+ double tj1;
1098
+
1099
+ result = 0;
1100
+ if( s<=1.0000 )
1101
+ {
1102
+ x = 2*(s-0.000000)/1.000000-1;
1103
+ tj = 1;
1104
+ tj1 = x;
1105
+ jbcheb(x, -2.698527e-01, tj, tj1, result);
1106
+ jbcheb(x, -3.479081e-01, tj, tj1, result);
1107
+ jbcheb(x, -8.640733e-02, tj, tj1, result);
1108
+ jbcheb(x, -8.466899e-03, tj, tj1, result);
1109
+ jbcheb(x, -1.469485e-04, tj, tj1, result);
1110
+ jbcheb(x, 2.150009e-05, tj, tj1, result);
1111
+ jbcheb(x, 1.965975e-05, tj, tj1, result);
1112
+ jbcheb(x, -4.710210e-05, tj, tj1, result);
1113
+ jbcheb(x, -1.327808e-05, tj, tj1, result);
1114
+ if( result>0 )
1115
+ {
1116
+ result = 0;
1117
+ }
1118
+ return result;
1119
+ }
1120
+ if( s<=3.0000 )
1121
+ {
1122
+ x = 2*(s-1.000000)/2.000000-1;
1123
+ tj = 1;
1124
+ tj1 = x;
1125
+ jbcheb(x, -2.350359e+00, tj, tj1, result);
1126
+ jbcheb(x, -1.421365e+00, tj, tj1, result);
1127
+ jbcheb(x, 2.960468e-01, tj, tj1, result);
1128
+ jbcheb(x, 1.149167e-02, tj, tj1, result);
1129
+ jbcheb(x, -6.361109e-02, tj, tj1, result);
1130
+ jbcheb(x, 1.976022e-02, tj, tj1, result);
1131
+ jbcheb(x, 1.082700e-02, tj, tj1, result);
1132
+ jbcheb(x, -8.563328e-03, tj, tj1, result);
1133
+ jbcheb(x, -1.453123e-03, tj, tj1, result);
1134
+ jbcheb(x, 2.917559e-03, tj, tj1, result);
1135
+ jbcheb(x, -1.151067e-05, tj, tj1, result);
1136
+ if( result>0 )
1137
+ {
1138
+ result = 0;
1139
+ }
1140
+ return result;
1141
+ }
1142
+ if( s<=15.0000 )
1143
+ {
1144
+ x = 2*(s-3.000000)/12.000000-1;
1145
+ tj = 1;
1146
+ tj1 = x;
1147
+ jbcheb(x, -5.746892e+00, tj, tj1, result);
1148
+ jbcheb(x, -2.010441e+00, tj, tj1, result);
1149
+ jbcheb(x, 1.566146e-01, tj, tj1, result);
1150
+ jbcheb(x, -5.129690e-02, tj, tj1, result);
1151
+ jbcheb(x, 1.929724e-02, tj, tj1, result);
1152
+ jbcheb(x, -2.524227e-03, tj, tj1, result);
1153
+ jbcheb(x, 3.192933e-03, tj, tj1, result);
1154
+ jbcheb(x, -4.254730e-04, tj, tj1, result);
1155
+ jbcheb(x, 1.620685e-03, tj, tj1, result);
1156
+ jbcheb(x, 7.289618e-04, tj, tj1, result);
1157
+ jbcheb(x, -2.112350e-03, tj, tj1, result);
1158
+ if( result>0 )
1159
+ {
1160
+ result = 0;
1161
+ }
1162
+ return result;
1163
+ }
1164
+ result = -2.590621e-01*(s-1.500000e+01)-7.632238e+00;
1165
+ return result;
1166
+ }
1167
+
1168
+
1169
+ static double jbtbl15(double s)
1170
+ {
1171
+ double result;
1172
+ double x;
1173
+ double tj;
1174
+ double tj1;
1175
+
1176
+ result = 0;
1177
+ if( s<=2.0000 )
1178
+ {
1179
+ x = 2*(s-0.000000)/2.000000-1;
1180
+ tj = 1;
1181
+ tj1 = x;
1182
+ jbcheb(x, -1.043660e+00, tj, tj1, result);
1183
+ jbcheb(x, -1.361653e+00, tj, tj1, result);
1184
+ jbcheb(x, -3.009497e-01, tj, tj1, result);
1185
+ jbcheb(x, 4.951784e-02, tj, tj1, result);
1186
+ jbcheb(x, 4.377903e-02, tj, tj1, result);
1187
+ jbcheb(x, 1.003253e-02, tj, tj1, result);
1188
+ jbcheb(x, -1.271309e-03, tj, tj1, result);
1189
+ if( result>0 )
1190
+ {
1191
+ result = 0;
1192
+ }
1193
+ return result;
1194
+ }
1195
+ if( s<=5.0000 )
1196
+ {
1197
+ x = 2*(s-2.000000)/3.000000-1;
1198
+ tj = 1;
1199
+ tj1 = x;
1200
+ jbcheb(x, -3.582778e+00, tj, tj1, result);
1201
+ jbcheb(x, -8.349578e-01, tj, tj1, result);
1202
+ jbcheb(x, 9.476514e-02, tj, tj1, result);
1203
+ jbcheb(x, -2.717385e-02, tj, tj1, result);
1204
+ jbcheb(x, 1.222591e-02, tj, tj1, result);
1205
+ jbcheb(x, -6.635124e-03, tj, tj1, result);
1206
+ jbcheb(x, 2.815993e-03, tj, tj1, result);
1207
+ if( result>0 )
1208
+ {
1209
+ result = 0;
1210
+ }
1211
+ return result;
1212
+ }
1213
+ if( s<=17.0000 )
1214
+ {
1215
+ x = 2*(s-5.000000)/12.000000-1;
1216
+ tj = 1;
1217
+ tj1 = x;
1218
+ jbcheb(x, -6.115476e+00, tj, tj1, result);
1219
+ jbcheb(x, -1.655936e+00, tj, tj1, result);
1220
+ jbcheb(x, 8.404310e-02, tj, tj1, result);
1221
+ jbcheb(x, -2.663794e-02, tj, tj1, result);
1222
+ jbcheb(x, 8.868618e-03, tj, tj1, result);
1223
+ jbcheb(x, 1.381447e-03, tj, tj1, result);
1224
+ jbcheb(x, 9.444801e-04, tj, tj1, result);
1225
+ jbcheb(x, -1.581503e-04, tj, tj1, result);
1226
+ jbcheb(x, -9.468696e-04, tj, tj1, result);
1227
+ jbcheb(x, 1.728509e-03, tj, tj1, result);
1228
+ jbcheb(x, 1.206470e-03, tj, tj1, result);
1229
+ if( result>0 )
1230
+ {
1231
+ result = 0;
1232
+ }
1233
+ return result;
1234
+ }
1235
+ result = -1.927937e-01*(s-1.700000e+01)-7.700983e+00;
1236
+ return result;
1237
+ }
1238
+
1239
+
1240
+ static double jbtbl16(double s)
1241
+ {
1242
+ double result;
1243
+ double x;
1244
+ double tj;
1245
+ double tj1;
1246
+
1247
+ result = 0;
1248
+ if( s<=2.0000 )
1249
+ {
1250
+ x = 2*(s-0.000000)/2.000000-1;
1251
+ tj = 1;
1252
+ tj1 = x;
1253
+ jbcheb(x, -1.002570e+00, tj, tj1, result);
1254
+ jbcheb(x, -1.298141e+00, tj, tj1, result);
1255
+ jbcheb(x, -2.832803e-01, tj, tj1, result);
1256
+ jbcheb(x, 3.877026e-02, tj, tj1, result);
1257
+ jbcheb(x, 3.539436e-02, tj, tj1, result);
1258
+ jbcheb(x, 8.439658e-03, tj, tj1, result);
1259
+ jbcheb(x, -4.756911e-04, tj, tj1, result);
1260
+ if( result>0 )
1261
+ {
1262
+ result = 0;
1263
+ }
1264
+ return result;
1265
+ }
1266
+ if( s<=5.0000 )
1267
+ {
1268
+ x = 2*(s-2.000000)/3.000000-1;
1269
+ tj = 1;
1270
+ tj1 = x;
1271
+ jbcheb(x, -3.486198e+00, tj, tj1, result);
1272
+ jbcheb(x, -8.242944e-01, tj, tj1, result);
1273
+ jbcheb(x, 1.020002e-01, tj, tj1, result);
1274
+ jbcheb(x, -3.130531e-02, tj, tj1, result);
1275
+ jbcheb(x, 1.512373e-02, tj, tj1, result);
1276
+ jbcheb(x, -8.054876e-03, tj, tj1, result);
1277
+ jbcheb(x, 3.556839e-03, tj, tj1, result);
1278
+ if( result>0 )
1279
+ {
1280
+ result = 0;
1281
+ }
1282
+ return result;
1283
+ }
1284
+ if( s<=20.0000 )
1285
+ {
1286
+ x = 2*(s-5.000000)/15.000000-1;
1287
+ tj = 1;
1288
+ tj1 = x;
1289
+ jbcheb(x, -6.241608e+00, tj, tj1, result);
1290
+ jbcheb(x, -1.832655e+00, tj, tj1, result);
1291
+ jbcheb(x, 1.340545e-01, tj, tj1, result);
1292
+ jbcheb(x, -3.361143e-02, tj, tj1, result);
1293
+ jbcheb(x, 1.283219e-02, tj, tj1, result);
1294
+ jbcheb(x, 3.484549e-03, tj, tj1, result);
1295
+ jbcheb(x, 1.805968e-03, tj, tj1, result);
1296
+ jbcheb(x, -2.057243e-03, tj, tj1, result);
1297
+ jbcheb(x, -1.454439e-03, tj, tj1, result);
1298
+ jbcheb(x, -2.177513e-03, tj, tj1, result);
1299
+ jbcheb(x, -1.819209e-03, tj, tj1, result);
1300
+ if( result>0 )
1301
+ {
1302
+ result = 0;
1303
+ }
1304
+ return result;
1305
+ }
1306
+ result = -2.391580e-01*(s-2.000000e+01)-7.963205e+00;
1307
+ return result;
1308
+ }
1309
+
1310
+
1311
+ static double jbtbl17(double s)
1312
+ {
1313
+ double result;
1314
+ double x;
1315
+ double tj;
1316
+ double tj1;
1317
+
1318
+ result = 0;
1319
+ if( s<=3.0000 )
1320
+ {
1321
+ x = 2*(s-0.000000)/3.000000-1;
1322
+ tj = 1;
1323
+ tj1 = x;
1324
+ jbcheb(x, -1.566973e+00, tj, tj1, result);
1325
+ jbcheb(x, -1.810330e+00, tj, tj1, result);
1326
+ jbcheb(x, -4.840039e-02, tj, tj1, result);
1327
+ jbcheb(x, 2.337294e-01, tj, tj1, result);
1328
+ jbcheb(x, -5.383549e-04, tj, tj1, result);
1329
+ jbcheb(x, -5.556515e-02, tj, tj1, result);
1330
+ jbcheb(x, -8.656965e-03, tj, tj1, result);
1331
+ jbcheb(x, 1.404569e-02, tj, tj1, result);
1332
+ jbcheb(x, 6.447867e-03, tj, tj1, result);
1333
+ if( result>0 )
1334
+ {
1335
+ result = 0;
1336
+ }
1337
+ return result;
1338
+ }
1339
+ if( s<=6.0000 )
1340
+ {
1341
+ x = 2*(s-3.000000)/3.000000-1;
1342
+ tj = 1;
1343
+ tj1 = x;
1344
+ jbcheb(x, -3.905684e+00, tj, tj1, result);
1345
+ jbcheb(x, -6.222920e-01, tj, tj1, result);
1346
+ jbcheb(x, 4.146667e-02, tj, tj1, result);
1347
+ jbcheb(x, -4.809176e-03, tj, tj1, result);
1348
+ jbcheb(x, 1.057028e-03, tj, tj1, result);
1349
+ jbcheb(x, -1.211838e-04, tj, tj1, result);
1350
+ jbcheb(x, -4.099683e-04, tj, tj1, result);
1351
+ jbcheb(x, 1.161105e-04, tj, tj1, result);
1352
+ jbcheb(x, 2.225465e-04, tj, tj1, result);
1353
+ if( result>0 )
1354
+ {
1355
+ result = 0;
1356
+ }
1357
+ return result;
1358
+ }
1359
+ if( s<=24.0000 )
1360
+ {
1361
+ x = 2*(s-6.000000)/18.000000-1;
1362
+ tj = 1;
1363
+ tj1 = x;
1364
+ jbcheb(x, -6.594282e+00, tj, tj1, result);
1365
+ jbcheb(x, -1.917838e+00, tj, tj1, result);
1366
+ jbcheb(x, 1.455980e-01, tj, tj1, result);
1367
+ jbcheb(x, -2.999589e-02, tj, tj1, result);
1368
+ jbcheb(x, 5.604263e-03, tj, tj1, result);
1369
+ jbcheb(x, -3.484445e-03, tj, tj1, result);
1370
+ jbcheb(x, -1.819937e-03, tj, tj1, result);
1371
+ jbcheb(x, -2.930390e-03, tj, tj1, result);
1372
+ jbcheb(x, 2.771761e-04, tj, tj1, result);
1373
+ jbcheb(x, -6.232581e-04, tj, tj1, result);
1374
+ jbcheb(x, -7.029083e-04, tj, tj1, result);
1375
+ if( result>0 )
1376
+ {
1377
+ result = 0;
1378
+ }
1379
+ return result;
1380
+ }
1381
+ result = -2.127771e-01*(s-2.400000e+01)-8.400197e+00;
1382
+ return result;
1383
+ }
1384
+
1385
+
1386
+ static double jbtbl18(double s)
1387
+ {
1388
+ double result;
1389
+ double x;
1390
+ double tj;
1391
+ double tj1;
1392
+
1393
+ result = 0;
1394
+ if( s<=3.0000 )
1395
+ {
1396
+ x = 2*(s-0.000000)/3.000000-1;
1397
+ tj = 1;
1398
+ tj1 = x;
1399
+ jbcheb(x, -1.526802e+00, tj, tj1, result);
1400
+ jbcheb(x, -1.762373e+00, tj, tj1, result);
1401
+ jbcheb(x, -5.598890e-02, tj, tj1, result);
1402
+ jbcheb(x, 2.189437e-01, tj, tj1, result);
1403
+ jbcheb(x, 5.971721e-03, tj, tj1, result);
1404
+ jbcheb(x, -4.823067e-02, tj, tj1, result);
1405
+ jbcheb(x, -1.064501e-02, tj, tj1, result);
1406
+ jbcheb(x, 1.014932e-02, tj, tj1, result);
1407
+ jbcheb(x, 5.953513e-03, tj, tj1, result);
1408
+ if( result>0 )
1409
+ {
1410
+ result = 0;
1411
+ }
1412
+ return result;
1413
+ }
1414
+ if( s<=6.0000 )
1415
+ {
1416
+ x = 2*(s-3.000000)/3.000000-1;
1417
+ tj = 1;
1418
+ tj1 = x;
1419
+ jbcheb(x, -3.818669e+00, tj, tj1, result);
1420
+ jbcheb(x, -6.070918e-01, tj, tj1, result);
1421
+ jbcheb(x, 4.277196e-02, tj, tj1, result);
1422
+ jbcheb(x, -4.879817e-03, tj, tj1, result);
1423
+ jbcheb(x, 6.887357e-04, tj, tj1, result);
1424
+ jbcheb(x, 1.638451e-05, tj, tj1, result);
1425
+ jbcheb(x, 1.502800e-04, tj, tj1, result);
1426
+ jbcheb(x, -3.165796e-05, tj, tj1, result);
1427
+ jbcheb(x, 5.034960e-05, tj, tj1, result);
1428
+ if( result>0 )
1429
+ {
1430
+ result = 0;
1431
+ }
1432
+ return result;
1433
+ }
1434
+ if( s<=20.0000 )
1435
+ {
1436
+ x = 2*(s-6.000000)/14.000000-1;
1437
+ tj = 1;
1438
+ tj1 = x;
1439
+ jbcheb(x, -6.010656e+00, tj, tj1, result);
1440
+ jbcheb(x, -1.496296e+00, tj, tj1, result);
1441
+ jbcheb(x, 1.002227e-01, tj, tj1, result);
1442
+ jbcheb(x, -2.338250e-02, tj, tj1, result);
1443
+ jbcheb(x, 4.137036e-03, tj, tj1, result);
1444
+ jbcheb(x, -2.586202e-03, tj, tj1, result);
1445
+ jbcheb(x, -9.736384e-04, tj, tj1, result);
1446
+ jbcheb(x, 1.332251e-03, tj, tj1, result);
1447
+ jbcheb(x, 1.877982e-03, tj, tj1, result);
1448
+ jbcheb(x, -1.160963e-05, tj, tj1, result);
1449
+ jbcheb(x, -2.547247e-03, tj, tj1, result);
1450
+ if( result>0 )
1451
+ {
1452
+ result = 0;
1453
+ }
1454
+ return result;
1455
+ }
1456
+ result = -1.684623e-01*(s-2.000000e+01)-7.428883e+00;
1457
+ return result;
1458
+ }
1459
+
1460
+
1461
+ static double jbtbl19(double s)
1462
+ {
1463
+ double result;
1464
+ double x;
1465
+ double tj;
1466
+ double tj1;
1467
+
1468
+ result = 0;
1469
+ if( s<=3.0000 )
1470
+ {
1471
+ x = 2*(s-0.000000)/3.000000-1;
1472
+ tj = 1;
1473
+ tj1 = x;
1474
+ jbcheb(x, -1.490213e+00, tj, tj1, result);
1475
+ jbcheb(x, -1.719633e+00, tj, tj1, result);
1476
+ jbcheb(x, -6.459123e-02, tj, tj1, result);
1477
+ jbcheb(x, 2.034878e-01, tj, tj1, result);
1478
+ jbcheb(x, 1.113868e-02, tj, tj1, result);
1479
+ jbcheb(x, -4.030922e-02, tj, tj1, result);
1480
+ jbcheb(x, -1.054022e-02, tj, tj1, result);
1481
+ jbcheb(x, 7.525623e-03, tj, tj1, result);
1482
+ jbcheb(x, 5.277360e-03, tj, tj1, result);
1483
+ if( result>0 )
1484
+ {
1485
+ result = 0;
1486
+ }
1487
+ return result;
1488
+ }
1489
+ if( s<=6.0000 )
1490
+ {
1491
+ x = 2*(s-3.000000)/3.000000-1;
1492
+ tj = 1;
1493
+ tj1 = x;
1494
+ jbcheb(x, -3.744750e+00, tj, tj1, result);
1495
+ jbcheb(x, -5.977749e-01, tj, tj1, result);
1496
+ jbcheb(x, 4.223716e-02, tj, tj1, result);
1497
+ jbcheb(x, -5.363889e-03, tj, tj1, result);
1498
+ jbcheb(x, 5.711774e-04, tj, tj1, result);
1499
+ jbcheb(x, -5.557257e-04, tj, tj1, result);
1500
+ jbcheb(x, 4.254794e-04, tj, tj1, result);
1501
+ jbcheb(x, 9.034207e-05, tj, tj1, result);
1502
+ jbcheb(x, 5.498107e-05, tj, tj1, result);
1503
+ if( result>0 )
1504
+ {
1505
+ result = 0;
1506
+ }
1507
+ return result;
1508
+ }
1509
+ if( s<=20.0000 )
1510
+ {
1511
+ x = 2*(s-6.000000)/14.000000-1;
1512
+ tj = 1;
1513
+ tj1 = x;
1514
+ jbcheb(x, -5.872768e+00, tj, tj1, result);
1515
+ jbcheb(x, -1.430689e+00, tj, tj1, result);
1516
+ jbcheb(x, 1.136575e-01, tj, tj1, result);
1517
+ jbcheb(x, -1.726627e-02, tj, tj1, result);
1518
+ jbcheb(x, 3.421110e-03, tj, tj1, result);
1519
+ jbcheb(x, -1.581510e-03, tj, tj1, result);
1520
+ jbcheb(x, -5.559520e-04, tj, tj1, result);
1521
+ jbcheb(x, -6.838208e-04, tj, tj1, result);
1522
+ jbcheb(x, 8.428839e-04, tj, tj1, result);
1523
+ jbcheb(x, -7.170682e-04, tj, tj1, result);
1524
+ jbcheb(x, -6.006647e-04, tj, tj1, result);
1525
+ if( result>0 )
1526
+ {
1527
+ result = 0;
1528
+ }
1529
+ return result;
1530
+ }
1531
+ result = -1.539373e-01*(s-2.000000e+01)-7.206941e+00;
1532
+ return result;
1533
+ }
1534
+
1535
+
1536
+ static double jbtbl20(double s)
1537
+ {
1538
+ double result;
1539
+ double x;
1540
+ double tj;
1541
+ double tj1;
1542
+
1543
+ result = 0;
1544
+ if( s<=4.0000 )
1545
+ {
1546
+ x = 2*(s-0.000000)/4.000000-1;
1547
+ tj = 1;
1548
+ tj1 = x;
1549
+ jbcheb(x, -1.854794e+00, tj, tj1, result);
1550
+ jbcheb(x, -1.948947e+00, tj, tj1, result);
1551
+ jbcheb(x, 1.632184e-01, tj, tj1, result);
1552
+ jbcheb(x, 2.139397e-01, tj, tj1, result);
1553
+ jbcheb(x, -1.006237e-01, tj, tj1, result);
1554
+ jbcheb(x, -3.810031e-02, tj, tj1, result);
1555
+ jbcheb(x, 3.573620e-02, tj, tj1, result);
1556
+ jbcheb(x, 9.951242e-03, tj, tj1, result);
1557
+ jbcheb(x, -1.274092e-02, tj, tj1, result);
1558
+ jbcheb(x, -3.464196e-03, tj, tj1, result);
1559
+ jbcheb(x, 4.882139e-03, tj, tj1, result);
1560
+ jbcheb(x, 1.575144e-03, tj, tj1, result);
1561
+ jbcheb(x, -1.822804e-03, tj, tj1, result);
1562
+ jbcheb(x, -7.061348e-04, tj, tj1, result);
1563
+ jbcheb(x, 5.908404e-04, tj, tj1, result);
1564
+ jbcheb(x, 1.978353e-04, tj, tj1, result);
1565
+ if( result>0 )
1566
+ {
1567
+ result = 0;
1568
+ }
1569
+ return result;
1570
+ }
1571
+ if( s<=15.0000 )
1572
+ {
1573
+ x = 2*(s-4.000000)/11.000000-1;
1574
+ tj = 1;
1575
+ tj1 = x;
1576
+ jbcheb(x, -5.030989e+00, tj, tj1, result);
1577
+ jbcheb(x, -1.327151e+00, tj, tj1, result);
1578
+ jbcheb(x, 1.346404e-01, tj, tj1, result);
1579
+ jbcheb(x, -2.840051e-02, tj, tj1, result);
1580
+ jbcheb(x, 7.578551e-03, tj, tj1, result);
1581
+ jbcheb(x, -9.813886e-04, tj, tj1, result);
1582
+ jbcheb(x, 5.905973e-05, tj, tj1, result);
1583
+ jbcheb(x, -5.358489e-04, tj, tj1, result);
1584
+ jbcheb(x, -3.450795e-04, tj, tj1, result);
1585
+ jbcheb(x, -6.941157e-04, tj, tj1, result);
1586
+ jbcheb(x, -7.432418e-04, tj, tj1, result);
1587
+ jbcheb(x, -2.070537e-04, tj, tj1, result);
1588
+ jbcheb(x, 9.375654e-04, tj, tj1, result);
1589
+ jbcheb(x, 5.367378e-04, tj, tj1, result);
1590
+ jbcheb(x, 9.890859e-04, tj, tj1, result);
1591
+ jbcheb(x, 6.679782e-04, tj, tj1, result);
1592
+ if( result>0 )
1593
+ {
1594
+ result = 0;
1595
+ }
1596
+ return result;
1597
+ }
1598
+ if( s<=25.0000 )
1599
+ {
1600
+ x = 2*(s-15.000000)/10.000000-1;
1601
+ tj = 1;
1602
+ tj1 = x;
1603
+ jbcheb(x, -7.015854e+00, tj, tj1, result);
1604
+ jbcheb(x, -7.487737e-01, tj, tj1, result);
1605
+ jbcheb(x, 2.244254e-02, tj, tj1, result);
1606
+ if( result>0 )
1607
+ {
1608
+ result = 0;
1609
+ }
1610
+ return result;
1611
+ }
1612
+ result = -1.318007e-01*(s-2.500000e+01)-7.742185e+00;
1613
+ return result;
1614
+ }
1615
+
1616
+
1617
+ static double jbtbl30(double s)
1618
+ {
1619
+ double result;
1620
+ double x;
1621
+ double tj;
1622
+ double tj1;
1623
+
1624
+ result = 0;
1625
+ if( s<=4.0000 )
1626
+ {
1627
+ x = 2*(s-0.000000)/4.000000-1;
1628
+ tj = 1;
1629
+ tj1 = x;
1630
+ jbcheb(x, -1.630822e+00, tj, tj1, result);
1631
+ jbcheb(x, -1.724298e+00, tj, tj1, result);
1632
+ jbcheb(x, 7.872756e-02, tj, tj1, result);
1633
+ jbcheb(x, 1.658268e-01, tj, tj1, result);
1634
+ jbcheb(x, -3.573597e-02, tj, tj1, result);
1635
+ jbcheb(x, -2.994157e-02, tj, tj1, result);
1636
+ jbcheb(x, 5.994825e-03, tj, tj1, result);
1637
+ jbcheb(x, 7.394303e-03, tj, tj1, result);
1638
+ jbcheb(x, -5.785029e-04, tj, tj1, result);
1639
+ jbcheb(x, -1.990264e-03, tj, tj1, result);
1640
+ jbcheb(x, -1.037838e-04, tj, tj1, result);
1641
+ jbcheb(x, 6.755546e-04, tj, tj1, result);
1642
+ jbcheb(x, 1.774473e-04, tj, tj1, result);
1643
+ jbcheb(x, -2.821395e-04, tj, tj1, result);
1644
+ jbcheb(x, -1.392603e-04, tj, tj1, result);
1645
+ jbcheb(x, 1.353313e-04, tj, tj1, result);
1646
+ if( result>0 )
1647
+ {
1648
+ result = 0;
1649
+ }
1650
+ return result;
1651
+ }
1652
+ if( s<=15.0000 )
1653
+ {
1654
+ x = 2*(s-4.000000)/11.000000-1;
1655
+ tj = 1;
1656
+ tj1 = x;
1657
+ jbcheb(x, -4.539322e+00, tj, tj1, result);
1658
+ jbcheb(x, -1.197018e+00, tj, tj1, result);
1659
+ jbcheb(x, 1.396848e-01, tj, tj1, result);
1660
+ jbcheb(x, -2.804293e-02, tj, tj1, result);
1661
+ jbcheb(x, 6.867928e-03, tj, tj1, result);
1662
+ jbcheb(x, -2.768758e-03, tj, tj1, result);
1663
+ jbcheb(x, 5.211792e-04, tj, tj1, result);
1664
+ jbcheb(x, 4.925799e-04, tj, tj1, result);
1665
+ jbcheb(x, 5.046235e-04, tj, tj1, result);
1666
+ jbcheb(x, -9.536469e-05, tj, tj1, result);
1667
+ jbcheb(x, -6.489642e-04, tj, tj1, result);
1668
+ if( result>0 )
1669
+ {
1670
+ result = 0;
1671
+ }
1672
+ return result;
1673
+ }
1674
+ if( s<=25.0000 )
1675
+ {
1676
+ x = 2*(s-15.000000)/10.000000-1;
1677
+ tj = 1;
1678
+ tj1 = x;
1679
+ jbcheb(x, -6.263462e+00, tj, tj1, result);
1680
+ jbcheb(x, -6.177316e-01, tj, tj1, result);
1681
+ jbcheb(x, 2.590637e-02, tj, tj1, result);
1682
+ if( result>0 )
1683
+ {
1684
+ result = 0;
1685
+ }
1686
+ return result;
1687
+ }
1688
+ result = -1.028212e-01*(s-2.500000e+01)-6.855288e+00;
1689
+ return result;
1690
+ }
1691
+
1692
+
1693
+ static double jbtbl50(double s)
1694
+ {
1695
+ double result;
1696
+ double x;
1697
+ double tj;
1698
+ double tj1;
1699
+
1700
+ result = 0;
1701
+ if( s<=4.0000 )
1702
+ {
1703
+ x = 2*(s-0.000000)/4.000000-1;
1704
+ tj = 1;
1705
+ tj1 = x;
1706
+ jbcheb(x, -1.436279e+00, tj, tj1, result);
1707
+ jbcheb(x, -1.519711e+00, tj, tj1, result);
1708
+ jbcheb(x, 1.148699e-02, tj, tj1, result);
1709
+ jbcheb(x, 1.001204e-01, tj, tj1, result);
1710
+ jbcheb(x, -3.207620e-03, tj, tj1, result);
1711
+ jbcheb(x, -1.034778e-02, tj, tj1, result);
1712
+ jbcheb(x, -1.220322e-03, tj, tj1, result);
1713
+ jbcheb(x, 1.033260e-03, tj, tj1, result);
1714
+ jbcheb(x, 2.588280e-04, tj, tj1, result);
1715
+ jbcheb(x, -1.851653e-04, tj, tj1, result);
1716
+ jbcheb(x, -1.287733e-04, tj, tj1, result);
1717
+ if( result>0 )
1718
+ {
1719
+ result = 0;
1720
+ }
1721
+ return result;
1722
+ }
1723
+ if( s<=15.0000 )
1724
+ {
1725
+ x = 2*(s-4.000000)/11.000000-1;
1726
+ tj = 1;
1727
+ tj1 = x;
1728
+ jbcheb(x, -4.234645e+00, tj, tj1, result);
1729
+ jbcheb(x, -1.189127e+00, tj, tj1, result);
1730
+ jbcheb(x, 1.429738e-01, tj, tj1, result);
1731
+ jbcheb(x, -3.058822e-02, tj, tj1, result);
1732
+ jbcheb(x, 9.086776e-03, tj, tj1, result);
1733
+ jbcheb(x, -1.445783e-03, tj, tj1, result);
1734
+ jbcheb(x, 1.311671e-03, tj, tj1, result);
1735
+ jbcheb(x, -7.261298e-04, tj, tj1, result);
1736
+ jbcheb(x, 6.496987e-04, tj, tj1, result);
1737
+ jbcheb(x, 2.605249e-04, tj, tj1, result);
1738
+ jbcheb(x, 8.162282e-04, tj, tj1, result);
1739
+ if( result>0 )
1740
+ {
1741
+ result = 0;
1742
+ }
1743
+ return result;
1744
+ }
1745
+ if( s<=25.0000 )
1746
+ {
1747
+ x = 2*(s-15.000000)/10.000000-1;
1748
+ tj = 1;
1749
+ tj1 = x;
1750
+ jbcheb(x, -5.921095e+00, tj, tj1, result);
1751
+ jbcheb(x, -5.888603e-01, tj, tj1, result);
1752
+ jbcheb(x, 3.080113e-02, tj, tj1, result);
1753
+ if( result>0 )
1754
+ {
1755
+ result = 0;
1756
+ }
1757
+ return result;
1758
+ }
1759
+ result = -9.313116e-02*(s-2.500000e+01)-6.479154e+00;
1760
+ return result;
1761
+ }
1762
+
1763
+
1764
+ static double jbtbl65(double s)
1765
+ {
1766
+ double result;
1767
+ double x;
1768
+ double tj;
1769
+ double tj1;
1770
+
1771
+ result = 0;
1772
+ if( s<=4.0000 )
1773
+ {
1774
+ x = 2*(s-0.000000)/4.000000-1;
1775
+ tj = 1;
1776
+ tj1 = x;
1777
+ jbcheb(x, -1.360024e+00, tj, tj1, result);
1778
+ jbcheb(x, -1.434631e+00, tj, tj1, result);
1779
+ jbcheb(x, -6.514580e-03, tj, tj1, result);
1780
+ jbcheb(x, 7.332038e-02, tj, tj1, result);
1781
+ jbcheb(x, 1.158197e-03, tj, tj1, result);
1782
+ jbcheb(x, -5.121233e-03, tj, tj1, result);
1783
+ jbcheb(x, -1.051056e-03, tj, tj1, result);
1784
+ if( result>0 )
1785
+ {
1786
+ result = 0;
1787
+ }
1788
+ return result;
1789
+ }
1790
+ if( s<=15.0000 )
1791
+ {
1792
+ x = 2*(s-4.000000)/11.000000-1;
1793
+ tj = 1;
1794
+ tj1 = x;
1795
+ jbcheb(x, -4.148601e+00, tj, tj1, result);
1796
+ jbcheb(x, -1.214233e+00, tj, tj1, result);
1797
+ jbcheb(x, 1.487977e-01, tj, tj1, result);
1798
+ jbcheb(x, -3.424720e-02, tj, tj1, result);
1799
+ jbcheb(x, 1.116715e-02, tj, tj1, result);
1800
+ jbcheb(x, -4.043152e-03, tj, tj1, result);
1801
+ jbcheb(x, 1.718149e-03, tj, tj1, result);
1802
+ jbcheb(x, -1.313701e-03, tj, tj1, result);
1803
+ jbcheb(x, 3.097305e-04, tj, tj1, result);
1804
+ jbcheb(x, 2.181031e-04, tj, tj1, result);
1805
+ jbcheb(x, 1.256975e-04, tj, tj1, result);
1806
+ if( result>0 )
1807
+ {
1808
+ result = 0;
1809
+ }
1810
+ return result;
1811
+ }
1812
+ if( s<=25.0000 )
1813
+ {
1814
+ x = 2*(s-15.000000)/10.000000-1;
1815
+ tj = 1;
1816
+ tj1 = x;
1817
+ jbcheb(x, -5.858951e+00, tj, tj1, result);
1818
+ jbcheb(x, -5.895179e-01, tj, tj1, result);
1819
+ jbcheb(x, 2.933237e-02, tj, tj1, result);
1820
+ if( result>0 )
1821
+ {
1822
+ result = 0;
1823
+ }
1824
+ return result;
1825
+ }
1826
+ result = -9.443768e-02*(s-2.500000e+01)-6.419137e+00;
1827
+ return result;
1828
+ }
1829
+
1830
+
1831
+ static double jbtbl100(double s)
1832
+ {
1833
+ double result;
1834
+ double x;
1835
+ double tj;
1836
+ double tj1;
1837
+
1838
+ result = 0;
1839
+ if( s<=4.0000 )
1840
+ {
1841
+ x = 2*(s-0.000000)/4.000000-1;
1842
+ tj = 1;
1843
+ tj1 = x;
1844
+ jbcheb(x, -1.257021e+00, tj, tj1, result);
1845
+ jbcheb(x, -1.313418e+00, tj, tj1, result);
1846
+ jbcheb(x, -1.628931e-02, tj, tj1, result);
1847
+ jbcheb(x, 4.264287e-02, tj, tj1, result);
1848
+ jbcheb(x, 1.518487e-03, tj, tj1, result);
1849
+ jbcheb(x, -1.499826e-03, tj, tj1, result);
1850
+ jbcheb(x, -4.836044e-04, tj, tj1, result);
1851
+ if( result>0 )
1852
+ {
1853
+ result = 0;
1854
+ }
1855
+ return result;
1856
+ }
1857
+ if( s<=15.0000 )
1858
+ {
1859
+ x = 2*(s-4.000000)/11.000000-1;
1860
+ tj = 1;
1861
+ tj1 = x;
1862
+ jbcheb(x, -4.056508e+00, tj, tj1, result);
1863
+ jbcheb(x, -1.279690e+00, tj, tj1, result);
1864
+ jbcheb(x, 1.665746e-01, tj, tj1, result);
1865
+ jbcheb(x, -4.290012e-02, tj, tj1, result);
1866
+ jbcheb(x, 1.487632e-02, tj, tj1, result);
1867
+ jbcheb(x, -5.704465e-03, tj, tj1, result);
1868
+ jbcheb(x, 2.211669e-03, tj, tj1, result);
1869
+ if( result>0 )
1870
+ {
1871
+ result = 0;
1872
+ }
1873
+ return result;
1874
+ }
1875
+ if( s<=25.0000 )
1876
+ {
1877
+ x = 2*(s-15.000000)/10.000000-1;
1878
+ tj = 1;
1879
+ tj1 = x;
1880
+ jbcheb(x, -5.866099e+00, tj, tj1, result);
1881
+ jbcheb(x, -6.399767e-01, tj, tj1, result);
1882
+ jbcheb(x, 2.498208e-02, tj, tj1, result);
1883
+ if( result>0 )
1884
+ {
1885
+ result = 0;
1886
+ }
1887
+ return result;
1888
+ }
1889
+ result = -1.080097e-01*(s-2.500000e+01)-6.481094e+00;
1890
+ return result;
1891
+ }
1892
+
1893
+
1894
+ static double jbtbl130(double s)
1895
+ {
1896
+ double result;
1897
+ double x;
1898
+ double tj;
1899
+ double tj1;
1900
+
1901
+ result = 0;
1902
+ if( s<=4.0000 )
1903
+ {
1904
+ x = 2*(s-0.000000)/4.000000-1;
1905
+ tj = 1;
1906
+ tj1 = x;
1907
+ jbcheb(x, -1.207999e+00, tj, tj1, result);
1908
+ jbcheb(x, -1.253864e+00, tj, tj1, result);
1909
+ jbcheb(x, -1.618032e-02, tj, tj1, result);
1910
+ jbcheb(x, 3.112729e-02, tj, tj1, result);
1911
+ jbcheb(x, 1.210546e-03, tj, tj1, result);
1912
+ jbcheb(x, -4.732602e-04, tj, tj1, result);
1913
+ jbcheb(x, -2.410527e-04, tj, tj1, result);
1914
+ if( result>0 )
1915
+ {
1916
+ result = 0;
1917
+ }
1918
+ return result;
1919
+ }
1920
+ if( s<=15.0000 )
1921
+ {
1922
+ x = 2*(s-4.000000)/11.000000-1;
1923
+ tj = 1;
1924
+ tj1 = x;
1925
+ jbcheb(x, -4.026324e+00, tj, tj1, result);
1926
+ jbcheb(x, -1.331990e+00, tj, tj1, result);
1927
+ jbcheb(x, 1.779129e-01, tj, tj1, result);
1928
+ jbcheb(x, -4.674749e-02, tj, tj1, result);
1929
+ jbcheb(x, 1.669077e-02, tj, tj1, result);
1930
+ jbcheb(x, -5.679136e-03, tj, tj1, result);
1931
+ jbcheb(x, 8.833221e-04, tj, tj1, result);
1932
+ if( result>0 )
1933
+ {
1934
+ result = 0;
1935
+ }
1936
+ return result;
1937
+ }
1938
+ if( s<=25.0000 )
1939
+ {
1940
+ x = 2*(s-15.000000)/10.000000-1;
1941
+ tj = 1;
1942
+ tj1 = x;
1943
+ jbcheb(x, -5.893951e+00, tj, tj1, result);
1944
+ jbcheb(x, -6.475304e-01, tj, tj1, result);
1945
+ jbcheb(x, 3.116734e-02, tj, tj1, result);
1946
+ if( result>0 )
1947
+ {
1948
+ result = 0;
1949
+ }
1950
+ return result;
1951
+ }
1952
+ result = -1.045722e-01*(s-2.500000e+01)-6.510314e+00;
1953
+ return result;
1954
+ }
1955
+
1956
+
1957
+ static double jbtbl200(double s)
1958
+ {
1959
+ double result;
1960
+ double x;
1961
+ double tj;
1962
+ double tj1;
1963
+
1964
+ result = 0;
1965
+ if( s<=4.0000 )
1966
+ {
1967
+ x = 2*(s-0.000000)/4.000000-1;
1968
+ tj = 1;
1969
+ tj1 = x;
1970
+ jbcheb(x, -1.146155e+00, tj, tj1, result);
1971
+ jbcheb(x, -1.177398e+00, tj, tj1, result);
1972
+ jbcheb(x, -1.297970e-02, tj, tj1, result);
1973
+ jbcheb(x, 1.869745e-02, tj, tj1, result);
1974
+ jbcheb(x, 1.717288e-04, tj, tj1, result);
1975
+ jbcheb(x, -1.982108e-04, tj, tj1, result);
1976
+ jbcheb(x, 6.427636e-05, tj, tj1, result);
1977
+ if( result>0 )
1978
+ {
1979
+ result = 0;
1980
+ }
1981
+ return result;
1982
+ }
1983
+ if( s<=15.0000 )
1984
+ {
1985
+ x = 2*(s-4.000000)/11.000000-1;
1986
+ tj = 1;
1987
+ tj1 = x;
1988
+ jbcheb(x, -4.034235e+00, tj, tj1, result);
1989
+ jbcheb(x, -1.455006e+00, tj, tj1, result);
1990
+ jbcheb(x, 1.942996e-01, tj, tj1, result);
1991
+ jbcheb(x, -4.973795e-02, tj, tj1, result);
1992
+ jbcheb(x, 1.418812e-02, tj, tj1, result);
1993
+ jbcheb(x, -3.156778e-03, tj, tj1, result);
1994
+ jbcheb(x, 4.896705e-05, tj, tj1, result);
1995
+ if( result>0 )
1996
+ {
1997
+ result = 0;
1998
+ }
1999
+ return result;
2000
+ }
2001
+ if( s<=25.0000 )
2002
+ {
2003
+ x = 2*(s-15.000000)/10.000000-1;
2004
+ tj = 1;
2005
+ tj1 = x;
2006
+ jbcheb(x, -6.086071e+00, tj, tj1, result);
2007
+ jbcheb(x, -7.152176e-01, tj, tj1, result);
2008
+ jbcheb(x, 3.725393e-02, tj, tj1, result);
2009
+ if( result>0 )
2010
+ {
2011
+ result = 0;
2012
+ }
2013
+ return result;
2014
+ }
2015
+ result = -1.132404e-01*(s-2.500000e+01)-6.764034e+00;
2016
+ return result;
2017
+ }
2018
+
2019
+
2020
+ static double jbtbl301(double s)
2021
+ {
2022
+ double result;
2023
+ double x;
2024
+ double tj;
2025
+ double tj1;
2026
+
2027
+ result = 0;
2028
+ if( s<=4.0000 )
2029
+ {
2030
+ x = 2*(s-0.000000)/4.000000-1;
2031
+ tj = 1;
2032
+ tj1 = x;
2033
+ jbcheb(x, -1.104290e+00, tj, tj1, result);
2034
+ jbcheb(x, -1.125800e+00, tj, tj1, result);
2035
+ jbcheb(x, -9.595847e-03, tj, tj1, result);
2036
+ jbcheb(x, 1.219666e-02, tj, tj1, result);
2037
+ jbcheb(x, 1.502210e-04, tj, tj1, result);
2038
+ jbcheb(x, -6.414543e-05, tj, tj1, result);
2039
+ jbcheb(x, 6.754115e-05, tj, tj1, result);
2040
+ if( result>0 )
2041
+ {
2042
+ result = 0;
2043
+ }
2044
+ return result;
2045
+ }
2046
+ if( s<=15.0000 )
2047
+ {
2048
+ x = 2*(s-4.000000)/11.000000-1;
2049
+ tj = 1;
2050
+ tj1 = x;
2051
+ jbcheb(x, -4.065955e+00, tj, tj1, result);
2052
+ jbcheb(x, -1.582060e+00, tj, tj1, result);
2053
+ jbcheb(x, 2.004472e-01, tj, tj1, result);
2054
+ jbcheb(x, -4.709092e-02, tj, tj1, result);
2055
+ jbcheb(x, 1.105779e-02, tj, tj1, result);
2056
+ jbcheb(x, 1.197391e-03, tj, tj1, result);
2057
+ jbcheb(x, -8.386780e-04, tj, tj1, result);
2058
+ if( result>0 )
2059
+ {
2060
+ result = 0;
2061
+ }
2062
+ return result;
2063
+ }
2064
+ if( s<=25.0000 )
2065
+ {
2066
+ x = 2*(s-15.000000)/10.000000-1;
2067
+ tj = 1;
2068
+ tj1 = x;
2069
+ jbcheb(x, -6.311384e+00, tj, tj1, result);
2070
+ jbcheb(x, -7.918763e-01, tj, tj1, result);
2071
+ jbcheb(x, 3.626584e-02, tj, tj1, result);
2072
+ if( result>0 )
2073
+ {
2074
+ result = 0;
2075
+ }
2076
+ return result;
2077
+ }
2078
+ result = -1.293626e-01*(s-2.500000e+01)-7.066995e+00;
2079
+ return result;
2080
+ }
2081
+
2082
+
2083
+ static double jbtbl501(double s)
2084
+ {
2085
+ double result;
2086
+ double x;
2087
+ double tj;
2088
+ double tj1;
2089
+
2090
+ result = 0;
2091
+ if( s<=4.0000 )
2092
+ {
2093
+ x = 2*(s-0.000000)/4.000000-1;
2094
+ tj = 1;
2095
+ tj1 = x;
2096
+ jbcheb(x, -1.067426e+00, tj, tj1, result);
2097
+ jbcheb(x, -1.079765e+00, tj, tj1, result);
2098
+ jbcheb(x, -5.463005e-03, tj, tj1, result);
2099
+ jbcheb(x, 6.875659e-03, tj, tj1, result);
2100
+ if( result>0 )
2101
+ {
2102
+ result = 0;
2103
+ }
2104
+ return result;
2105
+ }
2106
+ if( s<=15.0000 )
2107
+ {
2108
+ x = 2*(s-4.000000)/11.000000-1;
2109
+ tj = 1;
2110
+ tj1 = x;
2111
+ jbcheb(x, -4.127574e+00, tj, tj1, result);
2112
+ jbcheb(x, -1.740694e+00, tj, tj1, result);
2113
+ jbcheb(x, 2.044502e-01, tj, tj1, result);
2114
+ jbcheb(x, -3.746714e-02, tj, tj1, result);
2115
+ jbcheb(x, 3.810594e-04, tj, tj1, result);
2116
+ jbcheb(x, 1.197111e-03, tj, tj1, result);
2117
+ if( result>0 )
2118
+ {
2119
+ result = 0;
2120
+ }
2121
+ return result;
2122
+ }
2123
+ if( s<=25.0000 )
2124
+ {
2125
+ x = 2*(s-15.000000)/10.000000-1;
2126
+ tj = 1;
2127
+ tj1 = x;
2128
+ jbcheb(x, -6.628194e+00, tj, tj1, result);
2129
+ jbcheb(x, -8.846221e-01, tj, tj1, result);
2130
+ jbcheb(x, 4.386405e-02, tj, tj1, result);
2131
+ if( result>0 )
2132
+ {
2133
+ result = 0;
2134
+ }
2135
+ return result;
2136
+ }
2137
+ result = -1.418332e-01*(s-2.500000e+01)-7.468952e+00;
2138
+ return result;
2139
+ }
2140
+
2141
+
2142
+ static double jbtbl701(double s)
2143
+ {
2144
+ double result;
2145
+ double x;
2146
+ double tj;
2147
+ double tj1;
2148
+
2149
+ result = 0;
2150
+ if( s<=4.0000 )
2151
+ {
2152
+ x = 2*(s-0.000000)/4.000000-1;
2153
+ tj = 1;
2154
+ tj1 = x;
2155
+ jbcheb(x, -1.050999e+00, tj, tj1, result);
2156
+ jbcheb(x, -1.059769e+00, tj, tj1, result);
2157
+ jbcheb(x, -3.922680e-03, tj, tj1, result);
2158
+ jbcheb(x, 4.847054e-03, tj, tj1, result);
2159
+ if( result>0 )
2160
+ {
2161
+ result = 0;
2162
+ }
2163
+ return result;
2164
+ }
2165
+ if( s<=15.0000 )
2166
+ {
2167
+ x = 2*(s-4.000000)/11.000000-1;
2168
+ tj = 1;
2169
+ tj1 = x;
2170
+ jbcheb(x, -4.192182e+00, tj, tj1, result);
2171
+ jbcheb(x, -1.860007e+00, tj, tj1, result);
2172
+ jbcheb(x, 1.963942e-01, tj, tj1, result);
2173
+ jbcheb(x, -2.838711e-02, tj, tj1, result);
2174
+ jbcheb(x, -2.893112e-04, tj, tj1, result);
2175
+ jbcheb(x, 2.159788e-03, tj, tj1, result);
2176
+ if( result>0 )
2177
+ {
2178
+ result = 0;
2179
+ }
2180
+ return result;
2181
+ }
2182
+ if( s<=25.0000 )
2183
+ {
2184
+ x = 2*(s-15.000000)/10.000000-1;
2185
+ tj = 1;
2186
+ tj1 = x;
2187
+ jbcheb(x, -6.917851e+00, tj, tj1, result);
2188
+ jbcheb(x, -9.817020e-01, tj, tj1, result);
2189
+ jbcheb(x, 5.383727e-02, tj, tj1, result);
2190
+ if( result>0 )
2191
+ {
2192
+ result = 0;
2193
+ }
2194
+ return result;
2195
+ }
2196
+ result = -1.532706e-01*(s-2.500000e+01)-7.845715e+00;
2197
+ return result;
2198
+ }
2199
+
2200
+
2201
+ static double jbtbl1401(double s)
2202
+ {
2203
+ double result;
2204
+ double x;
2205
+ double tj;
2206
+ double tj1;
2207
+
2208
+ result = 0;
2209
+ if( s<=4.0000 )
2210
+ {
2211
+ x = 2*(s-0.000000)/4.000000-1;
2212
+ tj = 1;
2213
+ tj1 = x;
2214
+ jbcheb(x, -1.026266e+00, tj, tj1, result);
2215
+ jbcheb(x, -1.030061e+00, tj, tj1, result);
2216
+ jbcheb(x, -1.259222e-03, tj, tj1, result);
2217
+ jbcheb(x, 2.536254e-03, tj, tj1, result);
2218
+ if( result>0 )
2219
+ {
2220
+ result = 0;
2221
+ }
2222
+ return result;
2223
+ }
2224
+ if( s<=15.0000 )
2225
+ {
2226
+ x = 2*(s-4.000000)/11.000000-1;
2227
+ tj = 1;
2228
+ tj1 = x;
2229
+ jbcheb(x, -4.329849e+00, tj, tj1, result);
2230
+ jbcheb(x, -2.095443e+00, tj, tj1, result);
2231
+ jbcheb(x, 1.759363e-01, tj, tj1, result);
2232
+ jbcheb(x, -7.751359e-03, tj, tj1, result);
2233
+ jbcheb(x, -6.124368e-03, tj, tj1, result);
2234
+ jbcheb(x, -1.793114e-03, tj, tj1, result);
2235
+ if( result>0 )
2236
+ {
2237
+ result = 0;
2238
+ }
2239
+ return result;
2240
+ }
2241
+ if( s<=25.0000 )
2242
+ {
2243
+ x = 2*(s-15.000000)/10.000000-1;
2244
+ tj = 1;
2245
+ tj1 = x;
2246
+ jbcheb(x, -7.544330e+00, tj, tj1, result);
2247
+ jbcheb(x, -1.225382e+00, tj, tj1, result);
2248
+ jbcheb(x, 5.392349e-02, tj, tj1, result);
2249
+ if( result>0 )
2250
+ {
2251
+ result = 0;
2252
+ }
2253
+ return result;
2254
+ }
2255
+ result = -2.019375e-01*(s-2.500000e+01)-8.715788e+00;
2256
+ return result;
2257
+ }
2258
+
2259
+
2260
+ static void jbcheb(double x, double c, double& tj, double& tj1, double& r)
2261
+ {
2262
+ double t;
2263
+
2264
+ r = r+c*tj;
2265
+ t = 2*x*tj1-tj;
2266
+ tj = tj1;
2267
+ tj1 = t;
2268
+ }
2269
+
2270
+
2271
+