chaine 3.13.1__cp310-cp310-musllinux_1_2_i686.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of chaine might be problematic. Click here for more details.

Files changed (70) hide show
  1. chaine/__init__.py +2 -0
  2. chaine/_core/crf.cpp +19854 -0
  3. chaine/_core/crf.cpython-310-i386-linux-gnu.so +0 -0
  4. chaine/_core/crf.pyx +271 -0
  5. chaine/_core/crfsuite/COPYING +27 -0
  6. chaine/_core/crfsuite/README +183 -0
  7. chaine/_core/crfsuite/include/crfsuite.h +1077 -0
  8. chaine/_core/crfsuite/include/crfsuite.hpp +649 -0
  9. chaine/_core/crfsuite/include/crfsuite_api.hpp +406 -0
  10. chaine/_core/crfsuite/include/os.h +65 -0
  11. chaine/_core/crfsuite/lib/cqdb/COPYING +28 -0
  12. chaine/_core/crfsuite/lib/cqdb/include/cqdb.h +518 -0
  13. chaine/_core/crfsuite/lib/cqdb/src/cqdb.c +639 -0
  14. chaine/_core/crfsuite/lib/cqdb/src/lookup3.c +1271 -0
  15. chaine/_core/crfsuite/lib/cqdb/src/main.c +184 -0
  16. chaine/_core/crfsuite/lib/crf/src/crf1d.h +354 -0
  17. chaine/_core/crfsuite/lib/crf/src/crf1d_context.c +788 -0
  18. chaine/_core/crfsuite/lib/crf/src/crf1d_encode.c +1020 -0
  19. chaine/_core/crfsuite/lib/crf/src/crf1d_feature.c +382 -0
  20. chaine/_core/crfsuite/lib/crf/src/crf1d_model.c +1085 -0
  21. chaine/_core/crfsuite/lib/crf/src/crf1d_tag.c +582 -0
  22. chaine/_core/crfsuite/lib/crf/src/crfsuite.c +500 -0
  23. chaine/_core/crfsuite/lib/crf/src/crfsuite_internal.h +233 -0
  24. chaine/_core/crfsuite/lib/crf/src/crfsuite_train.c +302 -0
  25. chaine/_core/crfsuite/lib/crf/src/dataset.c +115 -0
  26. chaine/_core/crfsuite/lib/crf/src/dictionary.c +127 -0
  27. chaine/_core/crfsuite/lib/crf/src/holdout.c +83 -0
  28. chaine/_core/crfsuite/lib/crf/src/json.c +1497 -0
  29. chaine/_core/crfsuite/lib/crf/src/json.h +120 -0
  30. chaine/_core/crfsuite/lib/crf/src/logging.c +85 -0
  31. chaine/_core/crfsuite/lib/crf/src/logging.h +49 -0
  32. chaine/_core/crfsuite/lib/crf/src/params.c +370 -0
  33. chaine/_core/crfsuite/lib/crf/src/params.h +84 -0
  34. chaine/_core/crfsuite/lib/crf/src/quark.c +180 -0
  35. chaine/_core/crfsuite/lib/crf/src/quark.h +46 -0
  36. chaine/_core/crfsuite/lib/crf/src/rumavl.c +1178 -0
  37. chaine/_core/crfsuite/lib/crf/src/rumavl.h +144 -0
  38. chaine/_core/crfsuite/lib/crf/src/train_arow.c +409 -0
  39. chaine/_core/crfsuite/lib/crf/src/train_averaged_perceptron.c +237 -0
  40. chaine/_core/crfsuite/lib/crf/src/train_l2sgd.c +491 -0
  41. chaine/_core/crfsuite/lib/crf/src/train_lbfgs.c +323 -0
  42. chaine/_core/crfsuite/lib/crf/src/train_passive_aggressive.c +442 -0
  43. chaine/_core/crfsuite/lib/crf/src/vecmath.h +360 -0
  44. chaine/_core/crfsuite/swig/crfsuite.cpp +1 -0
  45. chaine/_core/crfsuite_api.pxd +67 -0
  46. chaine/_core/liblbfgs/COPYING +22 -0
  47. chaine/_core/liblbfgs/README +71 -0
  48. chaine/_core/liblbfgs/include/lbfgs.h +745 -0
  49. chaine/_core/liblbfgs/lib/arithmetic_ansi.h +142 -0
  50. chaine/_core/liblbfgs/lib/arithmetic_sse_double.h +303 -0
  51. chaine/_core/liblbfgs/lib/arithmetic_sse_float.h +312 -0
  52. chaine/_core/liblbfgs/lib/lbfgs.c +1531 -0
  53. chaine/_core/tagger_wrapper.hpp +58 -0
  54. chaine/_core/trainer_wrapper.cpp +32 -0
  55. chaine/_core/trainer_wrapper.hpp +26 -0
  56. chaine/crf.py +505 -0
  57. chaine/logging.py +214 -0
  58. chaine/optimization/__init__.py +10 -0
  59. chaine/optimization/metrics.py +129 -0
  60. chaine/optimization/spaces.py +394 -0
  61. chaine/optimization/trial.py +103 -0
  62. chaine/optimization/utils.py +119 -0
  63. chaine/training.py +184 -0
  64. chaine/typing.py +18 -0
  65. chaine/validation.py +43 -0
  66. chaine-3.13.1.dist-info/METADATA +348 -0
  67. chaine-3.13.1.dist-info/RECORD +70 -0
  68. chaine-3.13.1.dist-info/WHEEL +4 -0
  69. chaine.libs/libgcc_s-1257a076.so.1 +0 -0
  70. chaine.libs/libstdc++-0530927c.so.6.0.32 +0 -0
@@ -0,0 +1,142 @@
1
+ /*
2
+ * ANSI C implementation of vector operations.
3
+ *
4
+ * Copyright (c) 2007-2010 Naoaki Okazaki
5
+ * All rights reserved.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ */
25
+
26
+ /* $Id$ */
27
+
28
+ #include <stdlib.h>
29
+ #include <memory.h>
30
+
31
+ #if LBFGS_FLOAT == 32 && LBFGS_IEEE_FLOAT
32
+ #define fsigndiff(x, y) (((*(uint32_t *)(x)) ^ (*(uint32_t *)(y))) & 0x80000000U)
33
+ #else
34
+ #define fsigndiff(x, y) (*(x) * (*(y) / fabs(*(y))) < 0.)
35
+ #endif /*LBFGS_IEEE_FLOAT*/
36
+
37
+ inline static void *vecalloc(size_t size)
38
+ {
39
+ void *memblock = malloc(size);
40
+ if (memblock)
41
+ {
42
+ memset(memblock, 0, size);
43
+ }
44
+ return memblock;
45
+ }
46
+
47
+ inline static void vecfree(void *memblock)
48
+ {
49
+ free(memblock);
50
+ }
51
+
52
+ inline static void vecset(lbfgsfloatval_t *x, const lbfgsfloatval_t c, const int n)
53
+ {
54
+ int i;
55
+
56
+ for (i = 0; i < n; ++i)
57
+ {
58
+ x[i] = c;
59
+ }
60
+ }
61
+
62
+ inline static void veccpy(lbfgsfloatval_t *y, const lbfgsfloatval_t *x, const int n)
63
+ {
64
+ int i;
65
+
66
+ for (i = 0; i < n; ++i)
67
+ {
68
+ y[i] = x[i];
69
+ }
70
+ }
71
+
72
+ inline static void vecncpy(lbfgsfloatval_t *y, const lbfgsfloatval_t *x, const int n)
73
+ {
74
+ int i;
75
+
76
+ for (i = 0; i < n; ++i)
77
+ {
78
+ y[i] = -x[i];
79
+ }
80
+ }
81
+
82
+ inline static void vecadd(lbfgsfloatval_t *y, const lbfgsfloatval_t *x, const lbfgsfloatval_t c, const int n)
83
+ {
84
+ int i;
85
+
86
+ for (i = 0; i < n; ++i)
87
+ {
88
+ y[i] += c * x[i];
89
+ }
90
+ }
91
+
92
+ inline static void vecdiff(lbfgsfloatval_t *z, const lbfgsfloatval_t *x, const lbfgsfloatval_t *y, const int n)
93
+ {
94
+ int i;
95
+
96
+ for (i = 0; i < n; ++i)
97
+ {
98
+ z[i] = x[i] - y[i];
99
+ }
100
+ }
101
+
102
+ inline static void vecscale(lbfgsfloatval_t *y, const lbfgsfloatval_t c, const int n)
103
+ {
104
+ int i;
105
+
106
+ for (i = 0; i < n; ++i)
107
+ {
108
+ y[i] *= c;
109
+ }
110
+ }
111
+
112
+ inline static void vecmul(lbfgsfloatval_t *y, const lbfgsfloatval_t *x, const int n)
113
+ {
114
+ int i;
115
+
116
+ for (i = 0; i < n; ++i)
117
+ {
118
+ y[i] *= x[i];
119
+ }
120
+ }
121
+
122
+ inline static void vecdot(lbfgsfloatval_t *s, const lbfgsfloatval_t *x, const lbfgsfloatval_t *y, const int n)
123
+ {
124
+ int i;
125
+ *s = 0.;
126
+ for (i = 0; i < n; ++i)
127
+ {
128
+ *s += x[i] * y[i];
129
+ }
130
+ }
131
+
132
+ inline static void vec2norm(lbfgsfloatval_t *s, const lbfgsfloatval_t *x, const int n)
133
+ {
134
+ vecdot(s, x, x, n);
135
+ *s = (lbfgsfloatval_t)sqrt(*s);
136
+ }
137
+
138
+ inline static void vec2norminv(lbfgsfloatval_t *s, const lbfgsfloatval_t *x, const int n)
139
+ {
140
+ vec2norm(s, x, n);
141
+ *s = (lbfgsfloatval_t)(1.0 / *s);
142
+ }
@@ -0,0 +1,303 @@
1
+ /*
2
+ * SSE2 implementation of vector oprations (64bit double).
3
+ *
4
+ * Copyright (c) 2007-2010 Naoaki Okazaki
5
+ * All rights reserved.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ */
25
+
26
+ /* $Id$ */
27
+
28
+ #include <stdlib.h>
29
+ #ifndef __APPLE__
30
+ #include <malloc.h>
31
+ #endif
32
+ #include <memory.h>
33
+
34
+ #if 1400 <= _MSC_VER
35
+ #include <intrin.h>
36
+ #endif /*1400 <= _MSC_VER*/
37
+
38
+ #if HAVE_EMMINTRIN_H
39
+ #include <emmintrin.h>
40
+ #endif /*HAVE_EMMINTRIN_H*/
41
+
42
+ inline static void *vecalloc(size_t size)
43
+ {
44
+ #if defined(_MSC_VER)
45
+ void *memblock = _aligned_malloc(size, 16);
46
+ #elif defined(__APPLE__) /* OS X always aligns on 16-byte boundaries */
47
+ void *memblock = malloc(size);
48
+ #else
49
+ void *memblock = NULL, *p = NULL;
50
+ if (posix_memalign(&p, 16, size) == 0)
51
+ {
52
+ memblock = p;
53
+ }
54
+ #endif
55
+ if (memblock != NULL)
56
+ {
57
+ memset(memblock, 0, size);
58
+ }
59
+ return memblock;
60
+ }
61
+
62
+ inline static void vecfree(void *memblock)
63
+ {
64
+ #ifdef _MSC_VER
65
+ _aligned_free(memblock);
66
+ #else
67
+ free(memblock);
68
+ #endif
69
+ }
70
+
71
+ #define fsigndiff(x, y) \
72
+ ((_mm_movemask_pd(_mm_set_pd(*(x), *(y))) + 1) & 0x002)
73
+
74
+ #define vecset(x, c, n) \
75
+ { \
76
+ int i; \
77
+ __m128d XMM0 = _mm_set1_pd(c); \
78
+ for (i = 0; i < (n); i += 8) \
79
+ { \
80
+ _mm_store_pd((x) + i, XMM0); \
81
+ _mm_store_pd((x) + i + 2, XMM0); \
82
+ _mm_store_pd((x) + i + 4, XMM0); \
83
+ _mm_store_pd((x) + i + 6, XMM0); \
84
+ } \
85
+ }
86
+
87
+ #define veccpy(y, x, n) \
88
+ { \
89
+ int i; \
90
+ for (i = 0; i < (n); i += 8) \
91
+ { \
92
+ __m128d XMM0 = _mm_load_pd((x) + i); \
93
+ __m128d XMM1 = _mm_load_pd((x) + i + 2); \
94
+ __m128d XMM2 = _mm_load_pd((x) + i + 4); \
95
+ __m128d XMM3 = _mm_load_pd((x) + i + 6); \
96
+ _mm_store_pd((y) + i, XMM0); \
97
+ _mm_store_pd((y) + i + 2, XMM1); \
98
+ _mm_store_pd((y) + i + 4, XMM2); \
99
+ _mm_store_pd((y) + i + 6, XMM3); \
100
+ } \
101
+ }
102
+
103
+ #define vecncpy(y, x, n) \
104
+ { \
105
+ int i; \
106
+ for (i = 0; i < (n); i += 8) \
107
+ { \
108
+ __m128d XMM0 = _mm_setzero_pd(); \
109
+ __m128d XMM1 = _mm_setzero_pd(); \
110
+ __m128d XMM2 = _mm_setzero_pd(); \
111
+ __m128d XMM3 = _mm_setzero_pd(); \
112
+ __m128d XMM4 = _mm_load_pd((x) + i); \
113
+ __m128d XMM5 = _mm_load_pd((x) + i + 2); \
114
+ __m128d XMM6 = _mm_load_pd((x) + i + 4); \
115
+ __m128d XMM7 = _mm_load_pd((x) + i + 6); \
116
+ XMM0 = _mm_sub_pd(XMM0, XMM4); \
117
+ XMM1 = _mm_sub_pd(XMM1, XMM5); \
118
+ XMM2 = _mm_sub_pd(XMM2, XMM6); \
119
+ XMM3 = _mm_sub_pd(XMM3, XMM7); \
120
+ _mm_store_pd((y) + i, XMM0); \
121
+ _mm_store_pd((y) + i + 2, XMM1); \
122
+ _mm_store_pd((y) + i + 4, XMM2); \
123
+ _mm_store_pd((y) + i + 6, XMM3); \
124
+ } \
125
+ }
126
+
127
+ #define vecadd(y, x, c, n) \
128
+ { \
129
+ int i; \
130
+ __m128d XMM7 = _mm_set1_pd(c); \
131
+ for (i = 0; i < (n); i += 4) \
132
+ { \
133
+ __m128d XMM0 = _mm_load_pd((x) + i); \
134
+ __m128d XMM1 = _mm_load_pd((x) + i + 2); \
135
+ __m128d XMM2 = _mm_load_pd((y) + i); \
136
+ __m128d XMM3 = _mm_load_pd((y) + i + 2); \
137
+ XMM0 = _mm_mul_pd(XMM0, XMM7); \
138
+ XMM1 = _mm_mul_pd(XMM1, XMM7); \
139
+ XMM2 = _mm_add_pd(XMM2, XMM0); \
140
+ XMM3 = _mm_add_pd(XMM3, XMM1); \
141
+ _mm_store_pd((y) + i, XMM2); \
142
+ _mm_store_pd((y) + i + 2, XMM3); \
143
+ } \
144
+ }
145
+
146
+ #define vecdiff(z, x, y, n) \
147
+ { \
148
+ int i; \
149
+ for (i = 0; i < (n); i += 8) \
150
+ { \
151
+ __m128d XMM0 = _mm_load_pd((x) + i); \
152
+ __m128d XMM1 = _mm_load_pd((x) + i + 2); \
153
+ __m128d XMM2 = _mm_load_pd((x) + i + 4); \
154
+ __m128d XMM3 = _mm_load_pd((x) + i + 6); \
155
+ __m128d XMM4 = _mm_load_pd((y) + i); \
156
+ __m128d XMM5 = _mm_load_pd((y) + i + 2); \
157
+ __m128d XMM6 = _mm_load_pd((y) + i + 4); \
158
+ __m128d XMM7 = _mm_load_pd((y) + i + 6); \
159
+ XMM0 = _mm_sub_pd(XMM0, XMM4); \
160
+ XMM1 = _mm_sub_pd(XMM1, XMM5); \
161
+ XMM2 = _mm_sub_pd(XMM2, XMM6); \
162
+ XMM3 = _mm_sub_pd(XMM3, XMM7); \
163
+ _mm_store_pd((z) + i, XMM0); \
164
+ _mm_store_pd((z) + i + 2, XMM1); \
165
+ _mm_store_pd((z) + i + 4, XMM2); \
166
+ _mm_store_pd((z) + i + 6, XMM3); \
167
+ } \
168
+ }
169
+
170
+ #define vecscale(y, c, n) \
171
+ { \
172
+ int i; \
173
+ __m128d XMM7 = _mm_set1_pd(c); \
174
+ for (i = 0; i < (n); i += 4) \
175
+ { \
176
+ __m128d XMM0 = _mm_load_pd((y) + i); \
177
+ __m128d XMM1 = _mm_load_pd((y) + i + 2); \
178
+ XMM0 = _mm_mul_pd(XMM0, XMM7); \
179
+ XMM1 = _mm_mul_pd(XMM1, XMM7); \
180
+ _mm_store_pd((y) + i, XMM0); \
181
+ _mm_store_pd((y) + i + 2, XMM1); \
182
+ } \
183
+ }
184
+
185
+ #define vecmul(y, x, n) \
186
+ { \
187
+ int i; \
188
+ for (i = 0; i < (n); i += 8) \
189
+ { \
190
+ __m128d XMM0 = _mm_load_pd((x) + i); \
191
+ __m128d XMM1 = _mm_load_pd((x) + i + 2); \
192
+ __m128d XMM2 = _mm_load_pd((x) + i + 4); \
193
+ __m128d XMM3 = _mm_load_pd((x) + i + 6); \
194
+ __m128d XMM4 = _mm_load_pd((y) + i); \
195
+ __m128d XMM5 = _mm_load_pd((y) + i + 2); \
196
+ __m128d XMM6 = _mm_load_pd((y) + i + 4); \
197
+ __m128d XMM7 = _mm_load_pd((y) + i + 6); \
198
+ XMM4 = _mm_mul_pd(XMM4, XMM0); \
199
+ XMM5 = _mm_mul_pd(XMM5, XMM1); \
200
+ XMM6 = _mm_mul_pd(XMM6, XMM2); \
201
+ XMM7 = _mm_mul_pd(XMM7, XMM3); \
202
+ _mm_store_pd((y) + i, XMM4); \
203
+ _mm_store_pd((y) + i + 2, XMM5); \
204
+ _mm_store_pd((y) + i + 4, XMM6); \
205
+ _mm_store_pd((y) + i + 6, XMM7); \
206
+ } \
207
+ }
208
+
209
+ #if 3 <= __SSE__ || defined(__SSE3__)
210
+ /*
211
+ Horizontal add with haddps SSE3 instruction. The work register (rw)
212
+ is unused.
213
+ */
214
+ #define __horizontal_sum(r, rw) \
215
+ r = _mm_hadd_ps(r, r); \
216
+ r = _mm_hadd_ps(r, r);
217
+
218
+ #else
219
+ /*
220
+ Horizontal add with SSE instruction. The work register (rw) is used.
221
+ */
222
+ #define __horizontal_sum(r, rw) \
223
+ rw = r; \
224
+ r = _mm_shuffle_ps(r, rw, _MM_SHUFFLE(1, 0, 3, 2)); \
225
+ r = _mm_add_ps(r, rw); \
226
+ rw = r; \
227
+ r = _mm_shuffle_ps(r, rw, _MM_SHUFFLE(2, 3, 0, 1)); \
228
+ r = _mm_add_ps(r, rw);
229
+
230
+ #endif
231
+
232
+ #define vecdot(s, x, y, n) \
233
+ { \
234
+ int i; \
235
+ __m128d XMM0 = _mm_setzero_pd(); \
236
+ __m128d XMM1 = _mm_setzero_pd(); \
237
+ __m128d XMM2, XMM3, XMM4, XMM5; \
238
+ for (i = 0; i < (n); i += 4) \
239
+ { \
240
+ XMM2 = _mm_load_pd((x) + i); \
241
+ XMM3 = _mm_load_pd((x) + i + 2); \
242
+ XMM4 = _mm_load_pd((y) + i); \
243
+ XMM5 = _mm_load_pd((y) + i + 2); \
244
+ XMM2 = _mm_mul_pd(XMM2, XMM4); \
245
+ XMM3 = _mm_mul_pd(XMM3, XMM5); \
246
+ XMM0 = _mm_add_pd(XMM0, XMM2); \
247
+ XMM1 = _mm_add_pd(XMM1, XMM3); \
248
+ } \
249
+ XMM0 = _mm_add_pd(XMM0, XMM1); \
250
+ XMM1 = _mm_shuffle_pd(XMM0, XMM0, _MM_SHUFFLE2(1, 1)); \
251
+ XMM0 = _mm_add_pd(XMM0, XMM1); \
252
+ _mm_store_sd((s), XMM0); \
253
+ }
254
+
255
+ #define vec2norm(s, x, n) \
256
+ { \
257
+ int i; \
258
+ __m128d XMM0 = _mm_setzero_pd(); \
259
+ __m128d XMM1 = _mm_setzero_pd(); \
260
+ __m128d XMM2, XMM3, XMM4, XMM5; \
261
+ for (i = 0; i < (n); i += 4) \
262
+ { \
263
+ XMM2 = _mm_load_pd((x) + i); \
264
+ XMM3 = _mm_load_pd((x) + i + 2); \
265
+ XMM4 = XMM2; \
266
+ XMM5 = XMM3; \
267
+ XMM2 = _mm_mul_pd(XMM2, XMM4); \
268
+ XMM3 = _mm_mul_pd(XMM3, XMM5); \
269
+ XMM0 = _mm_add_pd(XMM0, XMM2); \
270
+ XMM1 = _mm_add_pd(XMM1, XMM3); \
271
+ } \
272
+ XMM0 = _mm_add_pd(XMM0, XMM1); \
273
+ XMM1 = _mm_shuffle_pd(XMM0, XMM0, _MM_SHUFFLE2(1, 1)); \
274
+ XMM0 = _mm_add_pd(XMM0, XMM1); \
275
+ XMM0 = _mm_sqrt_pd(XMM0); \
276
+ _mm_store_sd((s), XMM0); \
277
+ }
278
+
279
+ #define vec2norminv(s, x, n) \
280
+ { \
281
+ int i; \
282
+ __m128d XMM0 = _mm_setzero_pd(); \
283
+ __m128d XMM1 = _mm_setzero_pd(); \
284
+ __m128d XMM2, XMM3, XMM4, XMM5; \
285
+ for (i = 0; i < (n); i += 4) \
286
+ { \
287
+ XMM2 = _mm_load_pd((x) + i); \
288
+ XMM3 = _mm_load_pd((x) + i + 2); \
289
+ XMM4 = XMM2; \
290
+ XMM5 = XMM3; \
291
+ XMM2 = _mm_mul_pd(XMM2, XMM4); \
292
+ XMM3 = _mm_mul_pd(XMM3, XMM5); \
293
+ XMM0 = _mm_add_pd(XMM0, XMM2); \
294
+ XMM1 = _mm_add_pd(XMM1, XMM3); \
295
+ } \
296
+ XMM2 = _mm_set1_pd(1.0); \
297
+ XMM0 = _mm_add_pd(XMM0, XMM1); \
298
+ XMM1 = _mm_shuffle_pd(XMM0, XMM0, _MM_SHUFFLE2(1, 1)); \
299
+ XMM0 = _mm_add_pd(XMM0, XMM1); \
300
+ XMM0 = _mm_sqrt_pd(XMM0); \
301
+ XMM2 = _mm_div_pd(XMM2, XMM0); \
302
+ _mm_store_sd((s), XMM2); \
303
+ }