react-native-executorch 0.10.6 → 0.10.7

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.
Files changed (237) hide show
  1. package/lib/module/fetcher/telemetry.js +1 -1
  2. package/package.json +1 -1
  3. package/react-native-executorch.podspec +2 -0
  4. package/src/fetcher/telemetry.ts +1 -1
  5. package/third-party/common/phonemis/CMakeLists.txt +70 -14
  6. package/third-party/common/phonemis/README.md +183 -33
  7. package/third-party/common/phonemis/THIRD_PARTY_NOTICES.md +57 -0
  8. package/third-party/common/phonemis/knowledge/code_style.md +642 -0
  9. package/third-party/common/phonemis/licenses/Unicode-3.0.txt +39 -0
  10. package/third-party/common/phonemis/licenses/misaki-Apache-2.0.txt +201 -0
  11. package/third-party/common/phonemis/licenses/nlohmann-json-MIT.txt +21 -0
  12. package/third-party/common/phonemis/licenses/xsimd-BSD-3-Clause.txt +29 -0
  13. package/third-party/common/phonemis/src/phonemis/base/config.h +6 -0
  14. package/third-party/common/phonemis/src/phonemis/base/ipipeline.cpp +75 -0
  15. package/third-party/common/phonemis/src/phonemis/base/ipipeline.h +21 -0
  16. package/third-party/common/phonemis/src/phonemis/base/phonemizer/constants.h +2 -5
  17. package/third-party/common/phonemis/src/phonemis/base/phonemizer/lexicon_phonemizer.cpp +3 -4
  18. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.cpp +17 -8
  19. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.h +4 -0
  20. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.cpp +21 -6
  21. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.h +13 -4
  22. package/third-party/common/phonemis/src/phonemis/base/pipeline.cpp +8 -0
  23. package/third-party/common/phonemis/src/phonemis/base/pipeline.h +19 -0
  24. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.cpp +37 -0
  25. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.h +45 -0
  26. package/third-party/common/phonemis/src/phonemis/base/processor/common/constants.h +10 -0
  27. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.cpp +105 -0
  28. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.h +49 -0
  29. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.cpp +173 -0
  30. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.h +67 -0
  31. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.cpp +75 -0
  32. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.h +60 -0
  33. package/third-party/common/phonemis/src/phonemis/base/processor/common/types.h +18 -0
  34. package/third-party/common/phonemis/src/phonemis/base/processor/config.h +53 -0
  35. package/third-party/common/phonemis/src/phonemis/base/processor/layer.h +9 -7
  36. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/constants.h +20 -0
  37. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.cpp +89 -0
  38. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.h +35 -0
  39. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/types.h +16 -0
  40. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/kind.h +40 -0
  41. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/layer.h +382 -0
  42. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/notation.h +30 -0
  43. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.cpp +51 -0
  44. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.h +31 -0
  45. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern.h +30 -0
  46. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.cpp +17 -0
  47. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.h +31 -0
  48. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.cpp +811 -0
  49. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.h +285 -0
  50. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.cpp +64 -0
  51. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.h +23 -0
  52. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/types.h +94 -0
  53. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sanitizer/layer.cpp +19 -0
  54. package/third-party/common/phonemis/src/phonemis/base/processor/{sanitizer_layer.h → layers/sanitizer/layer.h} +8 -8
  55. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.cpp +65 -0
  56. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.h +29 -0
  57. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.cpp +170 -0
  58. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.h +40 -0
  59. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/types.h +25 -0
  60. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.cpp +47 -0
  61. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.h +19 -0
  62. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.cpp +60 -0
  63. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.h +45 -0
  64. package/third-party/common/phonemis/src/phonemis/base/processor/processor.cpp +6 -7
  65. package/third-party/common/phonemis/src/phonemis/base/processor/processor.h +14 -10
  66. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.cpp +89 -52
  67. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.h +16 -9
  68. package/third-party/common/phonemis/src/phonemis/base/tokenizer/tokenizer.cpp +13 -12
  69. package/third-party/common/phonemis/src/phonemis/lang/de/constants.h +183 -19
  70. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.cpp +355 -309
  71. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.h +42 -17
  72. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.cpp +56 -0
  73. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.h +15 -0
  74. package/third-party/common/phonemis/src/phonemis/lang/de/pipeline.h +3 -3
  75. package/third-party/common/phonemis/src/phonemis/lang/en/constants.h +181 -30
  76. package/third-party/common/phonemis/src/phonemis/lang/en/hmm_tagger.cpp +5 -7
  77. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.cpp +232 -135
  78. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.h +41 -16
  79. package/third-party/common/phonemis/src/phonemis/lang/en/pipeline.h +3 -10
  80. package/third-party/common/phonemis/src/phonemis/lang/es/constants.h +182 -60
  81. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.cpp +247 -212
  82. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.h +38 -18
  83. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.cpp +50 -0
  84. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.h +15 -0
  85. package/third-party/common/phonemis/src/phonemis/lang/es/pipeline.h +3 -3
  86. package/third-party/common/phonemis/src/phonemis/lang/fr/constants.h +152 -26
  87. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.cpp +252 -179
  88. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.h +38 -15
  89. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.cpp +83 -0
  90. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.h +15 -0
  91. package/third-party/common/phonemis/src/phonemis/lang/fr/pipeline.h +3 -3
  92. package/third-party/common/phonemis/src/phonemis/lang/hi/constants.h +62 -10
  93. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.cpp +74 -123
  94. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.h +27 -16
  95. package/third-party/common/phonemis/src/phonemis/lang/hi/pipeline.h +5 -3
  96. package/third-party/common/phonemis/src/phonemis/lang/it/constants.h +122 -42
  97. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.cpp +200 -207
  98. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.h +30 -18
  99. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.cpp +25 -0
  100. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.h +15 -0
  101. package/third-party/common/phonemis/src/phonemis/lang/it/pipeline.h +3 -3
  102. package/third-party/common/phonemis/src/phonemis/lang/pl/constants.h +346 -77
  103. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.cpp +631 -246
  104. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.h +47 -15
  105. package/third-party/common/phonemis/src/phonemis/lang/pl/pipeline.h +6 -6
  106. package/third-party/common/phonemis/src/phonemis/lang/pt/constants.h +201 -0
  107. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.cpp +365 -0
  108. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.h +53 -0
  109. package/third-party/common/phonemis/src/phonemis/lang/pt/pipeline.h +4 -2
  110. package/third-party/common/phonemis/src/phonemis/main.cpp +42 -11
  111. package/third-party/common/phonemis/src/phonemis/protophone/meta.h +24 -0
  112. package/third-party/common/phonemis/src/phonemis/protophone/numeric.h +26 -0
  113. package/third-party/common/phonemis/src/phonemis/protophone/protophone.cpp +525 -0
  114. package/third-party/common/phonemis/src/phonemis/protophone/protophone.h +80 -0
  115. package/third-party/common/phonemis/src/phonemis/protophone/tensor.h +76 -0
  116. package/third-party/common/phonemis/src/phonemis/protophone/tensor_utils.h +89 -0
  117. package/third-party/common/phonemis/src/phonemis/protophone/tensor_view.h +125 -0
  118. package/third-party/common/phonemis/src/phonemis/protophone/types.h +43 -0
  119. package/third-party/common/phonemis/src/phonemis/utils/strings.h +20 -14
  120. package/third-party/common/phonemis/src/phonemis/utils/unicode.h +15 -1
  121. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
  122. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_bit.hpp +232 -0
  123. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
  124. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
  125. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_details.hpp +386 -0
  126. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
  127. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
  128. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
  129. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
  130. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
  131. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
  132. package/third-party/common/phonemis/src/third-party/xsimd/arch/utils/shifts.hpp +82 -0
  133. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx.hpp +2111 -0
  134. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2.hpp +1591 -0
  135. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2_128.hpp +170 -0
  136. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512bw.hpp +724 -0
  137. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512cd.hpp +28 -0
  138. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512dq.hpp +270 -0
  139. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512er.hpp +17 -0
  140. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512f.hpp +2919 -0
  141. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
  142. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512pf.hpp +17 -0
  143. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
  144. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
  145. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
  146. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
  147. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx_128.hpp +164 -0
  148. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avxvnni.hpp +17 -0
  149. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common.hpp +26 -0
  150. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common_fwd.hpp +127 -0
  151. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_constants.hpp +393 -0
  152. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_emulated.hpp +787 -0
  153. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
  154. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
  155. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
  156. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma4.hpp +92 -0
  157. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
  158. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_isa.hpp +148 -0
  159. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon.hpp +3580 -0
  160. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon64.hpp +1614 -0
  161. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_rvv.hpp +1515 -0
  162. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_scalar.hpp +1210 -0
  163. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse2.hpp +2333 -0
  164. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse3.hpp +66 -0
  165. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_1.hpp +510 -0
  166. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_2.hpp +44 -0
  167. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_ssse3.hpp +186 -0
  168. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sve.hpp +1186 -0
  169. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vsx.hpp +947 -0
  170. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vxe.hpp +787 -0
  171. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_wasm.hpp +1819 -0
  172. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_arch.hpp +242 -0
  173. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_config.hpp +633 -0
  174. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features.hpp +50 -0
  175. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
  176. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
  177. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
  178. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
  179. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_x86.hpp +1121 -0
  180. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpuid.hpp +144 -0
  181. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_getauxval.hpp +159 -0
  182. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_macros.hpp +78 -0
  183. package/third-party/common/phonemis/src/third-party/xsimd/math/xsimd_rem_pio2.hpp +707 -0
  184. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
  185. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_alignment.hpp +102 -0
  186. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_all_registers.hpp +57 -0
  187. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_api.hpp +3106 -0
  188. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx2_register.hpp +57 -0
  189. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
  190. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
  191. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
  192. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512er_register.hpp +51 -0
  193. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512f_register.hpp +77 -0
  194. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
  195. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
  196. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
  197. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
  198. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
  199. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
  200. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx_register.hpp +79 -0
  201. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
  202. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch.hpp +1666 -0
  203. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_constant.hpp +572 -0
  204. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_fwd.hpp +41 -0
  205. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_common_arch.hpp +49 -0
  206. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_emulated_register.hpp +80 -0
  207. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
  208. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
  209. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
  210. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma4_register.hpp +50 -0
  211. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
  212. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon64_register.hpp +55 -0
  213. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon_register.hpp +130 -0
  214. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_register.hpp +96 -0
  215. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_rvv_register.hpp +491 -0
  216. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse2_register.hpp +59 -0
  217. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse3_register.hpp +49 -0
  218. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
  219. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
  220. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_ssse3_register.hpp +48 -0
  221. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sve_register.hpp +216 -0
  222. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_traits.hpp +409 -0
  223. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_utils.hpp +462 -0
  224. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vsx_register.hpp +84 -0
  225. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vxe_register.hpp +86 -0
  226. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_wasm_register.hpp +59 -0
  227. package/third-party/common/phonemis/src/third-party/xsimd/utils/bits.hpp +122 -0
  228. package/third-party/common/phonemis/src/third-party/xsimd/utils/xsimd_type_traits.hpp +145 -0
  229. package/third-party/common/phonemis/src/third-party/xsimd/xsimd.hpp +43 -0
  230. package/third-party/common/phonemis/src/phonemis/base/processor/constants.h +0 -11
  231. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/config.h +0 -16
  232. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.cpp +0 -271
  233. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.h +0 -45
  234. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/types.h +0 -29
  235. package/third-party/common/phonemis/src/phonemis/base/processor/sanitizer_layer.cpp +0 -22
  236. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.cpp +0 -40
  237. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.h +0 -22
@@ -0,0 +1,996 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_COMMON_TRIGO_HPP
13
+ #define XSIMD_COMMON_TRIGO_HPP
14
+
15
+ #include "./xsimd_common_details.hpp"
16
+
17
+ #include <array>
18
+
19
+ namespace xsimd
20
+ {
21
+
22
+ namespace kernel
23
+ {
24
+ /* origin: boost/simd/arch/common/detail/simd/trig_base.hpp */
25
+ /*
26
+ * ====================================================
27
+ * copyright 2016 NumScale SAS
28
+ *
29
+ * Distributed under the Boost Software License, Version 1.0.
30
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
31
+ * ====================================================
32
+ */
33
+
34
+ using namespace types;
35
+
36
+ // acos
37
+ template <class A, class T>
38
+ XSIMD_INLINE batch<T, A> acos(batch<T, A> const& self, requires_arch<common>) noexcept
39
+ {
40
+ using batch_type = batch<T, A>;
41
+ batch_type x = abs(self);
42
+ auto x_larger_05 = x > batch_type(0.5);
43
+ x = select(x_larger_05, sqrt(fma(batch_type(-0.5), x, batch_type(0.5))), self);
44
+ x = asin(x);
45
+ x = select(x_larger_05, x + x, x);
46
+ x = select(self < batch_type(-0.5), constants::pi<batch_type>() - x, x);
47
+ return select(x_larger_05, x, constants::pio2<batch_type>() - x);
48
+ }
49
+ template <class A, class T>
50
+ XSIMD_INLINE batch<std::complex<T>, A> acos(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
51
+ {
52
+ using batch_type = batch<std::complex<T>, A>;
53
+ using real_batch = typename batch_type::real_batch;
54
+ batch_type tmp = asin(z);
55
+ return { constants::pio2<real_batch>() - tmp.real(), -tmp.imag() };
56
+ }
57
+
58
+ // acosh
59
+ /* origin: boost/simd/arch/common/simd/function/acosh.hpp */
60
+ /*
61
+ * ====================================================
62
+ * copyright 2016 NumScale SAS
63
+ *
64
+ * Distributed under the Boost Software License, Version 1.0.
65
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
66
+ * ====================================================
67
+ */
68
+ template <class A, class T>
69
+ XSIMD_INLINE batch<T, A> acosh(batch<T, A> const& self, requires_arch<common>) noexcept
70
+ {
71
+ using batch_type = batch<T, A>;
72
+ batch_type x = self - batch_type(1.);
73
+ auto test = x > constants::oneotwoeps<batch_type>();
74
+ batch_type z = select(test, self, x + sqrt(x + x + x * x));
75
+ batch_type l1pz = log1p(z);
76
+ return select(test, l1pz + constants::log_2<batch_type>(), l1pz);
77
+ }
78
+ template <class A, class T>
79
+ XSIMD_INLINE batch<std::complex<T>, A> acosh(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
80
+ {
81
+ using batch_type = batch<std::complex<T>, A>;
82
+ batch_type w = acos(z);
83
+ w = batch_type(-w.imag(), w.real());
84
+ return w;
85
+ }
86
+
87
+ // asin
88
+ template <class A>
89
+ XSIMD_INLINE batch<float, A> asin(batch<float, A> const& self, requires_arch<common>) noexcept
90
+ {
91
+ using batch_type = batch<float, A>;
92
+ batch_type x = abs(self);
93
+ batch_type sign = bitofsign(self);
94
+ auto x_larger_05 = x > batch_type(0.5);
95
+ batch_type z = select(x_larger_05, batch_type(0.5) * (batch_type(1.) - x), x * x);
96
+ x = select(x_larger_05, sqrt(z), x);
97
+ batch_type z1 = detail::horner<batch_type,
98
+ 0x3e2aaae4,
99
+ 0x3d9980f6,
100
+ 0x3d3a3ec7,
101
+ 0x3cc617e3,
102
+ 0x3d2cb352>(z);
103
+ z1 = fma(z1, z * x, x);
104
+ z = select(x_larger_05, constants::pio2<batch_type>() - (z1 + z1), z1);
105
+ return z ^ sign;
106
+ }
107
+ template <class A>
108
+ XSIMD_INLINE batch<double, A> asin(batch<double, A> const& self, requires_arch<common>) noexcept
109
+ {
110
+ using batch_type = batch<double, A>;
111
+ batch_type x = abs(self);
112
+ auto small_cond = x < constants::sqrteps<batch_type>();
113
+ batch_type ct1 = batch_type(bit_cast<double>(int64_t(0x3fe4000000000000)));
114
+ batch_type zz1 = batch_type(1.) - x;
115
+ batch_type vp = zz1 * detail::horner<batch_type, 0x403c896240f3081dull, 0xc03991aaac01ab68ull, 0x401bdff5baf33e6aull, 0xbfe2079259f9290full, 0x3f684fc3988e9f08ull>(zz1) / detail::horner1<batch_type, 0x40756709b0b644beull, 0xc077fe08959063eeull, 0x40626219af6a7f42ull, 0xc035f2a2b6bf5d8cull>(zz1);
116
+ zz1 = sqrt(zz1 + zz1);
117
+ batch_type z = constants::pio4<batch_type>() - zz1;
118
+ zz1 = fms(zz1, vp, constants::pio_2lo<batch_type>());
119
+ z = z - zz1;
120
+ zz1 = z + constants::pio4<batch_type>();
121
+ batch_type zz2 = self * self;
122
+ z = zz2 * detail::horner<batch_type, 0xc020656c06ceafd5ull, 0x40339007da779259ull, 0xc0304331de27907bull, 0x4015c74b178a2dd9ull, 0xbfe34341333e5c16ull, 0x3f716b9b0bd48ad3ull>(zz2) / detail::horner1<batch_type, 0xc04898220a3607acull, 0x4061705684ffbf9dull, 0xc06265bb6d3576d7ull, 0x40519fc025fe9054ull, 0xc02d7b590b5e0eabull>(zz2);
123
+ zz2 = fma(x, z, x);
124
+ return select(x > batch_type(1.), constants::nan<batch_type>(),
125
+ select(small_cond, x,
126
+ select(x > ct1, zz1, zz2))
127
+ ^ bitofsign(self));
128
+ }
129
+ template <class A, class T>
130
+ XSIMD_INLINE batch<std::complex<T>, A> asin(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
131
+ {
132
+ using batch_type = batch<std::complex<T>, A>;
133
+ using real_batch = typename batch_type::real_batch;
134
+ real_batch x = z.real();
135
+ real_batch y = z.imag();
136
+
137
+ batch_type ct(-y, x);
138
+ batch_type zz(real_batch(1.) - (x - y) * (x + y), -2 * x * y);
139
+ zz = log(ct + sqrt(zz));
140
+ batch_type resg(zz.imag(), -zz.real());
141
+
142
+ return select(y == real_batch(0.),
143
+ select(fabs(x) > real_batch(1.),
144
+ batch_type(constants::pio2<real_batch>(), real_batch(0.)),
145
+ batch_type(asin(x), real_batch(0.))),
146
+ resg);
147
+ }
148
+
149
+ // asinh
150
+ /* origin: boost/simd/arch/common/simd/function/asinh.hpp */
151
+ /*
152
+ * ====================================================
153
+ * copyright 2016 NumScale SAS
154
+ *
155
+ * Distributed under the Boost Software License, Version 1.0.
156
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
157
+ * ====================================================
158
+ */
159
+ namespace detail
160
+ {
161
+ template <class A, class T, class = std::enable_if_t<std::is_integral<T>::value>>
162
+ XSIMD_INLINE batch<T, A>
163
+ average(const batch<T, A>& x1, const batch<T, A>& x2) noexcept
164
+ {
165
+ return (x1 & x2) + ((x1 ^ x2) >> 1);
166
+ }
167
+
168
+ template <class A, class T>
169
+ XSIMD_INLINE batch<T, A>
170
+ averagef(const batch<T, A>& x1, const batch<T, A>& x2) noexcept
171
+ {
172
+ using batch_type = batch<T, A>;
173
+ return fma(x1, batch_type(0.5), x2 * batch_type(0.5));
174
+ }
175
+ template <class A>
176
+ XSIMD_INLINE batch<float, A> average(batch<float, A> const& x1, batch<float, A> const& x2) noexcept
177
+ {
178
+ return averagef(x1, x2);
179
+ }
180
+ template <class A>
181
+ XSIMD_INLINE batch<double, A> average(batch<double, A> const& x1, batch<double, A> const& x2) noexcept
182
+ {
183
+ return averagef(x1, x2);
184
+ }
185
+ }
186
+ template <class A>
187
+ XSIMD_INLINE batch<float, A> asinh(batch<float, A> const& self, requires_arch<common>) noexcept
188
+ {
189
+ using batch_type = batch<float, A>;
190
+ batch_type x = abs(self);
191
+ auto lthalf = x < batch_type(0.5);
192
+ batch_type x2 = x * x;
193
+ batch_type bts = bitofsign(self);
194
+ batch_type z(0.);
195
+ if (any(lthalf))
196
+ {
197
+ z = detail::horner<batch_type,
198
+ 0x3f800000,
199
+ 0xbe2aa9ad,
200
+ 0x3d9949b1,
201
+ 0xbd2ee581,
202
+ 0x3ca4d6e6>(x2)
203
+ * x;
204
+ if (all(lthalf))
205
+ return z ^ bts;
206
+ }
207
+ batch_type tmp = select(x > constants::oneosqrteps<batch_type>(), x, detail::average(x, hypot(batch_type(1.), x)));
208
+ #ifndef XSIMD_NO_NANS
209
+ return select(isnan(self), constants::nan<batch_type>(), select(lthalf, z, log(tmp) + constants::log_2<batch_type>()) ^ bts);
210
+ #else
211
+ return select(lthalf, z, log(tmp) + constants::log_2<batch_type>()) ^ bts;
212
+ #endif
213
+ }
214
+ template <class A>
215
+ XSIMD_INLINE batch<double, A> asinh(batch<double, A> const& self, requires_arch<common>) noexcept
216
+ {
217
+ using batch_type = batch<double, A>;
218
+ batch_type x = abs(self);
219
+ auto test = x > constants::oneosqrteps<batch_type>();
220
+ batch_type z = select(test, x - batch_type(1.), x + x * x / (batch_type(1.) + hypot(batch_type(1.), x)));
221
+ #ifndef XSIMD_NO_INFINITIES
222
+ z = select(x == constants::infinity<batch_type>(), x, z);
223
+ #endif
224
+ batch_type l1pz = log1p(z);
225
+ z = select(test, l1pz + constants::log_2<batch_type>(), l1pz);
226
+ return bitofsign(self) ^ z;
227
+ }
228
+ template <class A, class T>
229
+ XSIMD_INLINE batch<std::complex<T>, A> asinh(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
230
+ {
231
+ using batch_type = batch<std::complex<T>, A>;
232
+ batch_type w = asin(batch_type(-z.imag(), z.real()));
233
+ w = batch_type(w.imag(), -w.real());
234
+ return w;
235
+ }
236
+
237
+ // atan
238
+ namespace detail
239
+ {
240
+ template <class A>
241
+ static XSIMD_INLINE batch<float, A> kernel_atan(const batch<float, A>& x, const batch<float, A>& recx) noexcept
242
+ {
243
+ using batch_type = batch<float, A>;
244
+ const auto flag1 = x < constants::tan3pio8<batch_type>();
245
+ const auto flag2 = (x >= batch_type(bit_cast<float>((uint32_t)0x3ed413cd))) && flag1;
246
+ batch_type yy = select(flag1, batch_type(0.), constants::pio2<batch_type>());
247
+ yy = select(flag2, constants::pio4<batch_type>(), yy);
248
+ batch_type xx = select(flag1, x, -recx);
249
+ xx = select(flag2, (x - batch_type(1.)) / (x + batch_type(1.)), xx);
250
+ const batch_type z = xx * xx;
251
+ batch_type z1 = detail::horner<batch_type,
252
+ 0xbeaaaa2aul,
253
+ 0x3e4c925ful,
254
+ 0xbe0e1b85ul,
255
+ 0x3da4f0d1ul>(z);
256
+ z1 = fma(xx, z1 * z, xx);
257
+ z1 = select(flag2, z1 + constants::pio_4lo<batch_type>(), z1);
258
+ z1 = select(!flag1, z1 + constants::pio_2lo<batch_type>(), z1);
259
+ return yy + z1;
260
+ }
261
+ template <class A>
262
+ static XSIMD_INLINE batch<double, A> kernel_atan(const batch<double, A>& x, const batch<double, A>& recx) noexcept
263
+ {
264
+ using batch_type = batch<double, A>;
265
+ const auto flag1 = x < constants::tan3pio8<batch_type>();
266
+ const auto flag2 = (x >= constants::tanpio8<batch_type>()) && flag1;
267
+ batch_type yy = select(flag1, batch_type(0.), constants::pio2<batch_type>());
268
+ yy = select(flag2, constants::pio4<batch_type>(), yy);
269
+ batch_type xx = select(flag1, x, -recx);
270
+ xx = select(flag2, (x - batch_type(1.)) / (x + batch_type(1.)), xx);
271
+ batch_type z = xx * xx;
272
+ z *= detail::horner<batch_type,
273
+ 0xc0503669fd28ec8eull,
274
+ 0xc05eb8bf2d05ba25ull,
275
+ 0xc052c08c36880273ull,
276
+ 0xc03028545b6b807aull,
277
+ 0xbfec007fa1f72594ull>(z)
278
+ / detail::horner1<batch_type,
279
+ 0x4068519efbbd62ecull,
280
+ 0x407e563f13b049eaull,
281
+ 0x407b0e18d2e2be3bull,
282
+ 0x4064a0dd43b8fa25ull,
283
+ 0x4038dbc45b14603cull>(z);
284
+ z = fma(xx, z, xx);
285
+ z = select(flag2, z + constants::pio_4lo<batch_type>(), z);
286
+ z = z + select(flag1, batch_type(0.), constants::pio_2lo<batch_type>());
287
+ return yy + z;
288
+ }
289
+ }
290
+ template <class A, class T>
291
+ XSIMD_INLINE batch<T, A> atan(batch<T, A> const& self, requires_arch<common>) noexcept
292
+ {
293
+ using batch_type = batch<T, A>;
294
+ const batch_type absa = abs(self);
295
+ const batch_type x = detail::kernel_atan(absa, batch_type(1.) / absa);
296
+ return x ^ bitofsign(self);
297
+ }
298
+ template <class A, class T>
299
+ XSIMD_INLINE batch<std::complex<T>, A> atan(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
300
+ {
301
+ using batch_type = batch<std::complex<T>, A>;
302
+ using real_batch = typename batch_type::real_batch;
303
+ real_batch x = z.real();
304
+ real_batch y = z.imag();
305
+ real_batch x2 = x * x;
306
+ real_batch one(1.);
307
+ real_batch a = one - x2 - (y * y);
308
+ real_batch w = 0.5 * atan2(2. * x, a);
309
+ real_batch num = y + one;
310
+ num = x2 + num * num;
311
+ real_batch den = y - one;
312
+ den = x2 + den * den;
313
+ #ifdef __FAST_MATH__
314
+ return batch_type(w, 0.25 * log(num / den));
315
+ #else
316
+ return select((x == real_batch(0.)) && (y == real_batch(1.)),
317
+ batch_type(real_batch(0.), constants::infinity<real_batch>()),
318
+ batch_type(w, 0.25 * log(num / den)));
319
+ #endif
320
+ }
321
+
322
+ // atanh
323
+ /* origin: boost/simd/arch/common/simd/function/acosh.hpp */
324
+ /*
325
+ * ====================================================
326
+ * copyright 2016 NumScale SAS
327
+ *
328
+ * Distributed under the Boost Software License, Version 1.0.
329
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
330
+ * ====================================================
331
+ */
332
+ template <class A, class T>
333
+ XSIMD_INLINE batch<T, A> atanh(batch<T, A> const& self, requires_arch<common>) noexcept
334
+ {
335
+ using batch_type = batch<T, A>;
336
+ batch_type x = abs(self);
337
+ batch_type t = x + x;
338
+ batch_type z = batch_type(1.) - x;
339
+ auto test = x < batch_type(0.5);
340
+ batch_type tmp = select(test, x, t) / z;
341
+ return bitofsign(self) ^ (batch_type(0.5) * log1p(select(test, fma(t, tmp, t), tmp)));
342
+ }
343
+ template <class A, class T>
344
+ XSIMD_INLINE batch<std::complex<T>, A> atanh(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
345
+ {
346
+ using batch_type = batch<std::complex<T>, A>;
347
+ batch_type w = atan(batch_type(-z.imag(), z.real()));
348
+ w = batch_type(w.imag(), -w.real());
349
+ return w;
350
+ }
351
+
352
+ // atan2
353
+ template <class A, class T>
354
+ XSIMD_INLINE batch<T, A> atan2(batch<T, A> const& self, batch<T, A> const& other, requires_arch<common>) noexcept
355
+ {
356
+ using batch_type = batch<T, A>;
357
+ #ifdef __FAST_MATH__
358
+ const batch_type q = abs(self / other);
359
+ const batch_type q_p = abs(other / self);
360
+ #else
361
+ const batch_type q = abs(self / other);
362
+ const batch_type q_p = 1. / q;
363
+ #endif
364
+ const batch_type z = detail::kernel_atan(q, q_p);
365
+ return select(other > batch_type(0.), z, constants::pi<batch_type>() - z) * signnz(self);
366
+ }
367
+
368
+ // cos
369
+ namespace detail
370
+ {
371
+ template <class T, class A>
372
+ XSIMD_INLINE batch<T, A> quadrant(const batch<T, A>& x) noexcept
373
+ {
374
+ return x & batch<T, A>(3);
375
+ }
376
+
377
+ template <class A>
378
+ XSIMD_INLINE batch<float, A> quadrant(const batch<float, A>& x) noexcept
379
+ {
380
+ return to_float(quadrant(to_int(x)));
381
+ }
382
+
383
+ template <class A>
384
+ XSIMD_INLINE batch<double, A> quadrant(const batch<double, A>& x) noexcept
385
+ {
386
+ using batch_type = batch<double, A>;
387
+ batch_type a = x * batch_type(0.25);
388
+ return (a - floor(a)) * batch_type(4.);
389
+ }
390
+ /* origin: boost/simd/arch/common/detail/simd/f_trig_evaluation.hpp */
391
+ /*
392
+ * ====================================================
393
+ * copyright 2016 NumScale SAS
394
+ *
395
+ * Distributed under the Boost Software License, Version 1.0.
396
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
397
+ * ====================================================
398
+ */
399
+
400
+ template <class A>
401
+ XSIMD_INLINE batch<float, A> cos_eval(const batch<float, A>& z) noexcept
402
+ {
403
+ using batch_type = batch<float, A>;
404
+ batch_type y = detail::horner<batch_type,
405
+ 0x3d2aaaa5,
406
+ 0xbab60619,
407
+ 0x37ccf5ce>(z);
408
+ return batch_type(1.) + fma(z, batch_type(-0.5), y * z * z);
409
+ }
410
+
411
+ template <class A>
412
+ XSIMD_INLINE batch<float, A> sin_eval(const batch<float, A>& z, const batch<float, A>& x) noexcept
413
+ {
414
+ using batch_type = batch<float, A>;
415
+ batch_type y = detail::horner<batch_type,
416
+ 0xbe2aaaa2,
417
+ 0x3c08839d,
418
+ 0xb94ca1f9>(z);
419
+ return fma(y * z, x, x);
420
+ }
421
+
422
+ template <class A>
423
+ static XSIMD_INLINE batch<float, A> base_tancot_eval(const batch<float, A>& z) noexcept
424
+ {
425
+ using batch_type = batch<float, A>;
426
+ batch_type zz = z * z;
427
+ batch_type y = detail::horner<batch_type,
428
+ 0x3eaaaa6f,
429
+ 0x3e0896dd,
430
+ 0x3d5ac5c9,
431
+ 0x3cc821b5,
432
+ 0x3b4c779c,
433
+ 0x3c19c53b>(zz);
434
+ return fma(y, zz * z, z);
435
+ }
436
+
437
+ template <class A, class BB>
438
+ static XSIMD_INLINE batch<float, A> tan_eval(const batch<float, A>& z, const BB& test) noexcept
439
+ {
440
+ using batch_type = batch<float, A>;
441
+ batch_type y = base_tancot_eval(z);
442
+ return select(test, y, -batch_type(1.) / y);
443
+ }
444
+
445
+ template <class A, class BB>
446
+ static XSIMD_INLINE batch<float, A> cot_eval(const batch<float, A>& z, const BB& test) noexcept
447
+ {
448
+ using batch_type = batch<float, A>;
449
+ batch_type y = base_tancot_eval(z);
450
+ return select(test, batch_type(1.) / y, -y);
451
+ }
452
+
453
+ /* origin: boost/simd/arch/common/detail/simd/d_trig_evaluation.hpp */
454
+ /*
455
+ * ====================================================
456
+ * copyright 2016 NumScale SAS
457
+ *
458
+ * Distributed under the Boost Software License, Version 1.0.
459
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
460
+ * ====================================================
461
+ */
462
+ template <class A>
463
+ static XSIMD_INLINE batch<double, A> cos_eval(const batch<double, A>& z) noexcept
464
+ {
465
+ using batch_type = batch<double, A>;
466
+ batch_type y = detail::horner<batch_type,
467
+ 0x3fe0000000000000ull,
468
+ 0xbfa5555555555551ull,
469
+ 0x3f56c16c16c15d47ull,
470
+ 0xbefa01a019ddbcd9ull,
471
+ 0x3e927e4f8e06d9a5ull,
472
+ 0xbe21eea7c1e514d4ull,
473
+ 0x3da8ff831ad9b219ull>(z);
474
+ return batch_type(1.) - y * z;
475
+ }
476
+
477
+ template <class A>
478
+ static XSIMD_INLINE batch<double, A> sin_eval(const batch<double, A>& z, const batch<double, A>& x) noexcept
479
+ {
480
+ using batch_type = batch<double, A>;
481
+ batch_type y = detail::horner<batch_type,
482
+ 0xbfc5555555555548ull,
483
+ 0x3f8111111110f7d0ull,
484
+ 0xbf2a01a019bfdf03ull,
485
+ 0x3ec71de3567d4896ull,
486
+ 0xbe5ae5e5a9291691ull,
487
+ 0x3de5d8fd1fcf0ec1ull>(z);
488
+ return fma(y * z, x, x);
489
+ }
490
+
491
+ template <class A>
492
+ static XSIMD_INLINE batch<double, A> base_tancot_eval(const batch<double, A>& z) noexcept
493
+ {
494
+ using batch_type = batch<double, A>;
495
+ batch_type zz = z * z;
496
+ batch_type num = detail::horner<batch_type,
497
+ 0xc1711fead3299176ull,
498
+ 0x413199eca5fc9dddull,
499
+ 0xc0c992d8d24f3f38ull>(zz);
500
+ batch_type den = detail::horner1<batch_type,
501
+ 0xc189afe03cbe5a31ull,
502
+ 0x4177d98fc2ead8efull,
503
+ 0xc13427bc582abc96ull,
504
+ 0x40cab8a5eeb36572ull>(zz);
505
+ return fma(z, (zz * (num / den)), z);
506
+ }
507
+
508
+ template <class A, class BB>
509
+ static XSIMD_INLINE batch<double, A> tan_eval(const batch<double, A>& z, const BB& test) noexcept
510
+ {
511
+ using batch_type = batch<double, A>;
512
+ batch_type y = base_tancot_eval(z);
513
+ return select(test, y, -batch_type(1.) / y);
514
+ }
515
+
516
+ template <class A, class BB>
517
+ static XSIMD_INLINE batch<double, A> cot_eval(const batch<double, A>& z, const BB& test) noexcept
518
+ {
519
+ using batch_type = batch<double, A>;
520
+ batch_type y = base_tancot_eval(z);
521
+ return select(test, batch_type(1.) / y, -y);
522
+ }
523
+ /* origin: boost/simd/arch/common/detail/simd/trig_reduction.hpp */
524
+ /*
525
+ * ====================================================
526
+ * copyright 2016 NumScale SAS
527
+ *
528
+ * Distributed under the Boost Software License, Version 1.0.
529
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
530
+ * ====================================================
531
+ */
532
+
533
+ struct trigo_radian_tag
534
+ {
535
+ };
536
+ struct trigo_pi_tag
537
+ {
538
+ };
539
+
540
+ template <class B, class Tag = trigo_radian_tag>
541
+ struct trigo_reducer
542
+ {
543
+ static XSIMD_INLINE B reduce(const B& x, B& xr) noexcept
544
+ {
545
+ if (all(x <= constants::pio4<B>()))
546
+ {
547
+ xr = x;
548
+ return B(0.);
549
+ }
550
+ else if (all(x <= constants::pio2<B>()))
551
+ {
552
+ auto test = x > constants::pio4<B>();
553
+ xr = x - constants::pio2_1<B>();
554
+ detail::reassociation_barrier(xr, "ordered pio2 subtraction");
555
+ xr -= constants::pio2_2<B>();
556
+ detail::reassociation_barrier(xr, "ordered pio2 subtraction");
557
+ xr -= constants::pio2_3<B>();
558
+ detail::reassociation_barrier(xr, "ordered pio2 subtraction");
559
+ xr = select(test, xr, x);
560
+ return select(test, B(1.), B(0.));
561
+ }
562
+ else if (all(x <= constants::twentypi<B>()))
563
+ {
564
+ B xi = nearbyint(x * constants::twoopi<B>());
565
+ detail::reassociation_barrier(xi, "preserve quadrant selection");
566
+ xr = fnma(xi, constants::pio2_1<B>(), x);
567
+ detail::reassociation_barrier(xr, "compensated range reduction");
568
+ xr -= xi * constants::pio2_2<B>();
569
+ detail::reassociation_barrier(xr, "compensated range reduction");
570
+ xr -= xi * constants::pio2_3<B>();
571
+ detail::reassociation_barrier(xr, "compensated range reduction");
572
+ return quadrant(xi);
573
+ }
574
+ else if (all(x <= constants::mediumpi<B>()))
575
+ {
576
+ B fn = nearbyint(x * constants::twoopi<B>());
577
+ detail::reassociation_barrier(fn, "multi-term range reduction");
578
+ B r = x - fn * constants::pio2_1<B>();
579
+ detail::reassociation_barrier(r, "multi-term range reduction");
580
+ B w = fn * constants::pio2_1t<B>();
581
+ B t = r;
582
+ w = fn * constants::pio2_2<B>();
583
+ r = t - w;
584
+ detail::reassociation_barrier(r, "multi-term range reduction");
585
+ w = fn * constants::pio2_2t<B>() - ((t - r) - w);
586
+ t = r;
587
+ w = fn * constants::pio2_3<B>();
588
+ r = t - w;
589
+ detail::reassociation_barrier(r, "multi-term range reduction");
590
+ w = fn * constants::pio2_3t<B>() - ((t - r) - w);
591
+ xr = r - w;
592
+ detail::reassociation_barrier(xr, "multi-term range reduction");
593
+ return quadrant(fn);
594
+ }
595
+ else
596
+ {
597
+ static constexpr std::size_t size = B::size;
598
+ using value_type = typename B::value_type;
599
+ alignas(B) std::array<value_type, size> tmp;
600
+ alignas(B) std::array<value_type, size> txr;
601
+ alignas(B) std::array<value_type, size> args;
602
+ x.store_aligned(args.data());
603
+
604
+ for (std::size_t i = 0; i < size; ++i)
605
+ {
606
+ double arg = args[i];
607
+ #ifndef __FAST_MATH__
608
+ if (arg == std::numeric_limits<value_type>::infinity())
609
+ {
610
+ tmp[i] = 0.;
611
+ txr[i] = std::numeric_limits<value_type>::quiet_NaN();
612
+ }
613
+ else
614
+ #endif
615
+ {
616
+ double y[2];
617
+ std::int32_t n = ::xsimd::detail::__ieee754_rem_pio2(arg, y);
618
+ tmp[i] = value_type(n & 3);
619
+ txr[i] = value_type(y[0]);
620
+ }
621
+ }
622
+ xr = B::load_aligned(&txr[0]);
623
+ B res = B::load_aligned(&tmp[0]);
624
+ return res;
625
+ }
626
+ }
627
+ };
628
+
629
+ template <class B>
630
+ struct trigo_reducer<B, trigo_pi_tag>
631
+ {
632
+ static XSIMD_INLINE B reduce(const B& x, B& xr) noexcept
633
+ {
634
+ B xi = nearbyint(x * B(2.));
635
+ B x2 = x - xi * B(0.5);
636
+ xr = x2 * constants::pi<B>();
637
+ return quadrant(xi);
638
+ }
639
+ };
640
+
641
+ }
642
+ template <class A, class T>
643
+ XSIMD_INLINE batch<T, A> cos(batch<T, A> const& self, requires_arch<common>) noexcept
644
+ {
645
+ using batch_type = batch<T, A>;
646
+ const batch_type x = abs(self);
647
+ batch_type xr = constants::nan<batch_type>();
648
+ const batch_type n = detail::trigo_reducer<batch_type>::reduce(x, xr);
649
+ auto tmp = select(n >= batch_type(2.), batch_type(1.), batch_type(0.));
650
+ auto swap_bit = fma(batch_type(-2.), tmp, n);
651
+ auto sign_bit = select((swap_bit ^ tmp) != batch_type(0.), constants::signmask<batch_type>(), batch_type(0.));
652
+ const batch_type z = xr * xr;
653
+ const batch_type se = detail::sin_eval(z, xr);
654
+ const batch_type ce = detail::cos_eval(z);
655
+ const batch_type z1 = select(swap_bit != batch_type(0.), se, ce);
656
+ return z1 ^ sign_bit;
657
+ }
658
+
659
+ template <class A, class T>
660
+ XSIMD_INLINE batch<std::complex<T>, A> cos(batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
661
+ {
662
+ return { cos(z.real()) * cosh(z.imag()), -sin(z.real()) * sinh(z.imag()) };
663
+ }
664
+
665
+ // cosh
666
+
667
+ /* origin: boost/simd/arch/common/simd/function/cosh.hpp */
668
+ /*
669
+ * ====================================================
670
+ * copyright 2016 NumScale SAS
671
+ *
672
+ * Distributed under the Boost Software License, Version 1.0.
673
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
674
+ * ====================================================
675
+ */
676
+
677
+ template <class A, class T>
678
+ XSIMD_INLINE batch<T, A> cosh(batch<T, A> const& self, requires_arch<common>) noexcept
679
+ {
680
+ using batch_type = batch<T, A>;
681
+ batch_type x = abs(self);
682
+ auto test1 = x > (constants::maxlog<batch_type>() - constants::log_2<batch_type>());
683
+ batch_type fac = select(test1, batch_type(0.5), batch_type(1.));
684
+ batch_type tmp = exp(x * fac);
685
+ batch_type tmp1 = batch_type(0.5) * tmp;
686
+ return select(test1, tmp1 * tmp, detail::average(tmp, batch_type(1.) / tmp));
687
+ }
688
+ template <class A, class T>
689
+ XSIMD_INLINE batch<std::complex<T>, A> cosh(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
690
+ {
691
+ auto x = z.real();
692
+ auto y = z.imag();
693
+ return { cosh(x) * cos(y), sinh(x) * sin(y) };
694
+ }
695
+
696
+ // sin
697
+ namespace detail
698
+ {
699
+ template <class A, class T, class Tag = trigo_radian_tag>
700
+ XSIMD_INLINE batch<T, A> sin(batch<T, A> const& self, Tag = Tag()) noexcept
701
+ {
702
+ using batch_type = batch<T, A>;
703
+ const batch_type x = abs(self);
704
+ batch_type xr = constants::nan<batch_type>();
705
+ const batch_type n = detail::trigo_reducer<batch_type, Tag>::reduce(x, xr);
706
+ auto tmp = select(n >= batch_type(2.), batch_type(1.), batch_type(0.));
707
+ auto swap_bit = fma(batch_type(-2.), tmp, n);
708
+ auto sign_bit = bitofsign(self) ^ select(tmp != batch_type(0.), constants::signmask<batch_type>(), batch_type(0.));
709
+ const batch_type z = xr * xr;
710
+ const batch_type se = detail::sin_eval(z, xr);
711
+ const batch_type ce = detail::cos_eval(z);
712
+ const batch_type z1 = select(swap_bit == batch_type(0.), se, ce);
713
+ return z1 ^ sign_bit;
714
+ }
715
+ }
716
+
717
+ template <class A, class T>
718
+ XSIMD_INLINE batch<T, A> sin(batch<T, A> const& self, requires_arch<common>) noexcept
719
+ {
720
+ return detail::sin(self);
721
+ }
722
+
723
+ template <class A, class T>
724
+ XSIMD_INLINE batch<std::complex<T>, A> sin(batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
725
+ {
726
+ return { sin(z.real()) * cosh(z.imag()), cos(z.real()) * sinh(z.imag()) };
727
+ }
728
+
729
+ // sincos
730
+ template <class A, class T>
731
+ XSIMD_INLINE std::pair<batch<T, A>, batch<T, A>> sincos(batch<T, A> const& self, requires_arch<common>) noexcept
732
+ {
733
+ using batch_type = batch<T, A>;
734
+ const batch_type x = abs(self);
735
+ batch_type xr = constants::nan<batch_type>();
736
+ const batch_type n = detail::trigo_reducer<batch_type>::reduce(x, xr);
737
+ auto tmp = select(n >= batch_type(2.), batch_type(1.), batch_type(0.));
738
+ auto swap_bit = fma(batch_type(-2.), tmp, n);
739
+ const batch_type z = xr * xr;
740
+ const batch_type se = detail::sin_eval(z, xr);
741
+ const batch_type ce = detail::cos_eval(z);
742
+ auto sin_sign_bit = bitofsign(self) ^ select(tmp != batch_type(0.), constants::signmask<batch_type>(), batch_type(0.));
743
+ const batch_type sin_z1 = select(swap_bit == batch_type(0.), se, ce);
744
+ auto cos_sign_bit = select((swap_bit ^ tmp) != batch_type(0.), constants::signmask<batch_type>(), batch_type(0.));
745
+ const batch_type cos_z1 = select(swap_bit != batch_type(0.), se, ce);
746
+ return std::make_pair(sin_z1 ^ sin_sign_bit, cos_z1 ^ cos_sign_bit);
747
+ }
748
+
749
+ template <class A, class T>
750
+ XSIMD_INLINE std::pair<batch<std::complex<T>, A>, batch<std::complex<T>, A>>
751
+ sincos(batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
752
+ {
753
+ using batch_type = batch<std::complex<T>, A>;
754
+ using real_batch = typename batch_type::real_batch;
755
+ real_batch rcos = cos(z.real());
756
+ real_batch rsin = sin(z.real());
757
+ real_batch icosh = cosh(z.imag());
758
+ real_batch isinh = sinh(z.imag());
759
+ return std::make_pair(batch_type(rsin * icosh, rcos * isinh), batch_type(rcos * icosh, -rsin * isinh));
760
+ }
761
+
762
+ // sinh
763
+ namespace detail
764
+ {
765
+ /* origin: boost/simd/arch/common/detail/common/sinh_kernel.hpp */
766
+ /*
767
+ * ====================================================
768
+ * copyright 2016 NumScale SAS
769
+ *
770
+ * Distributed under the Boost Software License, Version 1.0.
771
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
772
+ * ====================================================
773
+ */
774
+ template <class A>
775
+ XSIMD_INLINE batch<float, A> sinh_kernel(batch<float, A> const& self) noexcept
776
+ {
777
+ using batch_type = batch<float, A>;
778
+ batch_type sqr_self = self * self;
779
+ return detail::horner<batch_type,
780
+ 0x3f800000, // 1.0f
781
+ 0x3e2aaacc, // 1.66667160211E-1f
782
+ 0x3c087bbe, // 8.33028376239E-3f
783
+ 0x39559e2f // 2.03721912945E-4f
784
+ >(sqr_self)
785
+ * self;
786
+ }
787
+
788
+ template <class A>
789
+ XSIMD_INLINE batch<double, A> sinh_kernel(batch<double, A> const& self) noexcept
790
+ {
791
+ using batch_type = batch<double, A>;
792
+ batch_type sqrself = self * self;
793
+ return fma(self, (detail::horner<batch_type,
794
+ 0xc115782bdbf6ab05ull, // -3.51754964808151394800E5
795
+ 0xc0c694b8c71d6182ull, // -1.15614435765005216044E4,
796
+ 0xc064773a398ff4feull, // -1.63725857525983828727E2,
797
+ 0xbfe9435fe8bb3cd6ull // -7.89474443963537015605E-1
798
+ >(sqrself)
799
+ / detail::horner1<batch_type,
800
+ 0xc1401a20e4f90044ull, // -2.11052978884890840399E6
801
+ 0x40e1a7ba7ed72245ull, // 3.61578279834431989373E4,
802
+ 0xc0715b6096e96484ull // -2.77711081420602794433E2,
803
+ >(sqrself))
804
+ * sqrself,
805
+ self);
806
+ }
807
+ }
808
+ /* origin: boost/simd/arch/common/simd/function/sinh.hpp */
809
+ /*
810
+ * ====================================================
811
+ * copyright 2016 NumScale SAS
812
+ *
813
+ * Distributed under the Boost Software License, Version 1.0.
814
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
815
+ * ====================================================
816
+ */
817
+ template <class A, class T>
818
+ XSIMD_INLINE batch<T, A> sinh(batch<T, A> const& a, requires_arch<common>) noexcept
819
+ {
820
+ using batch_type = batch<T, A>;
821
+ batch_type half(0.5);
822
+ batch_type x = abs(a);
823
+ auto lt1 = x < batch_type(1.);
824
+ batch_type bts = bitofsign(a);
825
+ batch_type z(0.);
826
+ if (any(lt1))
827
+ {
828
+ z = detail::sinh_kernel(x);
829
+ if (all(lt1))
830
+ return z ^ bts;
831
+ }
832
+ auto test1 = x > (constants::maxlog<batch_type>() - constants::log_2<batch_type>());
833
+ batch_type fac = select(test1, half, batch_type(1.));
834
+ batch_type tmp = exp(x * fac);
835
+ batch_type tmp1 = half * tmp;
836
+ batch_type r = select(test1, tmp1 * tmp, tmp1 - half / tmp);
837
+ return select(lt1, z, r) ^ bts;
838
+ }
839
+ template <class A, class T>
840
+ XSIMD_INLINE batch<std::complex<T>, A> sinh(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
841
+ {
842
+ auto x = z.real();
843
+ auto y = z.imag();
844
+ return { sinh(x) * cos(y), cosh(x) * sin(y) };
845
+ }
846
+
847
+ // tan
848
+ template <class A, class T>
849
+ XSIMD_INLINE batch<T, A> tan(batch<T, A> const& self, requires_arch<common>) noexcept
850
+ {
851
+ using batch_type = batch<T, A>;
852
+ const batch_type x = abs(self);
853
+ batch_type xr = constants::nan<batch_type>();
854
+ const batch_type n = detail::trigo_reducer<batch_type>::reduce(x, xr);
855
+ auto tmp = select(n >= batch_type(2.), batch_type(1.), batch_type(0.));
856
+ auto swap_bit = fma(batch_type(-2.), tmp, n);
857
+ auto test = (swap_bit == batch_type(0.));
858
+ const batch_type y = detail::tan_eval(xr, test);
859
+ return y ^ bitofsign(self);
860
+ }
861
+ template <class A, class T>
862
+ XSIMD_INLINE batch<std::complex<T>, A> tan(batch<std::complex<T>, A> const& z, requires_arch<common>) noexcept
863
+ {
864
+ using batch_type = batch<std::complex<T>, A>;
865
+ using real_batch = typename batch_type::real_batch;
866
+ real_batch d = cos(2 * z.real()) + cosh(2 * z.imag());
867
+ real_batch wreal = sin(2 * z.real()) / d;
868
+ real_batch wimag = sinh(2 * z.imag());
869
+ #ifdef __FAST_MATH__
870
+ return batch_type(wreal, real_batch(1.)), batch_type(wreal, wimag / d);
871
+ #else
872
+ batch_type winf(constants::infinity<real_batch>(), constants::infinity<real_batch>());
873
+ batch_type wres = select(isinf(wimag), batch_type(wreal, real_batch(1.)), batch_type(wreal, wimag / d));
874
+ return select(d == real_batch(0.), winf, wres);
875
+ #endif
876
+ }
877
+
878
+ // tanh
879
+ namespace detail
880
+ {
881
+ /* origin: boost/simd/arch/common/detail/common/tanh_kernel.hpp */
882
+ /*
883
+ * ====================================================
884
+ * copyright 2016 NumScale SAS
885
+ *
886
+ * Distributed under the Boost Software License, Version 1.0.
887
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
888
+ * ====================================================
889
+ */
890
+ template <class B>
891
+ struct tanh_kernel;
892
+
893
+ template <class A>
894
+ struct tanh_kernel<batch<float, A>>
895
+ {
896
+ using batch_type = batch<float, A>;
897
+ static XSIMD_INLINE batch_type tanh(const batch_type& x) noexcept
898
+ {
899
+ batch_type sqrx = x * x;
900
+ return fma(detail::horner<batch_type,
901
+ 0xbeaaaa99, // -3.33332819422E-1F
902
+ 0x3e088393, // +1.33314422036E-1F
903
+ 0xbd5c1e2d, // -5.37397155531E-2F
904
+ 0x3ca9134e, // +2.06390887954E-2F
905
+ 0xbbbaf0ea // -5.70498872745E-3F
906
+ >(sqrx)
907
+ * sqrx,
908
+ x, x);
909
+ }
910
+
911
+ static XSIMD_INLINE batch_type cotanh(const batch_type& x) noexcept
912
+ {
913
+ return batch_type(1.) / tanh(x);
914
+ }
915
+ };
916
+
917
+ template <class A>
918
+ struct tanh_kernel<batch<double, A>>
919
+ {
920
+ using batch_type = batch<double, A>;
921
+ static XSIMD_INLINE batch_type tanh(const batch_type& x) noexcept
922
+ {
923
+ batch_type sqrx = x * x;
924
+ return fma(sqrx * p(sqrx) / q(sqrx), x, x);
925
+ }
926
+
927
+ static XSIMD_INLINE batch_type cotanh(const batch_type& x) noexcept
928
+ {
929
+ batch_type sqrx = x * x;
930
+ batch_type qval = q(sqrx);
931
+ return qval / (x * fma(p(sqrx), sqrx, qval));
932
+ }
933
+
934
+ static XSIMD_INLINE batch_type p(const batch_type& x) noexcept
935
+ {
936
+ return detail::horner<batch_type,
937
+ 0xc0993ac030580563, // -1.61468768441708447952E3
938
+ 0xc058d26a0e26682d, // -9.92877231001918586564E1,
939
+ 0xbfeedc5baafd6f4b // -9.64399179425052238628E-1
940
+ >(x);
941
+ }
942
+
943
+ static XSIMD_INLINE batch_type q(const batch_type& x) noexcept
944
+ {
945
+ return detail::horner1<batch_type,
946
+ 0x40b2ec102442040c, // 4.84406305325125486048E3
947
+ 0x40a176fa0e5535fa, // 2.23548839060100448583E3,
948
+ 0x405c33f28a581B86 // 1.12811678491632931402E2,
949
+ >(x);
950
+ }
951
+ };
952
+
953
+ }
954
+ /* origin: boost/simd/arch/common/simd/function/tanh.hpp */
955
+ /*
956
+ * ====================================================
957
+ * copyright 2016 NumScale SAS
958
+ *
959
+ * Distributed under the Boost Software License, Version 1.0.
960
+ * (See copy at http://boost.org/LICENSE_1_0.txt)
961
+ * ====================================================
962
+ */
963
+ template <class A, class T>
964
+ XSIMD_INLINE batch<T, A> tanh(batch<T, A> const& self, requires_arch<common>) noexcept
965
+ {
966
+ using batch_type = batch<T, A>;
967
+ batch_type one(1.);
968
+ batch_type x = abs(self);
969
+ auto test = x < (batch_type(5.) / batch_type(8.));
970
+ batch_type bts = bitofsign(self);
971
+ batch_type z = one;
972
+ if (any(test))
973
+ {
974
+ z = detail::tanh_kernel<batch_type>::tanh(x);
975
+ if (all(test))
976
+ return z ^ bts;
977
+ }
978
+ batch_type r = fma(batch_type(-2.), one / (one + exp(x + x)), one);
979
+ return select(test, z, r) ^ bts;
980
+ }
981
+ template <class A, class T>
982
+ XSIMD_INLINE batch<std::complex<T>, A> tanh(const batch<std::complex<T>, A>& z, requires_arch<common>) noexcept
983
+ {
984
+ using real_batch = typename batch<std::complex<T>, A>::real_batch;
985
+ auto x = z.real();
986
+ auto y = z.imag();
987
+ real_batch two(2);
988
+ auto d = cosh(two * x) + cos(two * y);
989
+ return { sinh(two * x) / d, sin(two * y) / d };
990
+ }
991
+
992
+ }
993
+
994
+ }
995
+
996
+ #endif