| 1 | /* specfunc/coupling.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Gerard Jungman |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | /* Author: G. Jungman */ |
| 21 | |
| 22 | #include "gsl__config.h"cxx . . $ `<file>/external/gsl/gsl__config.h`/ |
| 23 | #include <stdlib.h> |
| 24 | #include "gsl_math.h"cxx . . $ `<file>/external/gsl/gsl_math.h`/ |
| 25 | #include "gsl_errno.h"cxx . . $ `<file>/external/gsl/gsl_errno.h`/ |
| 26 | #include "gsl_sf_gamma.h"cxx . . $ `<file>/external/gsl/gsl_sf_gamma.h`/ |
| 27 | #include "gsl_sf_coupling.h"cxx . . $ `<file>/external/gsl/gsl_sf_coupling.h`/ |
| 28 | |
| 29 | #include "gsl_specfunc__error.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__error.h`/ |
| 30 | |
| 31 | inline |
| 32 | static |
| 33 | int locMax3cxx . . $ locMax3(2326284602b0bb2d).(const int a, const int b, const int c) |
| 34 | { |
| 35 | int d = GSL_MAXcxx . . $ `external/gsl/gsl_math.h:122:9`!(a, b); |
| 36 | return GSL_MAXcxx . . $ `external/gsl/gsl_math.h:122:9`!(d, c); |
| 37 | } |
| 38 | |
| 39 | inline |
| 40 | static |
| 41 | int locMin3cxx . . $ locMin3(2326284602b0bb2d).(const int a, const int b, const int c) |
| 42 | { |
| 43 | int d = GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(a, b); |
| 44 | return GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(d, c); |
| 45 | } |
| 46 | |
| 47 | inline |
| 48 | static |
| 49 | int locMin5cxx . . $ locMin5(ea6ae529d4ec1c7a).(const int a, const int b, const int c, const int d, const int e) |
| 50 | { |
| 51 | int f = GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(a, b); |
| 52 | int g = GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(c, d); |
| 53 | int h = GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(f, g); |
| 54 | return GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(e, h); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | /* See: [Thompson, Atlas for Computing Mathematical Functions] */ |
| 59 | |
| 60 | static |
| 61 | int |
| 62 | deltacxx . . $ delta(b1bd18eb6ae4ecbf).(int ta, int tb, int tc, gsl_sf_resultcxx . . $ gsl_sf_result# * d) |
| 63 | { |
| 64 | gsl_sf_resultcxx . . $ gsl_sf_result# f1, f2, f3, f4; |
| 65 | int status = 0; |
| 66 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((ta + tb - tc)/2, &f1); |
| 67 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((ta + tc - tb)/2, &f2); |
| 68 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((tb + tc - ta)/2, &f3); |
| 69 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((ta + tb + tc)/2 + 1, &f4); |
| 70 | if(status != 0) { |
| 71 | OVERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:1:9`!(d); |
| 72 | } |
| 73 | d->valcxx . . $ gsl_sf_result_struct#val. = f1.valcxx . . $ gsl_sf_result_struct#val. * f2.valcxx . . $ gsl_sf_result_struct#val. * f3.valcxx . . $ gsl_sf_result_struct#val. / f4.valcxx . . $ gsl_sf_result_struct#val.; |
| 74 | d->errcxx . . $ gsl_sf_result_struct#err. = 4.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * fabs(d->valcxx . . $ gsl_sf_result_struct#val.); |
| 75 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 76 | } |
| 77 | |
| 78 | |
| 79 | static |
| 80 | int |
| 81 | triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(int two_ja, int two_jb, int two_jc) |
| 82 | { |
| 83 | return ((two_jb < abscxx . . $ abs(7864480464b09eea).(two_ja - two_jc)) || (two_jb > two_ja + two_jc)); |
| 84 | } |
| 85 | |
| 86 | |
| 87 | static |
| 88 | int |
| 89 | m_selection_failscxx . . $ m_selection_fails(4ccc28f389ac356e).(int two_ja, int two_jb, int two_jc, |
| 90 | int two_ma, int two_mb, int two_mc) |
| 91 | { |
| 92 | return ( |
| 93 | abscxx . . $ abs(7864480464b09eea).(two_ma) > two_ja |
| 94 | || abscxx . . $ abs(7864480464b09eea).(two_mb) > two_jb |
| 95 | || abscxx . . $ abs(7864480464b09eea).(two_mc) > two_jc |
| 96 | || GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`!(two_ja + two_ma) |
| 97 | || GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`!(two_jb + two_mb) |
| 98 | || GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`!(two_jc + two_mc) |
| 99 | || (two_ma + two_mb + two_mc) != 0 |
| 100 | ); |
| 101 | } |
| 102 | |
| 103 | |
| 104 | /*-*-*-*-*-*-*-*-*-*-*-* Functions with Error Codes *-*-*-*-*-*-*-*-*-*-*-*/ |
| 105 | |
| 106 | |
| 107 | int |
| 108 | gsl_sf_coupling_3j_ecxx . . $ gsl_sf_coupling_3j_e(7ce4ce67fdc5e5f). (int two_ja, int two_jb, int two_jc, |
| 109 | int two_ma, int two_mb, int two_mc, |
| 110 | gsl_sf_resultcxx . . $ gsl_sf_result# * result) |
| 111 | { |
| 112 | /* CHECK_POINTER(result) */ |
| 113 | |
| 114 | if(two_ja < 0 || two_jb < 0 || two_jc < 0) { |
| 115 | DOMAIN_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:9:9`!(result); |
| 116 | } |
| 117 | else if ( triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_ja, two_jb, two_jc) |
| 118 | || m_selection_failscxx . . $ m_selection_fails(4ccc28f389ac356e).(two_ja, two_jb, two_jc, two_ma, two_mb, two_mc) |
| 119 | ) { |
| 120 | result->valcxx . . $ gsl_sf_result_struct#val. = 0.0; |
| 121 | result->errcxx . . $ gsl_sf_result_struct#err. = 0.0; |
| 122 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 123 | } |
| 124 | else { |
| 125 | int jca = (-two_ja + two_jb + two_jc) / 2, |
| 126 | jcb = ( two_ja - two_jb + two_jc) / 2, |
| 127 | jcc = ( two_ja + two_jb - two_jc) / 2, |
| 128 | jmma = ( two_ja - two_ma) / 2, |
| 129 | jmmb = ( two_jb - two_mb) / 2, |
| 130 | jmmc = ( two_jc - two_mc) / 2, |
| 131 | jpma = ( two_ja + two_ma) / 2, |
| 132 | jpmb = ( two_jb + two_mb) / 2, |
| 133 | jpmc = ( two_jc + two_mc) / 2, |
| 134 | jsum = ( two_ja + two_jb + two_jc) / 2, |
| 135 | kmin = locMax3cxx . . $ locMax3(2326284602b0bb2d). (0, jpmb - jmmc, jmma - jpmc), |
| 136 | kmax = locMin3cxx . . $ locMin3(2326284602b0bb2d). (jcc, jmma, jpmb), |
| 137 | k, sign = GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`! (kmin - jpma + jmmb) ? -1 : 1, |
| 138 | status = 0; |
| 139 | double sum_pos = 0.0, sum_neg = 0.0, norm, term; |
| 140 | gsl_sf_resultcxx . . $ gsl_sf_result# bc1, bc2, bc3, bcn1, bcn2, bcd1, bcd2, bcd3, bcd4; |
| 141 | |
| 142 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (two_ja, jcc , &bcn1); |
| 143 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (two_jb, jcc , &bcn2); |
| 144 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (jsum+1, jcc , &bcd1); |
| 145 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (two_ja, jmma, &bcd2); |
| 146 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (two_jb, jmmb, &bcd3); |
| 147 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (two_jc, jpmc, &bcd4); |
| 148 | |
| 149 | if (status != 0) { |
| 150 | OVERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:1:9`! (result); |
| 151 | } |
| 152 | |
| 153 | norm = sqrt (bcn1.valcxx . . $ gsl_sf_result_struct#val. * bcn2.valcxx . . $ gsl_sf_result_struct#val.) |
| 154 | / sqrt (bcd1.valcxx . . $ gsl_sf_result_struct#val. * bcd2.valcxx . . $ gsl_sf_result_struct#val. * bcd3.valcxx . . $ gsl_sf_result_struct#val. * bcd4.valcxx . . $ gsl_sf_result_struct#val. * ((double) two_jc + 1.0)); |
| 155 | |
| 156 | for (k = kmin; k <= kmax; k++) { |
| 157 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (jcc, k, &bc1); |
| 158 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (jcb, jmma - k, &bc2); |
| 159 | status += gsl_sf_choose_ecxx . . $ gsl_sf_choose_e(a5eea524a1d22dcb). (jca, jpmb - k, &bc3); |
| 160 | |
| 161 | if (status != 0) { |
| 162 | OVERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:1:9`! (result); |
| 163 | } |
| 164 | |
| 165 | term = bc1.valcxx . . $ gsl_sf_result_struct#val. * bc2.valcxx . . $ gsl_sf_result_struct#val. * bc3.valcxx . . $ gsl_sf_result_struct#val.; |
| 166 | |
| 167 | if (sign < 0) { |
| 168 | sum_neg += norm * term; |
| 169 | } else { |
| 170 | sum_pos += norm * term; |
| 171 | } |
| 172 | |
| 173 | sign = -sign; |
| 174 | } |
| 175 | |
| 176 | result->valcxx . . $ gsl_sf_result_struct#val. = sum_pos - sum_neg; |
| 177 | result->errcxx . . $ gsl_sf_result_struct#err. = 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * (sum_pos + sum_neg); |
| 178 | result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * (kmax - kmin) * fabs(result->valcxx . . $ gsl_sf_result_struct#val.); |
| 179 | |
| 180 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 181 | } |
| 182 | } |
| 183 | #if ! defined (GSL_DISABLE_DEPRECATEDcxx . . $ `external/gsl/gsl__config.h:317:9`!) |
| 184 | int |
| 185 | gsl_sf_coupling_6j_INCORRECT_e(int two_ja, int two_jb, int two_jc, |
| 186 | int two_jd, int two_je, int two_jf, |
| 187 | gsl_sf_result * result) |
| 188 | { |
| 189 | return gsl_sf_coupling_6j_e(two_ja, two_jb, two_je, two_jd, two_jc, two_jf, result); |
| 190 | } |
| 191 | #endif |
| 192 | |
| 193 | int |
| 194 | gsl_sf_coupling_6j_ecxx . . $ gsl_sf_coupling_6j_e(7ce4ce67fdc5e5f).(int two_ja, int two_jb, int two_jc, |
| 195 | int two_jd, int two_je, int two_jf, |
| 196 | gsl_sf_resultcxx . . $ gsl_sf_result# * result) |
| 197 | { |
| 198 | /* CHECK_POINTER(result) */ |
| 199 | |
| 200 | if( two_ja < 0 || two_jb < 0 || two_jc < 0 |
| 201 | || two_jd < 0 || two_je < 0 || two_jf < 0 |
| 202 | ) { |
| 203 | DOMAIN_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:9:9`!(result); |
| 204 | } |
| 205 | else if( triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_ja, two_jb, two_jc) |
| 206 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_ja, two_je, two_jf) |
| 207 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_jb, two_jd, two_jf) |
| 208 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_je, two_jd, two_jc) |
| 209 | ) { |
| 210 | result->valcxx . . $ gsl_sf_result_struct#val. = 0.0; |
| 211 | result->errcxx . . $ gsl_sf_result_struct#err. = 0.0; |
| 212 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 213 | } |
| 214 | else { |
| 215 | gsl_sf_resultcxx . . $ gsl_sf_result# n1; |
| 216 | gsl_sf_resultcxx . . $ gsl_sf_result# d1, d2, d3, d4, d5, d6; |
| 217 | double norm; |
| 218 | int tk, tkmin, tkmax; |
| 219 | double phase; |
| 220 | double sum_pos = 0.0; |
| 221 | double sum_neg = 0.0; |
| 222 | double sumsq_err = 0.0; |
| 223 | int status = 0; |
| 224 | status += deltacxx . . $ delta(b1bd18eb6ae4ecbf).(two_ja, two_jb, two_jc, &d1); |
| 225 | status += deltacxx . . $ delta(b1bd18eb6ae4ecbf).(two_ja, two_je, two_jf, &d2); |
| 226 | status += deltacxx . . $ delta(b1bd18eb6ae4ecbf).(two_jb, two_jd, two_jf, &d3); |
| 227 | status += deltacxx . . $ delta(b1bd18eb6ae4ecbf).(two_je, two_jd, two_jc, &d4); |
| 228 | if(status != GSL_SUCCESScxx . . $ GSL_SUCCESS.) { |
| 229 | OVERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:1:9`!(result); |
| 230 | } |
| 231 | norm = sqrt(d1.valcxx . . $ gsl_sf_result_struct#val.) * sqrt(d2.valcxx . . $ gsl_sf_result_struct#val.) * sqrt(d3.valcxx . . $ gsl_sf_result_struct#val.) * sqrt(d4.valcxx . . $ gsl_sf_result_struct#val.); |
| 232 | |
| 233 | tkmin = locMax3cxx . . $ locMax3(2326284602b0bb2d).(0, |
| 234 | two_ja + two_jd - two_jc - two_jf, |
| 235 | two_jb + two_je - two_jc - two_jf); |
| 236 | |
| 237 | tkmax = locMin5cxx . . $ locMin5(ea6ae529d4ec1c7a).(two_ja + two_jb + two_je + two_jd + 2, |
| 238 | two_ja + two_jb - two_jc, |
| 239 | two_je + two_jd - two_jc, |
| 240 | two_ja + two_je - two_jf, |
| 241 | two_jb + two_jd - two_jf); |
| 242 | |
| 243 | phase = GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`!((two_ja + two_jb + two_je + two_jd + tkmin)/2) |
| 244 | ? -1.0 |
| 245 | : 1.0; |
| 246 | |
| 247 | for(tk=tkmin; tk<=tkmax; tk += 2) { |
| 248 | double term; |
| 249 | double term_err; |
| 250 | gsl_sf_resultcxx . . $ gsl_sf_result# den_1, den_2; |
| 251 | gsl_sf_resultcxx . . $ gsl_sf_result# d1_a, d1_b; |
| 252 | status = 0; |
| 253 | |
| 254 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((two_ja + two_jb + two_je + two_jd - tk)/2 + 1, &n1); |
| 255 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).(tk/2, &d1_a); |
| 256 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((two_jc + two_jf - two_ja - two_jd + tk)/2, &d1_b); |
| 257 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((two_jc + two_jf - two_jb - two_je + tk)/2, &d2); |
| 258 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((two_ja + two_jb - two_jc - tk)/2, &d3); |
| 259 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((two_je + two_jd - two_jc - tk)/2, &d4); |
| 260 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((two_ja + two_je - two_jf - tk)/2, &d5); |
| 261 | status += gsl_sf_fact_ecxx . . $ gsl_sf_fact_e(adc32cefe998392c).((two_jb + two_jd - two_jf - tk)/2, &d6); |
| 262 | |
| 263 | if(status != GSL_SUCCESScxx . . $ GSL_SUCCESS.) { |
| 264 | OVERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:1:9`!(result); |
| 265 | } |
| 266 | |
| 267 | d1.valcxx . . $ gsl_sf_result_struct#val. = d1_a.valcxx . . $ gsl_sf_result_struct#val. * d1_b.valcxx . . $ gsl_sf_result_struct#val.; |
| 268 | d1.errcxx . . $ gsl_sf_result_struct#err. = d1_a.errcxx . . $ gsl_sf_result_struct#err. * fabs(d1_b.valcxx . . $ gsl_sf_result_struct#val.) + fabs(d1_a.valcxx . . $ gsl_sf_result_struct#val.) * d1_b.errcxx . . $ gsl_sf_result_struct#err.; |
| 269 | |
| 270 | den_1.valcxx . . $ gsl_sf_result_struct#val. = d1.valcxx . . $ gsl_sf_result_struct#val.*d2.valcxx . . $ gsl_sf_result_struct#val.*d3.valcxx . . $ gsl_sf_result_struct#val.; |
| 271 | den_1.errcxx . . $ gsl_sf_result_struct#err. = d1.errcxx . . $ gsl_sf_result_struct#err. * fabs(d2.valcxx . . $ gsl_sf_result_struct#val.*d3.valcxx . . $ gsl_sf_result_struct#val.); |
| 272 | den_1.errcxx . . $ gsl_sf_result_struct#err. += d2.errcxx . . $ gsl_sf_result_struct#err. * fabs(d1.valcxx . . $ gsl_sf_result_struct#val.*d3.valcxx . . $ gsl_sf_result_struct#val.); |
| 273 | den_1.errcxx . . $ gsl_sf_result_struct#err. += d3.errcxx . . $ gsl_sf_result_struct#err. * fabs(d1.valcxx . . $ gsl_sf_result_struct#val.*d2.valcxx . . $ gsl_sf_result_struct#val.); |
| 274 | |
| 275 | den_2.valcxx . . $ gsl_sf_result_struct#val. = d4.valcxx . . $ gsl_sf_result_struct#val.*d5.valcxx . . $ gsl_sf_result_struct#val.*d6.valcxx . . $ gsl_sf_result_struct#val.; |
| 276 | den_2.errcxx . . $ gsl_sf_result_struct#err. = d4.errcxx . . $ gsl_sf_result_struct#err. * fabs(d5.valcxx . . $ gsl_sf_result_struct#val.*d6.valcxx . . $ gsl_sf_result_struct#val.); |
| 277 | den_2.errcxx . . $ gsl_sf_result_struct#err. += d5.errcxx . . $ gsl_sf_result_struct#err. * fabs(d4.valcxx . . $ gsl_sf_result_struct#val.*d6.valcxx . . $ gsl_sf_result_struct#val.); |
| 278 | den_2.errcxx . . $ gsl_sf_result_struct#err. += d6.errcxx . . $ gsl_sf_result_struct#err. * fabs(d4.valcxx . . $ gsl_sf_result_struct#val.*d5.valcxx . . $ gsl_sf_result_struct#val.); |
| 279 | |
| 280 | term = phase * n1.valcxx . . $ gsl_sf_result_struct#val. / den_1.valcxx . . $ gsl_sf_result_struct#val. / den_2.valcxx . . $ gsl_sf_result_struct#val.; |
| 281 | phase = -phase; |
| 282 | term_err = n1.errcxx . . $ gsl_sf_result_struct#err. / fabs(den_1.valcxx . . $ gsl_sf_result_struct#val.) / fabs(den_2.valcxx . . $ gsl_sf_result_struct#val.); |
| 283 | term_err += fabs(term / den_1.valcxx . . $ gsl_sf_result_struct#val.) * den_1.errcxx . . $ gsl_sf_result_struct#err.; |
| 284 | term_err += fabs(term / den_2.valcxx . . $ gsl_sf_result_struct#val.) * den_2.errcxx . . $ gsl_sf_result_struct#err.; |
| 285 | |
| 286 | if(term >= 0.0) { |
| 287 | sum_pos += norm*term; |
| 288 | } |
| 289 | else { |
| 290 | sum_neg -= norm*term; |
| 291 | } |
| 292 | |
| 293 | sumsq_err += norm*norm * term_err*term_err; |
| 294 | } |
| 295 | |
| 296 | result->valcxx . . $ gsl_sf_result_struct#val. = sum_pos - sum_neg; |
| 297 | result->errcxx . . $ gsl_sf_result_struct#err. = 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * (sum_pos + sum_neg); |
| 298 | result->errcxx . . $ gsl_sf_result_struct#err. += sqrt(sumsq_err / (0.5*(tkmax-tkmin)+1.0)); |
| 299 | result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * (tkmax - tkmin + 2.0) * fabs(result->valcxx . . $ gsl_sf_result_struct#val.); |
| 300 | |
| 301 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | |
| 306 | int |
| 307 | gsl_sf_coupling_RacahW_ecxx . . $ gsl_sf_coupling_RacahW_e(7ce4ce67fdc5e5f).(int two_ja, int two_jb, int two_jc, |
| 308 | int two_jd, int two_je, int two_jf, |
| 309 | gsl_sf_resultcxx . . $ gsl_sf_result# * result) |
| 310 | { |
| 311 | int status = gsl_sf_coupling_6j_ecxx . . $ gsl_sf_coupling_6j_e(7ce4ce67fdc5e5f).(two_ja, two_jb, two_je, two_jd, two_jc, two_jf, result); |
| 312 | int phase_sum = (two_ja + two_jb + two_jc + two_jd)/2; |
| 313 | result->valcxx . . $ gsl_sf_result_struct#val. *= ( GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`!(phase_sum) ? -1.0 : 1.0 ); |
| 314 | return status; |
| 315 | } |
| 316 | |
| 317 | |
| 318 | int |
| 319 | gsl_sf_coupling_9j_ecxx . . $ gsl_sf_coupling_9j_e(5cb48b3d353da044).(int two_ja, int two_jb, int two_jc, |
| 320 | int two_jd, int two_je, int two_jf, |
| 321 | int two_jg, int two_jh, int two_ji, |
| 322 | gsl_sf_resultcxx . . $ gsl_sf_result# * result) |
| 323 | { |
| 324 | /* CHECK_POINTER(result) */ |
| 325 | |
| 326 | if( two_ja < 0 || two_jb < 0 || two_jc < 0 |
| 327 | || two_jd < 0 || two_je < 0 || two_jf < 0 |
| 328 | || two_jg < 0 || two_jh < 0 || two_ji < 0 |
| 329 | ) { |
| 330 | DOMAIN_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:9:9`!(result); |
| 331 | } |
| 332 | else if( triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_ja, two_jb, two_jc) |
| 333 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_jd, two_je, two_jf) |
| 334 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_jg, two_jh, two_ji) |
| 335 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_ja, two_jd, two_jg) |
| 336 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_jb, two_je, two_jh) |
| 337 | || triangle_selection_failscxx . . $ triangle_selection_fails(2326284602b0bb2d).(two_jc, two_jf, two_ji) |
| 338 | ) { |
| 339 | result->valcxx . . $ gsl_sf_result_struct#val. = 0.0; |
| 340 | result->errcxx . . $ gsl_sf_result_struct#err. = 0.0; |
| 341 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 342 | } |
| 343 | else { |
| 344 | int tk; |
| 345 | int tkmin = locMax3cxx . . $ locMax3(2326284602b0bb2d).(abscxx . . $ abs(7864480464b09eea).(two_ja-two_ji), abscxx . . $ abs(7864480464b09eea).(two_jh-two_jd), abscxx . . $ abs(7864480464b09eea).(two_jb-two_jf)); |
| 346 | int tkmax = locMin3cxx . . $ locMin3(2326284602b0bb2d).(two_ja + two_ji, two_jh + two_jd, two_jb + two_jf); |
| 347 | double sum_pos = 0.0; |
| 348 | double sum_neg = 0.0; |
| 349 | double sumsq_err = 0.0; |
| 350 | double phase; |
| 351 | for(tk=tkmin; tk<=tkmax; tk += 2) { |
| 352 | gsl_sf_resultcxx . . $ gsl_sf_result# s1, s2, s3; |
| 353 | double term; |
| 354 | double term_err; |
| 355 | int status = 0; |
| 356 | |
| 357 | status += gsl_sf_coupling_6j_ecxx . . $ gsl_sf_coupling_6j_e(7ce4ce67fdc5e5f).(two_ja, two_ji, tk, two_jh, two_jd, two_jg, &s1); |
| 358 | status += gsl_sf_coupling_6j_ecxx . . $ gsl_sf_coupling_6j_e(7ce4ce67fdc5e5f).(two_jb, two_jf, tk, two_jd, two_jh, two_je, &s2); |
| 359 | status += gsl_sf_coupling_6j_ecxx . . $ gsl_sf_coupling_6j_e(7ce4ce67fdc5e5f).(two_ja, two_ji, tk, two_jf, two_jb, two_jc, &s3); |
| 360 | |
| 361 | if(status != GSL_SUCCESScxx . . $ GSL_SUCCESS.) { |
| 362 | OVERFLOW_ERRORcxx . . $ `external/gsl/gsl_specfunc__error.h:1:9`!(result); |
| 363 | } |
| 364 | term = s1.valcxx . . $ gsl_sf_result_struct#val. * s2.valcxx . . $ gsl_sf_result_struct#val. * s3.valcxx . . $ gsl_sf_result_struct#val.; |
| 365 | term_err = s1.errcxx . . $ gsl_sf_result_struct#err. * fabs(s2.valcxx . . $ gsl_sf_result_struct#val.*s3.valcxx . . $ gsl_sf_result_struct#val.); |
| 366 | term_err += s2.errcxx . . $ gsl_sf_result_struct#err. * fabs(s1.valcxx . . $ gsl_sf_result_struct#val.*s3.valcxx . . $ gsl_sf_result_struct#val.); |
| 367 | term_err += s3.errcxx . . $ gsl_sf_result_struct#err. * fabs(s1.valcxx . . $ gsl_sf_result_struct#val.*s2.valcxx . . $ gsl_sf_result_struct#val.); |
| 368 | |
| 369 | if(term >= 0.0) { |
| 370 | sum_pos += (tk + 1) * term; |
| 371 | } |
| 372 | else { |
| 373 | sum_neg -= (tk + 1) * term; |
| 374 | } |
| 375 | |
| 376 | sumsq_err += ((tk+1) * term_err) * ((tk+1) * term_err); |
| 377 | } |
| 378 | |
| 379 | phase = GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`!(tkmin) ? -1.0 : 1.0; |
| 380 | |
| 381 | result->valcxx . . $ gsl_sf_result_struct#val. = phase * (sum_pos - sum_neg); |
| 382 | result->errcxx . . $ gsl_sf_result_struct#err. = 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * (sum_pos + sum_neg); |
| 383 | result->errcxx . . $ gsl_sf_result_struct#err. += sqrt(sumsq_err / (0.5*(tkmax-tkmin)+1.0)); |
| 384 | result->errcxx . . $ gsl_sf_result_struct#err. += 2.0 * GSL_DBL_EPSILONcxx . . $ `external/gsl/gsl_machine.h:17:9`! * (tkmax-tkmin + 2.0) * fabs(result->valcxx . . $ gsl_sf_result_struct#val.); |
| 385 | |
| 386 | return GSL_SUCCESScxx . . $ GSL_SUCCESS.; |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | |
| 391 | /*-*-*-*-*-*-*-*-*-* Functions w/ Natural Prototypes *-*-*-*-*-*-*-*-*-*-*/ |
| 392 | |
| 393 | #include "gsl_specfunc__eval.h"cxx . . $ `<file>/external/gsl/gsl_specfunc__eval.h`/ |
| 394 | |
| 395 | double gsl_sf_coupling_3jcxx . . $ gsl_sf_coupling_3j(9597366e80b3b876).(int two_ja, int two_jb, int two_jc, |
| 396 | int two_ma, int two_mb, int two_mc) |
| 397 | { |
| 398 | EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_coupling_3j_e(two_ja, two_jb, two_jc, |
| 399 | two_ma, two_mb, two_mc, |
| 400 | &result)); |
| 401 | } |
| 402 | |
| 403 | #if ! defined (GSL_DISABLE_DEPRECATEDcxx . . $ `external/gsl/gsl__config.h:317:9`!) |
| 404 | double gsl_sf_coupling_6j_INCORRECT(int two_ja, int two_jb, int two_jc, |
| 405 | int two_jd, int two_je, int two_jf) |
| 406 | { |
| 407 | EVAL_RESULT(gsl_sf_coupling_6j_INCORRECT_e(two_ja, two_jb, two_jc, |
| 408 | two_jd, two_je, two_jf, |
| 409 | &result)); |
| 410 | } |
| 411 | #endif |
| 412 | |
| 413 | double gsl_sf_coupling_6jcxx . . $ gsl_sf_coupling_6j(9597366e80b3b876).(int two_ja, int two_jb, int two_jc, |
| 414 | int two_jd, int two_je, int two_jf) |
| 415 | { |
| 416 | EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_coupling_6j_e(two_ja, two_jb, two_jc, |
| 417 | two_jd, two_je, two_jf, |
| 418 | &result)); |
| 419 | } |
| 420 | |
| 421 | |
| 422 | double gsl_sf_coupling_RacahWcxx . . $ gsl_sf_coupling_RacahW(9597366e80b3b876).(int two_ja, int two_jb, int two_jc, |
| 423 | int two_jd, int two_je, int two_jf) |
| 424 | { |
| 425 | EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_coupling_RacahW_e(two_ja, two_jb, two_jc, |
| 426 | two_jd, two_je, two_jf, |
| 427 | &result)); |
| 428 | } |
| 429 | |
| 430 | |
| 431 | double gsl_sf_coupling_9jcxx . . $ gsl_sf_coupling_9j(78a9d5188d437e8e).(int two_ja, int two_jb, int two_jc, |
| 432 | int two_jd, int two_je, int two_jf, |
| 433 | int two_jg, int two_jh, int two_ji) |
| 434 | { |
| 435 | EVAL_RESULTcxx . . $ `external/gsl/gsl_specfunc__eval.h:3:9`!(gsl_sf_coupling_9j_e(two_ja, two_jb, two_jc, |
| 436 | two_jd, two_je, two_jf, |
| 437 | two_jg, two_jh, two_ji, |
| 438 | &result)); |
| 439 | } |