bigdecimal-math_r 0.2.0

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 (309) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -0
  3. data/CODE_OF_CONDUCT.md +132 -0
  4. data/LICENSE +21 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +41 -0
  7. data/Rakefile +13 -0
  8. data/changelog.md +24 -0
  9. data/ext/bigdecimal/math_r/algofunc.h +203 -0
  10. data/ext/bigdecimal/math_r/api/bigdecimal/check_precise.h +12 -0
  11. data/ext/bigdecimal/math_r/api/bigdecimal/infinity.h +6 -0
  12. data/ext/bigdecimal/math_r/api/bigdecimal/minus_infinity.h +5 -0
  13. data/ext/bigdecimal/math_r/api/bigdecimal/minus_one.h +6 -0
  14. data/ext/bigdecimal/math_r/api/bigdecimal/minus_zero.h +6 -0
  15. data/ext/bigdecimal/math_r/api/bigdecimal/nan.h +6 -0
  16. data/ext/bigdecimal/math_r/api/bigdecimal/one.h +6 -0
  17. data/ext/bigdecimal/math_r/api/bigdecimal/sign.h +10 -0
  18. data/ext/bigdecimal/math_r/api/bigdecimal/zero.h +6 -0
  19. data/ext/bigdecimal/math_r/api/bigmath/api_call1.h +5 -0
  20. data/ext/bigdecimal/math_r/api/bigmath/api_call2.h +6 -0
  21. data/ext/bigdecimal/math_r/api/bigmath/atan.h +7 -0
  22. data/ext/bigdecimal/math_r/api/bigmath/atan_adopt.h +42 -0
  23. data/ext/bigdecimal/math_r/api/bigmath/cabs.h +5 -0
  24. data/ext/bigdecimal/math_r/api/bigmath/carg.h +5 -0
  25. data/ext/bigdecimal/math_r/api/bigmath/cexp.h +5 -0
  26. data/ext/bigdecimal/math_r/api/bigmath/clog.h +5 -0
  27. data/ext/bigdecimal/math_r/api/bigmath/const.h +39 -0
  28. data/ext/bigdecimal/math_r/api/bigmath/const_e.h +5 -0
  29. data/ext/bigdecimal/math_r/api/bigmath/const_log10.h +5 -0
  30. data/ext/bigdecimal/math_r/api/bigmath/const_log2.h +5 -0
  31. data/ext/bigdecimal/math_r/api/bigmath/const_log_pi.h +5 -0
  32. data/ext/bigdecimal/math_r/api/bigmath/const_pi.h +5 -0
  33. data/ext/bigdecimal/math_r/api/bigmath/const_sqrt2.h +5 -0
  34. data/ext/bigdecimal/math_r/api/bigmath/const_sqrt3.h +5 -0
  35. data/ext/bigdecimal/math_r/api/bigmath/cpow.h +5 -0
  36. data/ext/bigdecimal/math_r/api/bigmath/csqrt.h +5 -0
  37. data/ext/bigdecimal/math_r/api/bigmath/degree_sparg.h +199 -0
  38. data/ext/bigdecimal/math_r/api/bigmath/escalb.h +5 -0
  39. data/ext/bigdecimal/math_r/api/bigmath/exp.h +5 -0
  40. data/ext/bigdecimal/math_r/api/bigmath/expxt.h +18 -0
  41. data/ext/bigdecimal/math_r/api/bigmath/hypot.h +10 -0
  42. data/ext/bigdecimal/math_r/api/bigmath/ipow.h +14 -0
  43. data/ext/bigdecimal/math_r/api/bigmath/l2norm.h +5 -0
  44. data/ext/bigdecimal/math_r/api/bigmath/log.h +7 -0
  45. data/ext/bigdecimal/math_r/api/bigmath/pow.h +5 -0
  46. data/ext/bigdecimal/math_r/api/bigmath/quadrant.h +5 -0
  47. data/ext/bigdecimal/math_r/api/bigmath/sincos.h +5 -0
  48. data/ext/bigdecimal/math_r/api/bigmath/sqrt.h +5 -0
  49. data/ext/bigdecimal/math_r/api/bigmath/to_rad.h +41 -0
  50. data/ext/bigdecimal/math_r/api/kernel/rb_BigDecimal.h +6 -0
  51. data/ext/bigdecimal/math_r/api/kernel/rb_BigDecimal1.h +6 -0
  52. data/ext/bigdecimal/math_r/api/kernel/rb_BigDecimal_flo.h +9 -0
  53. data/ext/bigdecimal/math_r/api/kernel/rb_ImaginaryZ.h +8 -0
  54. data/ext/bigdecimal/math_r/api/numanalysis/condition_p.h +26 -0
  55. data/ext/bigdecimal/math_r/api/numanalysis/make_n.h +9 -0
  56. data/ext/bigdecimal/math_r/api/numeric/abs.h +7 -0
  57. data/ext/bigdecimal/math_r/api/numeric/canonicalize.h +140 -0
  58. data/ext/bigdecimal/math_r/api/numeric/cmpeql.h +6 -0
  59. data/ext/bigdecimal/math_r/api/numeric/equal_p.h +6 -0
  60. data/ext/bigdecimal/math_r/api/numeric/finite_p.h +6 -0
  61. data/ext/bigdecimal/math_r/api/numeric/imag.h +6 -0
  62. data/ext/bigdecimal/math_r/api/numeric/infinite_p.h +7 -0
  63. data/ext/bigdecimal/math_r/api/numeric/nan_p.h +5 -0
  64. data/ext/bigdecimal/math_r/api/numeric/negative_p.h +6 -0
  65. data/ext/bigdecimal/math_r/api/numeric/nonzero_p.h +6 -0
  66. data/ext/bigdecimal/math_r/api/numeric/notequal_p.h +6 -0
  67. data/ext/bigdecimal/math_r/api/numeric/numeric_p.h +5 -0
  68. data/ext/bigdecimal/math_r/api/numeric/positive_p.h +6 -0
  69. data/ext/bigdecimal/math_r/api/numeric/real.h +6 -0
  70. data/ext/bigdecimal/math_r/api/numeric/real_p.h +6 -0
  71. data/ext/bigdecimal/math_r/api/numeric/round.h +56 -0
  72. data/ext/bigdecimal/math_r/api/numeric/uminus.h +6 -0
  73. data/ext/bigdecimal/math_r/api/numeric/zero_p.h +6 -0
  74. data/ext/bigdecimal/math_r/api.c +13 -0
  75. data/ext/bigdecimal/math_r/api.h +69 -0
  76. data/ext/bigdecimal/math_r/const.c +186 -0
  77. data/ext/bigdecimal/math_r/decl.h +203 -0
  78. data/ext/bigdecimal/math_r/edf.c +180 -0
  79. data/ext/bigdecimal/math_r/erf.c +80 -0
  80. data/ext/bigdecimal/math_r/euler_f.c +572 -0
  81. data/ext/bigdecimal/math_r/exp.c +72 -0
  82. data/ext/bigdecimal/math_r/extconf.rb +185 -0
  83. data/ext/bigdecimal/math_r/gamma_r.c +251 -0
  84. data/ext/bigdecimal/math_r/hyperb.c +172 -0
  85. data/ext/bigdecimal/math_r/internal/algo/bigmath/E/ser.h +22 -0
  86. data/ext/bigdecimal/math_r/internal/algo/bigmath/LOG10/ser.h +16 -0
  87. data/ext/bigdecimal/math_r/internal/algo/bigmath/LOG2/BBP2002.h +36 -0
  88. data/ext/bigdecimal/math_r/internal/algo/bigmath/LOG_PI/builtin.h +7 -0
  89. data/ext/bigdecimal/math_r/internal/algo/bigmath/PI/machin.h +48 -0
  90. data/ext/bigdecimal/math_r/internal/algo/bigmath/SQRT2/builtin.h +5 -0
  91. data/ext/bigdecimal/math_r/internal/algo/bigmath/SQRT3/builtin.h +5 -0
  92. data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/branch.h +25 -0
  93. data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/edom.h +15 -0
  94. data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/logrep.h +19 -0
  95. data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/ser.h +34 -0
  96. data/ext/bigdecimal/math_r/internal/algo/bigmath/acosh/branch.h +19 -0
  97. data/ext/bigdecimal/math_r/internal/algo/bigmath/acosh/edom.h +17 -0
  98. data/ext/bigdecimal/math_r/internal/algo/bigmath/acosh/logrep.h +14 -0
  99. data/ext/bigdecimal/math_r/internal/algo/bigmath/acot/branch.h +16 -0
  100. data/ext/bigdecimal/math_r/internal/algo/bigmath/acot/logrep.h +13 -0
  101. data/ext/bigdecimal/math_r/internal/algo/bigmath/acoth/branch.h +20 -0
  102. data/ext/bigdecimal/math_r/internal/algo/bigmath/acoth/edom.h +18 -0
  103. data/ext/bigdecimal/math_r/internal/algo/bigmath/acoth/logrep.h +33 -0
  104. data/ext/bigdecimal/math_r/internal/algo/bigmath/acsc/branch.h +21 -0
  105. data/ext/bigdecimal/math_r/internal/algo/bigmath/acsc/edom.h +20 -0
  106. data/ext/bigdecimal/math_r/internal/algo/bigmath/acsc/logrep.h +16 -0
  107. data/ext/bigdecimal/math_r/internal/algo/bigmath/acsch/branch.h +25 -0
  108. data/ext/bigdecimal/math_r/internal/algo/bigmath/acsch/logrep.h +25 -0
  109. data/ext/bigdecimal/math_r/internal/algo/bigmath/asec/branch.h +22 -0
  110. data/ext/bigdecimal/math_r/internal/algo/bigmath/asec/edom.h +16 -0
  111. data/ext/bigdecimal/math_r/internal/algo/bigmath/asec/logrep.h +21 -0
  112. data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/branch.h +18 -0
  113. data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/edom.h +19 -0
  114. data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/logrep.h +16 -0
  115. data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/branch.h +22 -0
  116. data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/edom.h +20 -0
  117. data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/logrep.h +15 -0
  118. data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/ser.h +32 -0
  119. data/ext/bigdecimal/math_r/internal/algo/bigmath/asinh/branch.h +26 -0
  120. data/ext/bigdecimal/math_r/internal/algo/bigmath/asinh/logrep.h +24 -0
  121. data/ext/bigdecimal/math_r/internal/algo/bigmath/asinh/ser.h +48 -0
  122. data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/branch.h +16 -0
  123. data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/logrep.h +14 -0
  124. data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/ser_euler.h +84 -0
  125. data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/ser_usual.h +41 -0
  126. data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/branch.h +24 -0
  127. data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/edom.h +16 -0
  128. data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/logrep.h +16 -0
  129. data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/ser.h +33 -0
  130. data/ext/bigdecimal/math_r/internal/algo/bigmath/cabs/formula.h +8 -0
  131. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacos/branch.h +38 -0
  132. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacos/logrep.h +16 -0
  133. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacosh/branch.h +34 -0
  134. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacosh/logrep.h +17 -0
  135. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacot/branch.h +39 -0
  136. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacot/logrep.h +17 -0
  137. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacoth/branch.h +29 -0
  138. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacoth/logrep.h +11 -0
  139. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsc/branch.h +28 -0
  140. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsc/logrep.h +19 -0
  141. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsch/branch.h +18 -0
  142. data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsch/logrep.h +11 -0
  143. data/ext/bigdecimal/math_r/internal/algo/bigmath/carg/formula.h +8 -0
  144. data/ext/bigdecimal/math_r/internal/algo/bigmath/casec/branch.h +29 -0
  145. data/ext/bigdecimal/math_r/internal/algo/bigmath/casec/logrep.h +18 -0
  146. data/ext/bigdecimal/math_r/internal/algo/bigmath/casech/branch.h +38 -0
  147. data/ext/bigdecimal/math_r/internal/algo/bigmath/casech/logrep.h +9 -0
  148. data/ext/bigdecimal/math_r/internal/algo/bigmath/casin/branch.h +35 -0
  149. data/ext/bigdecimal/math_r/internal/algo/bigmath/casin/logrep.h +14 -0
  150. data/ext/bigdecimal/math_r/internal/algo/bigmath/casinh/branch.h +59 -0
  151. data/ext/bigdecimal/math_r/internal/algo/bigmath/casinh/logrep.h +13 -0
  152. data/ext/bigdecimal/math_r/internal/algo/bigmath/catan/branch.h +46 -0
  153. data/ext/bigdecimal/math_r/internal/algo/bigmath/catan/logrep.h +17 -0
  154. data/ext/bigdecimal/math_r/internal/algo/bigmath/catanh/branch.h +26 -0
  155. data/ext/bigdecimal/math_r/internal/algo/bigmath/catanh/logrep.h +10 -0
  156. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccbrt/formula.h +11 -0
  157. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccos/branch.h +41 -0
  158. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccos/eulerf.h +11 -0
  159. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccosh/branch.h +37 -0
  160. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccosh/eulerf.h +11 -0
  161. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccot/branch.h +46 -0
  162. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccot/eulerf.h +11 -0
  163. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccoth/branch.h +43 -0
  164. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccoth/eulerf.h +11 -0
  165. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsc/branch.h +42 -0
  166. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsc/eulerf.h +11 -0
  167. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsch/branch.h +38 -0
  168. data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsch/eulerf.h +11 -0
  169. data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp/branch.h +42 -0
  170. data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp/eulerf.h +21 -0
  171. data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp2/branch.h +42 -0
  172. data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp2/eulerf.h +12 -0
  173. data/ext/bigdecimal/math_r/internal/algo/bigmath/clog/branch.h +54 -0
  174. data/ext/bigdecimal/math_r/internal/algo/bigmath/clog/formula.h +13 -0
  175. data/ext/bigdecimal/math_r/internal/algo/bigmath/clog10/formula.h +12 -0
  176. data/ext/bigdecimal/math_r/internal/algo/bigmath/clog1p/branch.h +34 -0
  177. data/ext/bigdecimal/math_r/internal/algo/bigmath/clog2/formula.h +12 -0
  178. data/ext/bigdecimal/math_r/internal/algo/bigmath/cos/branch.h +21 -0
  179. data/ext/bigdecimal/math_r/internal/algo/bigmath/cos/eulerf.h +11 -0
  180. data/ext/bigdecimal/math_r/internal/algo/bigmath/cos/ser.h +12 -0
  181. data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/branch.h +22 -0
  182. data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/eulerf.h +11 -0
  183. data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/formula.h +30 -0
  184. data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/ser.h +11 -0
  185. data/ext/bigdecimal/math_r/internal/algo/bigmath/cot/branch.h +28 -0
  186. data/ext/bigdecimal/math_r/internal/algo/bigmath/cot/eulerf.h +11 -0
  187. data/ext/bigdecimal/math_r/internal/algo/bigmath/cot/ser.h +12 -0
  188. data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/branch.h +23 -0
  189. data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/eulerf.h +11 -0
  190. data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/formula.h +30 -0
  191. data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/ser.h +13 -0
  192. data/ext/bigdecimal/math_r/internal/algo/bigmath/cpow/formula.h +20 -0
  193. data/ext/bigdecimal/math_r/internal/algo/bigmath/csc/branch.h +28 -0
  194. data/ext/bigdecimal/math_r/internal/algo/bigmath/csc/eulerf.h +11 -0
  195. data/ext/bigdecimal/math_r/internal/algo/bigmath/csc/ser.h +11 -0
  196. data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/branch.h +23 -0
  197. data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/eulerf.h +11 -0
  198. data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/formula.h +31 -0
  199. data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/ser.h +11 -0
  200. data/ext/bigdecimal/math_r/internal/algo/bigmath/csec/branch.h +42 -0
  201. data/ext/bigdecimal/math_r/internal/algo/bigmath/csec/eulerf.h +11 -0
  202. data/ext/bigdecimal/math_r/internal/algo/bigmath/csech/branch.h +38 -0
  203. data/ext/bigdecimal/math_r/internal/algo/bigmath/csech/eulerf.h +11 -0
  204. data/ext/bigdecimal/math_r/internal/algo/bigmath/csin/branch.h +44 -0
  205. data/ext/bigdecimal/math_r/internal/algo/bigmath/csin/eulerf.h +11 -0
  206. data/ext/bigdecimal/math_r/internal/algo/bigmath/csinh/branch.h +41 -0
  207. data/ext/bigdecimal/math_r/internal/algo/bigmath/csinh/eulerf.h +11 -0
  208. data/ext/bigdecimal/math_r/internal/algo/bigmath/csqrt/formula.h +66 -0
  209. data/ext/bigdecimal/math_r/internal/algo/bigmath/ctan/branch.h +46 -0
  210. data/ext/bigdecimal/math_r/internal/algo/bigmath/ctan/eulerf.h +11 -0
  211. data/ext/bigdecimal/math_r/internal/algo/bigmath/ctanh/branch.h +43 -0
  212. data/ext/bigdecimal/math_r/internal/algo/bigmath/ctanh/eulerf.h +11 -0
  213. data/ext/bigdecimal/math_r/internal/algo/bigmath/cuberoot/newton.h +42 -0
  214. data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/algo911.h +41 -0
  215. data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/branch.h +18 -0
  216. data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/cf.h +51 -0
  217. data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/ser_inf.h +53 -0
  218. data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/ser_zero.h +45 -0
  219. data/ext/bigdecimal/math_r/internal/algo/bigmath/erfc/algo911.h +27 -0
  220. data/ext/bigdecimal/math_r/internal/algo/bigmath/erfc/branch.h +18 -0
  221. data/ext/bigdecimal/math_r/internal/algo/bigmath/erfc/cf.h +49 -0
  222. data/ext/bigdecimal/math_r/internal/algo/bigmath/escalb/edf.h +87 -0
  223. data/ext/bigdecimal/math_r/internal/algo/bigmath/exp/branch.h +29 -0
  224. data/ext/bigdecimal/math_r/internal/algo/bigmath/exp/builtin.h +6 -0
  225. data/ext/bigdecimal/math_r/internal/algo/bigmath/exp/edf.h +23 -0
  226. data/ext/bigdecimal/math_r/internal/algo/bigmath/exp2/branch.h +29 -0
  227. data/ext/bigdecimal/math_r/internal/algo/bigmath/exp2/edf.h +19 -0
  228. data/ext/bigdecimal/math_r/internal/algo/bigmath/expxt/edf.h +31 -0
  229. data/ext/bigdecimal/math_r/internal/algo/bigmath/f_euler/formula.h +11 -0
  230. data/ext/bigdecimal/math_r/internal/algo/bigmath/hypot/branch.h +25 -0
  231. data/ext/bigdecimal/math_r/internal/algo/bigmath/hypot/l2norm.h +11 -0
  232. data/ext/bigdecimal/math_r/internal/algo/bigmath/hypot/mmm.h +38 -0
  233. data/ext/bigdecimal/math_r/internal/algo/bigmath/ipow/edf.h +33 -0
  234. data/ext/bigdecimal/math_r/internal/algo/bigmath/l2norm/formula.h +48 -0
  235. data/ext/bigdecimal/math_r/internal/algo/bigmath/log/branch.h +40 -0
  236. data/ext/bigdecimal/math_r/internal/algo/bigmath/log/builtin.h +12 -0
  237. data/ext/bigdecimal/math_r/internal/algo/bigmath/log/edf.h +10 -0
  238. data/ext/bigdecimal/math_r/internal/algo/bigmath/log/edom.h +10 -0
  239. data/ext/bigdecimal/math_r/internal/algo/bigmath/log/mercator.h +34 -0
  240. data/ext/bigdecimal/math_r/internal/algo/bigmath/log/ser_okumura.h +57 -0
  241. data/ext/bigdecimal/math_r/internal/algo/bigmath/log10/branch.h +40 -0
  242. data/ext/bigdecimal/math_r/internal/algo/bigmath/log10/edf.h +11 -0
  243. data/ext/bigdecimal/math_r/internal/algo/bigmath/log10/mercator.h +35 -0
  244. data/ext/bigdecimal/math_r/internal/algo/bigmath/log1p/branch.h +34 -0
  245. data/ext/bigdecimal/math_r/internal/algo/bigmath/log1p/p_adic.h +37 -0
  246. data/ext/bigdecimal/math_r/internal/algo/bigmath/log1p/ser_mercator.h +35 -0
  247. data/ext/bigdecimal/math_r/internal/algo/bigmath/log2/branch.h +40 -0
  248. data/ext/bigdecimal/math_r/internal/algo/bigmath/log2/edf.h +11 -0
  249. data/ext/bigdecimal/math_r/internal/algo/bigmath/log2/mercator.h +35 -0
  250. data/ext/bigdecimal/math_r/internal/algo/bigmath/logxt/edf.h +33 -0
  251. data/ext/bigdecimal/math_r/internal/algo/bigmath/pow/formula.h +30 -0
  252. data/ext/bigdecimal/math_r/internal/algo/bigmath/quadrant/formula.h +352 -0
  253. data/ext/bigdecimal/math_r/internal/algo/bigmath/rcm10/edf.h +34 -0
  254. data/ext/bigdecimal/math_r/internal/algo/bigmath/rcm2/edf.h +34 -0
  255. data/ext/bigdecimal/math_r/internal/algo/bigmath/sec/branch.h +27 -0
  256. data/ext/bigdecimal/math_r/internal/algo/bigmath/sec/eulerf.h +11 -0
  257. data/ext/bigdecimal/math_r/internal/algo/bigmath/sec/ser.h +11 -0
  258. data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/branch.h +21 -0
  259. data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/eulerf.h +11 -0
  260. data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/formula.h +25 -0
  261. data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/ser.h +11 -0
  262. data/ext/bigdecimal/math_r/internal/algo/bigmath/sin/branch.h +23 -0
  263. data/ext/bigdecimal/math_r/internal/algo/bigmath/sin/eulerf.h +11 -0
  264. data/ext/bigdecimal/math_r/internal/algo/bigmath/sin/ser.h +13 -0
  265. data/ext/bigdecimal/math_r/internal/algo/bigmath/sincos/ser.h +50 -0
  266. data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/branch.h +23 -0
  267. data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/eulerf.h +11 -0
  268. data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/formula.h +26 -0
  269. data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/ser.h +11 -0
  270. data/ext/bigdecimal/math_r/internal/algo/bigmath/sinhcosh/ser.h +70 -0
  271. data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/branch.h +16 -0
  272. data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/builtin.h +12 -0
  273. data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/edom.h +9 -0
  274. data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/newton.h +36 -0
  275. data/ext/bigdecimal/math_r/internal/algo/bigmath/tan/branch.h +26 -0
  276. data/ext/bigdecimal/math_r/internal/algo/bigmath/tan/eulerf.h +11 -0
  277. data/ext/bigdecimal/math_r/internal/algo/bigmath/tan/ser.h +18 -0
  278. data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/branch.h +23 -0
  279. data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/eulerf.h +11 -0
  280. data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/formula.h +27 -0
  281. data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/ser.h +14 -0
  282. data/ext/bigdecimal/math_r/internal/algo/bigmath/trig/f_euler.h +290 -0
  283. data/ext/bigdecimal/math_r/log.c +256 -0
  284. data/ext/bigdecimal/math_r/logrep.c +537 -0
  285. data/ext/bigdecimal/math_r/math_r/bigdecimal.h +30 -0
  286. data/ext/bigdecimal/math_r/math_r/bigmath.h +61 -0
  287. data/ext/bigdecimal/math_r/math_r/bigmath_r.h +9 -0
  288. data/ext/bigdecimal/math_r/math_r/ext_extern.h +18 -0
  289. data/ext/bigdecimal/math_r/math_r/globals.h +71 -0
  290. data/ext/bigdecimal/math_r/math_r/numdiff.h +18 -0
  291. data/ext/bigdecimal/math_r/math_r/numeric.h +63 -0
  292. data/ext/bigdecimal/math_r/math_r.c +130 -0
  293. data/ext/bigdecimal/math_r/nucomp.c +158 -0
  294. data/ext/bigdecimal/math_r/overrides.c +91 -0
  295. data/ext/bigdecimal/math_r/power.c +207 -0
  296. data/ext/bigdecimal/math_r/solver.c +1516 -0
  297. data/ext/bigdecimal/math_r/trig.c +205 -0
  298. data/lib/bigdecimal/math_r/const/EulerGamma_engel.rb +46 -0
  299. data/lib/bigdecimal/math_r/const/LOG2_bbp2007.rb +39 -0
  300. data/lib/bigdecimal/math_r/const/PI_chudnovsky.rb +59 -0
  301. data/lib/bigdecimal/math_r/const/PI_euler.rb +40 -0
  302. data/lib/bigdecimal/math_r/const/PI_ramanujan1.rb +45 -0
  303. data/lib/bigdecimal/math_r/const/PI_ramanujan2.rb +46 -0
  304. data/lib/bigdecimal/math_r/const/b053977/b053977.txt +306 -0
  305. data/lib/bigdecimal/math_r/version.rb +7 -0
  306. data/lib/bigdecimal/math_r.rb +12 -0
  307. data/lib/bigdecimal/math_r.so +0 -0
  308. data/sig/bigdecimal/math_r.rbs +6 -0
  309. metadata +393 -0
@@ -0,0 +1,537 @@
1
+ /*******************************************************************************
2
+ logrep.c -- Logarithm Representations
3
+
4
+ Author: tribusonz
5
+ Licence: MIT
6
+ *******************************************************************************/
7
+ #include <ruby.h>
8
+ #include "math_r/globals.h"
9
+ #include "math_r/bigmath_r.h"
10
+ #include "decl.h"
11
+
12
+
13
+ /**
14
+ * Computes the inverse sine of +x+.
15
+ *
16
+ * @param x [Numeric] X-axis
17
+ * @param prec [Integer] Arbitrary precision
18
+ * @return [BigDecimal] Real solution
19
+ * @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
20
+ * @raise [TypeError] Occurs when +x+ is not a numeric class.
21
+ * @example
22
+ * BigMathR::LogRep.asin(BigDecimal('0.001'), 20) # Series expansion
23
+ * #=> 0.100000150000562503e-2
24
+ * BigMathR::LogRep.asin(BigDecimal('0.5'), 20) # Logarithmic reprensentation
25
+ * #=> 0.52359877559829887308e0
26
+ * @since 0.1.0
27
+ */
28
+ static VALUE
29
+ __impl_logrep_asin(VALUE unused_obj, VALUE x, VALUE prec)
30
+ {
31
+ return asin_branch(x, prec, asin_logrep);
32
+ }
33
+
34
+
35
+ /**
36
+ * Computes the inverse cosine of +x+.
37
+ *
38
+ * @param x [Numeric] X-axis
39
+ * @param prec [Integer] Arbitrary precision
40
+ * @return [BigDecimal] Real solution
41
+ * @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
42
+ * @raise [TypeError] Occurs when +x+ is not a numeric class.
43
+ * @example
44
+ * BigMathR::LogRep.acos(BigDecimal('0.001'), 20) # Series expansion
45
+ * #=> 0.15697963252948909942e1
46
+ * BigMathR::LogRep.acos(BigDecimal('0.5'), 20) # Logarithmic reprensentation
47
+ * #=> 0.10471975511965977462e1
48
+ * @since 0.1.0
49
+ */
50
+ static VALUE
51
+ __impl_logrep_acos(VALUE unused_obj, VALUE x, VALUE prec)
52
+ {
53
+ return acos_branch(x, prec, acos_logrep);
54
+ }
55
+
56
+ /**
57
+ * Computes the inverse tangent of +x+.
58
+ *
59
+ * @param x [Numeric] X-axis
60
+ * @param prec [Integer] Arbitrary precision
61
+ * @return [BigDecimal] Real solution
62
+ * @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
63
+ * @raise [TypeError] Occurs when +x+ is not a numeric class.
64
+ * @example
65
+ * -BigMathR::LogRep.atan(-1, 20).mult(4, 20)
66
+ * #=> 0.31415926535897932385e1
67
+ * @since 0.1.0
68
+ */
69
+ static VALUE
70
+ __impl_logrep_atan(VALUE unused_obj, VALUE x, VALUE prec)
71
+ {
72
+ return atan_branch(x, prec, atan_logrep);
73
+ }
74
+
75
+ /**
76
+ * Computes the inverse cosecant of +x+.
77
+ *
78
+ * @param x [Numeric] X-axis
79
+ * @param prec [Integer] Arbitrary precision
80
+ * @return [BigDecimal] Real solution
81
+ * @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
82
+ * @raise [TypeError] Occurs when +x+ is not a numeric class.
83
+ * @example
84
+ * BigMathR::LogRep.acsc(2, 20)
85
+ * #=> 0.52359877559829887308e0
86
+ * @since 0.1.0
87
+ */
88
+ static VALUE
89
+ __impl_logrep_acsc(VALUE unused_obj, VALUE x, VALUE prec)
90
+ {
91
+ return acsc_branch(x, prec, acsc_logrep);
92
+ }
93
+
94
+ /**
95
+ * Computes the inverse secant of +x+.
96
+ *
97
+ * @param x [Numeric] X-axis
98
+ * @param prec [Integer] Arbitrary precision
99
+ * @return [BigDecimal] Real solution
100
+ * @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
101
+ * @raise [TypeError] Occurs when +x+ is not a numeric class.
102
+ * @example
103
+ * BigMathR::LogRep.asec(2, 20)
104
+ * #=> 0.10471975511965977462e1
105
+ * @since 0.1.0
106
+ */
107
+ static VALUE
108
+ __impl_logrep_asec(VALUE unused_obj, VALUE x, VALUE prec)
109
+ {
110
+ return asec_branch(x, prec, asec_logrep);
111
+ }
112
+
113
+ /**
114
+ * Computes the inverse cotangent of +x+.
115
+ *
116
+ * @param x [Numeric] X-axis
117
+ * @param prec [Integer] Arbitrary precision
118
+ * @return [BigDecimal] Real solution
119
+ * @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
120
+ * @raise [TypeError] Occurs when +x+ is not a numeric class.
121
+ * @example
122
+ * BigMathR::LogRep.acot(1, 20) * 4
123
+ * #=> 0.314159265358979323852e1
124
+ * @since 0.1.0
125
+ */
126
+ static VALUE
127
+ __impl_logrep_acot(VALUE unused_obj, VALUE x, VALUE prec)
128
+ {
129
+ return acot_branch(x, prec, acot_logrep);
130
+ }
131
+
132
+ /**
133
+ * Computes inverse hyperbolic cotangent of +x+.
134
+ *
135
+ * @example
136
+ * BigMathR::LogRep.asinh(1/2000r, 20) # Series expansion
137
+ * #=> 0.49999997916666901e-3
138
+ * BigMathR::LogRep.asinh(1, 20) # Logarithmic representation
139
+ * #=> 0.88137358701954302523e0
140
+ * @param x [Numeric] Numerical argument
141
+ * @param prec [Integer] Arbitrary precision
142
+ * @return [BigDecimal] Real solution
143
+ * @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
144
+ * @raise [TypeError] Occurs when +x+ is not a numeric class.
145
+ * @since 0.1.0
146
+ */
147
+ static VALUE
148
+ __impl_logrep_asinh(VALUE unused_obj, VALUE x, VALUE prec)
149
+ {
150
+ return asinh_branch(x, prec, asinh_logrep);
151
+ }
152
+
153
+ /**
154
+ * Computes inverse hyperbolic cosine of +x+.
155
+ *
156
+ * @example
157
+ * BigMathR::LogSqrt.acosh(2, 20) # Logarithmic presentation
158
+ * #=> 0.13169578969248167086e1
159
+ * @param x [Numeric] Numerical argument
160
+ * @param prec [Integer] Arbitrary precision
161
+ * @return [BigDecimal] Real solution
162
+ * @raise [TypeError] +prec+ is not an Integer
163
+ * @raise [RangeError] +prec+ is zero or negative number
164
+ * @since 0.1.0
165
+ */
166
+ static VALUE
167
+ __impl_logrep_acosh(VALUE unused_obj, VALUE x, VALUE prec)
168
+ {
169
+ return acosh_branch(x, prec, acosh_logrep);
170
+ }
171
+
172
+ /**
173
+ * Computes inverse hyperbolic tangent of +x+.
174
+ *
175
+ * @example
176
+ * BigMathR::LogRep.atanh(1/3r, 20) # Series expansion
177
+ * #=> 0.3465735902799726547e0
178
+ * BigMathR::LogRep.atanh(9999/10000r, 20) # Logarithmic representation
179
+ * #=> 0.49517187756430431886e1
180
+ * @param x [Numeric] Numerical argument
181
+ * @param prec [Integer] Arbitrary precision
182
+ * @return [BigDecimal] Real solution
183
+ * @raise [TypeError] +prec+ is not an Integer
184
+ * @raise [RangeError] +prec+ is zero or negative number
185
+ * @since 0.1.0
186
+ */
187
+ static VALUE
188
+ __impl_logrep_atanh(VALUE unused_obj, VALUE x, VALUE prec)
189
+ {
190
+ return atanh_branch(x, prec, atanh_logrep);
191
+ }
192
+
193
+ /**
194
+ * Computes inverse hyperbolic cosecant of +x+.
195
+ *
196
+ * @example
197
+ * BigMathR::LogRep.acsch(1, 20)
198
+ * #=> 0.88137358701954302523e0
199
+ * @param x [Numeric] Numerical argument
200
+ * @param prec [Integer] Arbitrary precision
201
+ * @return [BigDecimal] Real solution
202
+ * @raise [TypeError] +prec+ is not an Integer
203
+ * @raise [RangeError] +prec+ is zero or negative number
204
+ * @since 0.1.0
205
+ */
206
+ static VALUE
207
+ __impl_logrep_acsch(VALUE unused_obj, VALUE x, VALUE prec)
208
+ {
209
+ return acsch_branch(x, prec, acsch_logrep);
210
+ }
211
+
212
+ /**
213
+ * Computes inverse hyperbolic secant of +x+.
214
+ *
215
+ * @example
216
+ * BigMathR::LogRep.asech(1/2r, 20)
217
+ * #=> 0.13169578969248167087e1
218
+ * @param x [Numeric] Numerical argument
219
+ * @param prec [Integer] Arbitrary precision
220
+ * @return [BigDecimal] Real solution
221
+ * @raise [TypeError] +prec+ is not an Integer
222
+ * @raise [RangeError] +prec+ is zero or negative number
223
+ * @since 0.1.0
224
+ */
225
+ static VALUE
226
+ __impl_logrep_asech(VALUE unused_obj, VALUE x, VALUE prec)
227
+ {
228
+ return asech_branch(x, prec, asech_logrep);
229
+ }
230
+
231
+ /**
232
+ * Computes inverse hyperbolic cotangent of +x+.
233
+ *
234
+ * @example
235
+ * BigMathR::LogRep.acoth(2, 20)
236
+ * #=> 0.54930614433405484568e0
237
+ * @param x [Numeric] Numerical argument
238
+ * @param prec [Integer] Arbitrary precision
239
+ * @return [BigDecimal] Real solution
240
+ * @raise [TypeError] +prec+ is not an Integer
241
+ * @raise [RangeError] +prec+ is zero or negative number
242
+ * @since 0.1.0
243
+ */
244
+ static VALUE
245
+ __impl_logrep_acoth(VALUE unused_obj, VALUE x, VALUE prec)
246
+ {
247
+ return acoth_branch(x, prec, acoth_logrep);
248
+ }
249
+
250
+ /**
251
+ * Computes complex inverse sine of +z+.
252
+ *
253
+ * @example
254
+ * BigMathR::LogRep.casin(1+1i, 20)
255
+ * #=> (0.6662394324925152551e0+0.1061275061905035652e1i)
256
+ * @param z [Numeric] Numerical argument
257
+ * @param prec [Integer] Arbitrary precision
258
+ * @return [Complex] Complex solution
259
+ * @raise [TypeError] +prec+ is not an Integer
260
+ * @raise [RangeError] +prec+ is zero or negative number
261
+ * @since 0.1.0
262
+ */
263
+ static VALUE
264
+ __impl_logrep_casin(VALUE unused_obj, VALUE z, VALUE prec)
265
+ {
266
+ return casin_branch(z, prec, casin_logrep);
267
+ }
268
+
269
+ /**
270
+ * Computes complex inverse cosine of +z+.
271
+ *
272
+ * @example
273
+ * BigMathR::LogRep.cacos(1+1i, 20)
274
+ * #=> (0.9045568943023813642e0-0.1061275061905035652e1i)
275
+ * @param z [Numeric] Numerical argument
276
+ * @param prec [Integer] Arbitrary precision
277
+ * @return [Complex] Complex solution
278
+ * @raise [TypeError] +prec+ is not an Integer
279
+ * @raise [RangeError] +prec+ is zero or negative number
280
+ * @since 0.1.0
281
+ */
282
+ static VALUE
283
+ __impl_logrep_cacos(VALUE unused_obj, VALUE z, VALUE prec)
284
+ {
285
+ return cacos_branch(z, prec, cacos_logrep);
286
+ }
287
+
288
+ /**
289
+ * Computes complex inverse tangent of +z+.
290
+ *
291
+ * @example
292
+ * BigMathR::LogRep.catan(1+1i, 20)
293
+ * #=> (0.10172219678978513678e1+0.40235947810852509365e0i)
294
+ * @param z [Numeric] Numerical argument
295
+ * @param prec [Integer] Arbitrary precision
296
+ * @return [Complex] Complex solution
297
+ * @raise [TypeError] +prec+ is not an Integer
298
+ * @raise [RangeError] +prec+ is zero or negative number
299
+ * @since 0.1.0
300
+ */
301
+ static VALUE
302
+ __impl_logrep_catan(VALUE unused_obj, VALUE z, VALUE prec)
303
+ {
304
+ return catan_branch(z, prec, catan_logrep);
305
+ }
306
+
307
+ /**
308
+ * Computes complex inverse cosecant of +z+.
309
+ *
310
+ * @example
311
+ * BigMathR::LogRep.cacsc(1+1i, 20)
312
+ * #=> (0.45227844715119068206e0-0.53063753095251782602e0i)
313
+ * @param z [Numeric] Numerical argument
314
+ * @param prec [Integer] Arbitrary precision
315
+ * @return [Complex] Complex solution
316
+ * @raise [TypeError] +prec+ is not an Integer
317
+ * @raise [RangeError] +prec+ is zero or negative number
318
+ * @since 0.1.0
319
+ */
320
+ static VALUE
321
+ __impl_logrep_cacsc(VALUE unused_obj, VALUE z, VALUE prec)
322
+ {
323
+ return cacsc_branch(z, prec, cacsc_logrep);
324
+ }
325
+
326
+ /**
327
+ * Computes complex inverse secant of +z+.
328
+ *
329
+ * @example
330
+ * BigMathR::LogRep.casec(1+1i, 20)
331
+ * #=> (0.11185178796437059372e1+0.53063753095251782602e0i)
332
+ * @param z [Numeric] Numerical argument
333
+ * @param prec [Integer] Arbitrary precision
334
+ * @return [Complex] Complex solution
335
+ * @raise [TypeError] +prec+ is not an Integer
336
+ * @raise [RangeError] +prec+ is zero or negative number
337
+ * @since 0.1.0
338
+ */
339
+ static VALUE
340
+ __impl_logrep_casec(VALUE unused_obj, VALUE z, VALUE prec)
341
+ {
342
+ return casec_branch(z, prec, casec_logrep);
343
+ }
344
+
345
+ /**
346
+ * Computes complex inverse cotangent of +z+.
347
+ *
348
+ * @example
349
+ * BigMathR::LogRep.cacot(1+1i, 20)
350
+ * #=> (0.55357435889704525152e0-0.40235947810852509365e0i)
351
+ * @param z [Numeric] Numerical argument
352
+ * @param prec [Integer] Arbitrary precision
353
+ * @return [Complex] Complex solution
354
+ * @raise [TypeError] +prec+ is not an Integer
355
+ * @raise [RangeError] +prec+ is zero or negative number
356
+ * @since 0.1.0
357
+ */
358
+ static VALUE
359
+ __impl_logrep_cacot(VALUE unused_obj, VALUE z, VALUE prec)
360
+ {
361
+ return cacot_branch(z, prec, cacot_logrep);
362
+ }
363
+
364
+ /**
365
+ * Computes complex inverse hyperbolic sine of +z+.
366
+ *
367
+ * @example
368
+ * BigMathR::LogSqrt.casinh(1+1i, 20)
369
+ * #=> (0.1061275061905035652e1+0.6662394324925152551e0i)
370
+ * @param z [Numeric] Numerical argument
371
+ * @param prec [Integer] Arbitrary precision
372
+ * @return [Complex] Complex solution
373
+ * @raise [TypeError] +prec+ is not an Integer
374
+ * @raise [RangeError] +prec+ is zero or negative number
375
+ * @since 0.1.0
376
+ */
377
+ static VALUE
378
+ __impl_logrep_casinh(VALUE unused_obj, VALUE z, VALUE prec)
379
+ {
380
+ return casinh_branch(z, prec, casinh_logrep);
381
+ }
382
+
383
+ /**
384
+ * Computes complex inverse hyperbolic cosine of +z+.
385
+ *
386
+ * @example
387
+ * BigMathR::LogSqrt.cacosh(1+1i, 20)
388
+ * #=> (0.1061275061905035652e1+0.9045568943023813642e0i)
389
+ * @param z [Numeric] Numerical argument
390
+ * @param prec [Integer] Arbitrary precision
391
+ * @return [Complex] Complex solution
392
+ * @raise [TypeError] +prec+ is not an Integer
393
+ * @raise [RangeError] +prec+ is zero or negative number
394
+ * @since 0.1.0
395
+ */
396
+ static VALUE
397
+ __impl_logrep_cacosh(VALUE unused_obj, VALUE z, VALUE prec)
398
+ {
399
+ return cacosh_branch(z, prec, cacosh_logrep);
400
+ }
401
+
402
+ /**
403
+ * Computes complex inverse hyperbolic tangent of +z+.
404
+ *
405
+ * @example
406
+ * BigMathR::LogRep.catanh(1+1i, 20)
407
+ * #=> (0.40235947810852509365e0+0.10172219678978513678e1i)
408
+ * @param z [Numeric] Numerical argument
409
+ * @param prec [Integer] Arbitrary precision
410
+ * @return [Complex] Complex solution
411
+ * @raise [TypeError] +prec+ is not an Integer
412
+ * @raise [RangeError] +prec+ is zero or negative number
413
+ * @since 0.1.0
414
+ */
415
+ static VALUE
416
+ __impl_logrep_catanh(VALUE unused_obj, VALUE z, VALUE prec)
417
+ {
418
+ return catanh_branch(z, prec, catanh_logrep);
419
+ }
420
+
421
+ /**
422
+ * Computes complex inverse hyperbolic cosecant of +z+.
423
+ *
424
+ * @example
425
+ * BigMathR::LogSqrt.cacsch(1+1i, 20)
426
+ * #=> (0.53063753095251782602e0-0.45227844715119068206e0i)
427
+ * @param z [Numeric] Numerical argument
428
+ * @param prec [Integer] Arbitrary precision
429
+ * @return [Complex] Complex solution
430
+ * @raise [TypeError] +prec+ is not an Integer
431
+ * @raise [RangeError] +prec+ is zero or negative number
432
+ * @since 0.1.0
433
+ */
434
+ static VALUE
435
+ __impl_logrep_cacsch(VALUE unused_obj, VALUE z, VALUE prec)
436
+ {
437
+ return cacsch_branch(z, prec, cacsch_logrep);
438
+ }
439
+
440
+ /**
441
+ * Computes complex inverse hyperbolic secant of +z+.
442
+ *
443
+ * @example
444
+ * BigMathR::LogRep.casech(1+1i, 20)
445
+ * #=> (0.53063753095251782602e0-0.11185178796437059372e1i)
446
+ * @param z [Numeric] Numerical argument
447
+ * @param prec [Integer] Arbitrary precision
448
+ * @return [Complex] Complex solution
449
+ * @raise [TypeError] +prec+ is not an Integer
450
+ * @raise [RangeError] +prec+ is zero or negative number
451
+ * @since 0.1.0
452
+ */
453
+ static VALUE
454
+ __impl_logrep_casech(VALUE unused_obj, VALUE z, VALUE prec)
455
+ {
456
+ return casech_branch(z, prec, casech_logrep);
457
+ }
458
+
459
+ /**
460
+ * Computes complex inverse hyperbolic cotangent of +z+.
461
+ *
462
+ * @example
463
+ * BigMathR::LogSqrt.cacoth(1+1i, 20)
464
+ * #=> (0.40235947810852509365e0-0.55357435889704525152e0i)
465
+ * @param z [Numeric] Numerical argument
466
+ * @param prec [Integer] Arbitrary precision
467
+ * @return [Complex] Complex solution
468
+ * @raise [TypeError] +prec+ is not an Integer
469
+ * @raise [RangeError] +prec+ is zero or negative number
470
+ * @since 0.1.0
471
+ */
472
+ static VALUE
473
+ __impl_logrep_cacoth(VALUE unused_obj, VALUE z, VALUE prec)
474
+ {
475
+ return cacoth_branch(z, prec, cacoth_logrep);
476
+ }
477
+
478
+
479
+ /**
480
+ * Document-module: BigMathR::LogRep
481
+ *
482
+ * A module that provides the logarithmic representations.
483
+ * It is used internally.
484
+ * <br>
485
+ * == Synopsis
486
+ * The function names defined are the same as those in the C/C++ standard.
487
+ * <br>
488
+ * - Inverse sine: +:asin+ +:casin+ <br>
489
+ * - Inverse cosine: +:acos+ +:cacos+ <br>
490
+ * - Inverse tangent: +:atan+ +:catan+ <br>
491
+ * - Inverse hyperbolic sine: +:asinh+ +:casinh+ <br>
492
+ * - Inverse hyperbolic cosine: +:acosh+ +:cacosh+ <br>
493
+ * - Inverse hyperbolic tangent: +:atanh+ +:catanh+ <br>
494
+ * Follow, the name defined in C/C++ standard though, the function names are different.
495
+ * <br>
496
+ * - Inverse cosecant: +:acsc+ +:cacsc+ <br>
497
+ * - Inverse secant: +:asec+ +:casec+ <br>
498
+ * - Inverse cotangent: +:acot+ +:cacot+ <br>
499
+ * - Inverse hyperbolic cosecant: +:acsch+ +:cacsch+ <br>
500
+ * - Inverse hyperbolic secant: +:asech+ +:casech+ <br>
501
+ * - Inverse hyperbolic cotangent: +:acoth+ +:cacoth+ <br>
502
+ * Reference::
503
+ * {https://mathworld.wolfram.com/NaturalLogarithm.html Wolfram Mathworld - Natural Logarithm}
504
+ */
505
+
506
+ void
507
+ InitVM_LogRep(void)
508
+ {
509
+ rb_define_module_function(rb_mLogRep, "asin", __impl_logrep_asin, 2);
510
+ rb_define_module_function(rb_mLogRep, "acos", __impl_logrep_acos, 2);
511
+ rb_define_module_function(rb_mLogRep, "atan", __impl_logrep_atan, 2);
512
+ rb_define_module_function(rb_mLogRep, "acsc", __impl_logrep_acsc, 2);
513
+ rb_define_module_function(rb_mLogRep, "asec", __impl_logrep_asec, 2);
514
+ rb_define_module_function(rb_mLogRep, "acot", __impl_logrep_acot, 2);
515
+
516
+ rb_define_module_function(rb_mLogRep, "asinh", __impl_logrep_asinh, 2);
517
+ rb_define_module_function(rb_mLogRep, "acosh", __impl_logrep_acosh, 2);
518
+ rb_define_module_function(rb_mLogRep, "atanh", __impl_logrep_atanh, 2);
519
+ rb_define_module_function(rb_mLogRep, "acsch", __impl_logrep_acsch, 2);
520
+ rb_define_module_function(rb_mLogRep, "asech", __impl_logrep_asech, 2);
521
+ rb_define_module_function(rb_mLogRep, "acoth", __impl_logrep_acoth, 2);
522
+
523
+ rb_define_module_function(rb_mLogRep, "casin", __impl_logrep_casin, 2);
524
+ rb_define_module_function(rb_mLogRep, "cacos", __impl_logrep_cacos, 2);
525
+ rb_define_module_function(rb_mLogRep, "catan", __impl_logrep_catan, 2);
526
+ rb_define_module_function(rb_mLogRep, "cacsc", __impl_logrep_cacsc, 2);
527
+ rb_define_module_function(rb_mLogRep, "casec", __impl_logrep_casec, 2);
528
+ rb_define_module_function(rb_mLogRep, "cacot", __impl_logrep_cacot, 2);
529
+
530
+ rb_define_module_function(rb_mLogRep, "casinh", __impl_logrep_casinh, 2);
531
+ rb_define_module_function(rb_mLogRep, "cacosh", __impl_logrep_cacosh, 2);
532
+ rb_define_module_function(rb_mLogRep, "catanh", __impl_logrep_catanh, 2);
533
+ rb_define_module_function(rb_mLogRep, "cacsch", __impl_logrep_cacsch, 2);
534
+ rb_define_module_function(rb_mLogRep, "casech", __impl_logrep_casech, 2);
535
+ rb_define_module_function(rb_mLogRep, "cacoth", __impl_logrep_cacoth, 2);
536
+
537
+ }
@@ -0,0 +1,30 @@
1
+ #ifndef INTERNAL_API_BIGDECIMAL
2
+ #define INTERNAL_API_BIGDECIMAL
3
+
4
+ /* API for BigDecimal */
5
+ void rb_check_precise(VALUE prec);
6
+
7
+ VALUE rb_big_zero(void);
8
+ #define BIG_ZERO rb_big_zero()
9
+ VALUE rb_big_minus_zero(void);
10
+ #define BIG_MINUS_ZERO rb_big_minus_zero()
11
+
12
+ VALUE rb_big_one(void);
13
+ #define BIG_ONE rb_big_one()
14
+ VALUE rb_big_minus_one(void);
15
+ #define BIG_MINUS_ONE rb_big_minus_one()
16
+
17
+ VALUE rb_big_infinity(void);
18
+ #define BIG_INF rb_big_infinity()
19
+ VALUE rb_big_minus_infinity(void);
20
+ #define BIG_MINUS_INF rb_big_minus_infinity()
21
+
22
+ VALUE rb_big_nan(void);
23
+ #define BIG_NAN rb_big_nan()
24
+
25
+ VALUE rb_BigDecimal(VALUE x, VALUE prec);
26
+ VALUE rb_BigDecimal1(VALUE x);
27
+ VALUE rb_BigDecimal_flo(VALUE x);
28
+ VALUE rb_BigDecimal_sign(VALUE d);
29
+
30
+ #endif /* INTERNAL_API_BIGDECIMAL */
@@ -0,0 +1,61 @@
1
+ #ifndef INTERNAL_API_BIGMATH
2
+ #define INTERNAL_API_BIGMATH
3
+
4
+ /* API for BigMath */
5
+ #define DEF_PREC 1000
6
+ #define BIGMATH_PI "$M_PI"
7
+ #define BIGMATH_E "$M_E"
8
+ #define BIGMATH_LOG2 "$M_LOG2"
9
+ #define BIGMATH_LOG10 "$M_LOG10"
10
+ #define BIGMATH_LOG_PI "$M_LOG_PI"
11
+ #define BIGMATH_SQRT2 "$M_SQRT2"
12
+ #define BIGMATH_SQRT3 "$M_SQRT3"
13
+
14
+ typedef VALUE (*bigmath_func1)(VALUE x, VALUE prec);
15
+ VALUE rb_bigmath_api_call1(VALUE x, VALUE prec, bigmath_func1 func_ptr);
16
+
17
+ typedef VALUE (*bigmath_func2)(VALUE x, VALUE y, VALUE prec);
18
+ VALUE rb_bigmath_api_call2(VALUE x, VALUE y, VALUE prec, bigmath_func2 func_ptr);
19
+
20
+ VALUE rb_bigmath_const(const char *gv, VALUE (*func)(VALUE prec), VALUE prec);
21
+ VALUE rb_bigmath_const_pi(VALUE prec);
22
+ VALUE rb_bigmath_const_log_pi(VALUE prec);
23
+ VALUE rb_bigmath_const_e(VALUE prec);
24
+ VALUE rb_bigmath_const_log2(VALUE prec);
25
+ VALUE rb_bigmath_const_log10(VALUE prec);
26
+ VALUE rb_bigmath_const_sqrt2(VALUE prec);
27
+ VALUE rb_bigmath_const_sqrt3(VALUE prec);
28
+
29
+ VALUE rb_bigmath_exp(VALUE x, VALUE prec);
30
+ VALUE rb_bigmath_cexp(VALUE z, VALUE prec);
31
+ VALUE rb_bigmath_expxt(VALUE x, VALUE t, VALUE prec);
32
+
33
+ VALUE rb_bigmath_log(VALUE x, VALUE prec);
34
+ VALUE rb_bigmath_clog(VALUE z, VALUE prec);
35
+
36
+ VALUE rb_bigmath_pow(VALUE x, VALUE y, VALUE prec);
37
+ VALUE rb_bigmath_cpow(VALUE z, VALUE w, VALUE prec);
38
+ VALUE rb_bigmath_ipow(VALUE x, VALUE n, VALUE exp);
39
+
40
+ void rb_bigmath_escalb(VALUE a, VALUE x, VALUE prec, VALUE *exp, VALUE *fra);
41
+
42
+ void rb_bigmath_sincos(VALUE x, VALUE prec, VALUE *sin, VALUE *cos);
43
+ int rb_bigmath_degree_sparg(VALUE t, VALUE prec, VALUE *sin, VALUE *cos);
44
+ VALUE rb_bigmath_to_rad(VALUE x, VALUE prec, VALUE *t);
45
+
46
+ VALUE rb_bigmath_atan(VALUE x, VALUE prec);
47
+ VALUE rb_bigmath_atan_adopt(VALUE x, VALUE prec, bigmath_func1 atan_cb);
48
+
49
+ VALUE rb_bigmath_quadrant(VALUE x, VALUE y, VALUE prec);
50
+
51
+ VALUE rb_bigmath_hypot(VALUE a, VALUE b, VALUE prec);
52
+
53
+ VALUE rb_bigmath_sqrt(VALUE x, VALUE prec);
54
+ VALUE rb_bigmath_csqrt(VALUE z, VALUE prec);
55
+
56
+ VALUE rb_bigmath_l2norm(VALUE vec, VALUE prec);
57
+
58
+ VALUE rb_bigmath_cabs(VALUE z, VALUE prec);
59
+ VALUE rb_bigmath_carg(VALUE z, VALUE prec);
60
+
61
+ #endif /* INTERNAL_API_BIGMATH */
@@ -0,0 +1,9 @@
1
+ #ifndef INTERNAL_BIGMATHR
2
+ #define INTERNAL_BIGMATHR
3
+
4
+ #include "numeric.h"
5
+ #include "bigdecimal.h"
6
+ #include "bigmath.h"
7
+ #include "numdiff.h"
8
+
9
+ #endif /* INTERNAL_BIGMATHR */
@@ -0,0 +1,18 @@
1
+ #ifndef RUBY_EXT_EXTERN_H_INCLUDED
2
+ #define RUBY_EXT_EXTERN_H_INCLUDED
3
+
4
+ #if defined(__cplusplus)
5
+ extern "C" {
6
+ #endif
7
+
8
+ #ifdef DEFINE_SYMBOL
9
+ # define RUBY_EXT_EXTERN
10
+ #else
11
+ # define RUBY_EXT_EXTERN extern
12
+ #endif
13
+
14
+ #if defined(__cplusplus)
15
+ }
16
+ #endif
17
+
18
+ #endif /* RUBY_EXT_EXTERN_H_INCLUDED */