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.
- checksums.yaml +7 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +13 -0
- data/changelog.md +24 -0
- data/ext/bigdecimal/math_r/algofunc.h +203 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/check_precise.h +12 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/infinity.h +6 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/minus_infinity.h +5 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/minus_one.h +6 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/minus_zero.h +6 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/nan.h +6 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/one.h +6 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/sign.h +10 -0
- data/ext/bigdecimal/math_r/api/bigdecimal/zero.h +6 -0
- data/ext/bigdecimal/math_r/api/bigmath/api_call1.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/api_call2.h +6 -0
- data/ext/bigdecimal/math_r/api/bigmath/atan.h +7 -0
- data/ext/bigdecimal/math_r/api/bigmath/atan_adopt.h +42 -0
- data/ext/bigdecimal/math_r/api/bigmath/cabs.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/carg.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/cexp.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/clog.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/const.h +39 -0
- data/ext/bigdecimal/math_r/api/bigmath/const_e.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/const_log10.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/const_log2.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/const_log_pi.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/const_pi.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/const_sqrt2.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/const_sqrt3.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/cpow.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/csqrt.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/degree_sparg.h +199 -0
- data/ext/bigdecimal/math_r/api/bigmath/escalb.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/exp.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/expxt.h +18 -0
- data/ext/bigdecimal/math_r/api/bigmath/hypot.h +10 -0
- data/ext/bigdecimal/math_r/api/bigmath/ipow.h +14 -0
- data/ext/bigdecimal/math_r/api/bigmath/l2norm.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/log.h +7 -0
- data/ext/bigdecimal/math_r/api/bigmath/pow.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/quadrant.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/sincos.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/sqrt.h +5 -0
- data/ext/bigdecimal/math_r/api/bigmath/to_rad.h +41 -0
- data/ext/bigdecimal/math_r/api/kernel/rb_BigDecimal.h +6 -0
- data/ext/bigdecimal/math_r/api/kernel/rb_BigDecimal1.h +6 -0
- data/ext/bigdecimal/math_r/api/kernel/rb_BigDecimal_flo.h +9 -0
- data/ext/bigdecimal/math_r/api/kernel/rb_ImaginaryZ.h +8 -0
- data/ext/bigdecimal/math_r/api/numanalysis/condition_p.h +26 -0
- data/ext/bigdecimal/math_r/api/numanalysis/make_n.h +9 -0
- data/ext/bigdecimal/math_r/api/numeric/abs.h +7 -0
- data/ext/bigdecimal/math_r/api/numeric/canonicalize.h +140 -0
- data/ext/bigdecimal/math_r/api/numeric/cmpeql.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/equal_p.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/finite_p.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/imag.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/infinite_p.h +7 -0
- data/ext/bigdecimal/math_r/api/numeric/nan_p.h +5 -0
- data/ext/bigdecimal/math_r/api/numeric/negative_p.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/nonzero_p.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/notequal_p.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/numeric_p.h +5 -0
- data/ext/bigdecimal/math_r/api/numeric/positive_p.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/real.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/real_p.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/round.h +56 -0
- data/ext/bigdecimal/math_r/api/numeric/uminus.h +6 -0
- data/ext/bigdecimal/math_r/api/numeric/zero_p.h +6 -0
- data/ext/bigdecimal/math_r/api.c +13 -0
- data/ext/bigdecimal/math_r/api.h +69 -0
- data/ext/bigdecimal/math_r/const.c +186 -0
- data/ext/bigdecimal/math_r/decl.h +203 -0
- data/ext/bigdecimal/math_r/edf.c +180 -0
- data/ext/bigdecimal/math_r/erf.c +80 -0
- data/ext/bigdecimal/math_r/euler_f.c +572 -0
- data/ext/bigdecimal/math_r/exp.c +72 -0
- data/ext/bigdecimal/math_r/extconf.rb +185 -0
- data/ext/bigdecimal/math_r/gamma_r.c +251 -0
- data/ext/bigdecimal/math_r/hyperb.c +172 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/E/ser.h +22 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/LOG10/ser.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/LOG2/BBP2002.h +36 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/LOG_PI/builtin.h +7 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/PI/machin.h +48 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/SQRT2/builtin.h +5 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/SQRT3/builtin.h +5 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/branch.h +25 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/edom.h +15 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/logrep.h +19 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/ser.h +34 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acosh/branch.h +19 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acosh/edom.h +17 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acosh/logrep.h +14 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acot/branch.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acot/logrep.h +13 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acoth/branch.h +20 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acoth/edom.h +18 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acoth/logrep.h +33 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acsc/branch.h +21 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acsc/edom.h +20 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acsc/logrep.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acsch/branch.h +25 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acsch/logrep.h +25 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asec/branch.h +22 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asec/edom.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asec/logrep.h +21 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/branch.h +18 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/edom.h +19 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/logrep.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/branch.h +22 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/edom.h +20 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/logrep.h +15 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/ser.h +32 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asinh/branch.h +26 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asinh/logrep.h +24 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asinh/ser.h +48 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/branch.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/logrep.h +14 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/ser_euler.h +84 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atan/ser_usual.h +41 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/branch.h +24 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/edom.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/logrep.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/ser.h +33 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cabs/formula.h +8 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacos/branch.h +38 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacos/logrep.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacosh/branch.h +34 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacosh/logrep.h +17 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacot/branch.h +39 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacot/logrep.h +17 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacoth/branch.h +29 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacoth/logrep.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsc/branch.h +28 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsc/logrep.h +19 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsch/branch.h +18 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cacsch/logrep.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/carg/formula.h +8 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casec/branch.h +29 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casec/logrep.h +18 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casech/branch.h +38 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casech/logrep.h +9 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casin/branch.h +35 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casin/logrep.h +14 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casinh/branch.h +59 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/casinh/logrep.h +13 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/catan/branch.h +46 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/catan/logrep.h +17 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/catanh/branch.h +26 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/catanh/logrep.h +10 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccbrt/formula.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccos/branch.h +41 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccos/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccosh/branch.h +37 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccosh/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccot/branch.h +46 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccot/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccoth/branch.h +43 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccoth/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsc/branch.h +42 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsc/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsch/branch.h +38 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ccsch/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp/branch.h +42 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp/eulerf.h +21 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp2/branch.h +42 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cexp2/eulerf.h +12 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/clog/branch.h +54 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/clog/formula.h +13 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/clog10/formula.h +12 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/clog1p/branch.h +34 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/clog2/formula.h +12 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cos/branch.h +21 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cos/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cos/ser.h +12 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/branch.h +22 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/formula.h +30 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cosh/ser.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cot/branch.h +28 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cot/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cot/ser.h +12 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/branch.h +23 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/formula.h +30 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/coth/ser.h +13 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cpow/formula.h +20 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csc/branch.h +28 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csc/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csc/ser.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/branch.h +23 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/formula.h +31 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csch/ser.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csec/branch.h +42 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csec/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csech/branch.h +38 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csech/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csin/branch.h +44 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csin/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csinh/branch.h +41 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csinh/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/csqrt/formula.h +66 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ctan/branch.h +46 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ctan/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ctanh/branch.h +43 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ctanh/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/cuberoot/newton.h +42 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/algo911.h +41 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/branch.h +18 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/cf.h +51 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/ser_inf.h +53 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erf/ser_zero.h +45 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erfc/algo911.h +27 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erfc/branch.h +18 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/erfc/cf.h +49 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/escalb/edf.h +87 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/exp/branch.h +29 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/exp/builtin.h +6 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/exp/edf.h +23 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/exp2/branch.h +29 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/exp2/edf.h +19 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/expxt/edf.h +31 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/f_euler/formula.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/hypot/branch.h +25 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/hypot/l2norm.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/hypot/mmm.h +38 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/ipow/edf.h +33 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/l2norm/formula.h +48 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log/branch.h +40 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log/builtin.h +12 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log/edf.h +10 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log/edom.h +10 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log/mercator.h +34 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log/ser_okumura.h +57 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log10/branch.h +40 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log10/edf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log10/mercator.h +35 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log1p/branch.h +34 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log1p/p_adic.h +37 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log1p/ser_mercator.h +35 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log2/branch.h +40 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log2/edf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/log2/mercator.h +35 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/logxt/edf.h +33 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/pow/formula.h +30 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/quadrant/formula.h +352 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/rcm10/edf.h +34 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/rcm2/edf.h +34 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sec/branch.h +27 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sec/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sec/ser.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/branch.h +21 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/formula.h +25 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sech/ser.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sin/branch.h +23 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sin/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sin/ser.h +13 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sincos/ser.h +50 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/branch.h +23 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/formula.h +26 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sinh/ser.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sinhcosh/ser.h +70 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/branch.h +16 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/builtin.h +12 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/edom.h +9 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/sqrt/newton.h +36 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/tan/branch.h +26 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/tan/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/tan/ser.h +18 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/branch.h +23 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/eulerf.h +11 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/formula.h +27 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/tanh/ser.h +14 -0
- data/ext/bigdecimal/math_r/internal/algo/bigmath/trig/f_euler.h +290 -0
- data/ext/bigdecimal/math_r/log.c +256 -0
- data/ext/bigdecimal/math_r/logrep.c +537 -0
- data/ext/bigdecimal/math_r/math_r/bigdecimal.h +30 -0
- data/ext/bigdecimal/math_r/math_r/bigmath.h +61 -0
- data/ext/bigdecimal/math_r/math_r/bigmath_r.h +9 -0
- data/ext/bigdecimal/math_r/math_r/ext_extern.h +18 -0
- data/ext/bigdecimal/math_r/math_r/globals.h +71 -0
- data/ext/bigdecimal/math_r/math_r/numdiff.h +18 -0
- data/ext/bigdecimal/math_r/math_r/numeric.h +63 -0
- data/ext/bigdecimal/math_r/math_r.c +130 -0
- data/ext/bigdecimal/math_r/nucomp.c +158 -0
- data/ext/bigdecimal/math_r/overrides.c +91 -0
- data/ext/bigdecimal/math_r/power.c +207 -0
- data/ext/bigdecimal/math_r/solver.c +1516 -0
- data/ext/bigdecimal/math_r/trig.c +205 -0
- data/lib/bigdecimal/math_r/const/EulerGamma_engel.rb +46 -0
- data/lib/bigdecimal/math_r/const/LOG2_bbp2007.rb +39 -0
- data/lib/bigdecimal/math_r/const/PI_chudnovsky.rb +59 -0
- data/lib/bigdecimal/math_r/const/PI_euler.rb +40 -0
- data/lib/bigdecimal/math_r/const/PI_ramanujan1.rb +45 -0
- data/lib/bigdecimal/math_r/const/PI_ramanujan2.rb +46 -0
- data/lib/bigdecimal/math_r/const/b053977/b053977.txt +306 -0
- data/lib/bigdecimal/math_r/version.rb +7 -0
- data/lib/bigdecimal/math_r.rb +12 -0
- data/lib/bigdecimal/math_r.so +0 -0
- data/sig/bigdecimal/math_r.rbs +6 -0
- metadata +393 -0
@@ -0,0 +1,572 @@
|
|
1
|
+
/*******************************************************************************
|
2
|
+
euler_f.c -- Euler's formula
|
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 complex exponential function of +z+.
|
15
|
+
*
|
16
|
+
* @param z [Numeric] Numerical argument
|
17
|
+
* @param prec [Integer] Arbitrary precision
|
18
|
+
* @return [Complex] Complex solution
|
19
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
20
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
21
|
+
* @example
|
22
|
+
* BigMathR::EulerF.cexp(1+1i, 20)
|
23
|
+
* #=> (0.14686939399158851572e1+0.22873552871788423912e1i)
|
24
|
+
* @since 0.1.0
|
25
|
+
*/
|
26
|
+
static VALUE
|
27
|
+
__impl_eulerf_cexp(VALUE unused_obj, VALUE z, VALUE prec)
|
28
|
+
{
|
29
|
+
return cexp_branch(z, prec, cexp_eulerf);
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Computes complex binary exponent of +z+.
|
35
|
+
*
|
36
|
+
* @param z [Numeric] Numerical argument
|
37
|
+
* @param prec [Integer] Arbitrary precision
|
38
|
+
* @return [Complex] Complex solution
|
39
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
40
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
41
|
+
* @example
|
42
|
+
* BigMathR::EulerF.cexp2(1+1i, 20)
|
43
|
+
* #=> (0.15384778027279442532e1+0.12779225526272696023e1i)
|
44
|
+
* @since 0.1.0
|
45
|
+
*/
|
46
|
+
static VALUE
|
47
|
+
__impl_eulerf_cexp2(VALUE unused_obj, VALUE z, VALUE prec)
|
48
|
+
{
|
49
|
+
return cexp2_branch(z, prec, cexp2_eulerf);
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Computes sine of +x+.
|
54
|
+
*
|
55
|
+
* @param x [Numeric] Numerical argument
|
56
|
+
* @param prec [Integer] Arbitrary precision
|
57
|
+
* @return [Complex] Complex solution
|
58
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
59
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
60
|
+
* @example
|
61
|
+
* BigMathR::EulerF.sin(1, 20)
|
62
|
+
* #=> 0.84147098480789650665e0
|
63
|
+
* @since 0.1.0
|
64
|
+
*/
|
65
|
+
static VALUE
|
66
|
+
__impl_eulerf_sin(VALUE unused_obj, VALUE x, VALUE prec)
|
67
|
+
{
|
68
|
+
return sin_branch(x, prec, sin_eulerf);
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Computes cosine of +x+.
|
73
|
+
*
|
74
|
+
* @param x [Numeric] Numerical argument
|
75
|
+
* @param prec [Integer] Arbitrary precision
|
76
|
+
* @return [Complex] Complex solution
|
77
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
78
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
79
|
+
* @example
|
80
|
+
* BigMathR::EulerF.cos(1, 20)
|
81
|
+
* #=> 0.5403023058681397174e0
|
82
|
+
* @since 0.1.0
|
83
|
+
*/
|
84
|
+
static VALUE
|
85
|
+
__impl_eulerf_cos(VALUE unused_obj, VALUE x, VALUE prec)
|
86
|
+
{
|
87
|
+
return cos_branch(x, prec, cos_eulerf);
|
88
|
+
}
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Computes tangent of +x+.
|
92
|
+
*
|
93
|
+
* @param x [Numeric] Numerical argument
|
94
|
+
* @param prec [Integer] Arbitrary precision
|
95
|
+
* @return [Complex] Complex solution
|
96
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
97
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
98
|
+
* @example
|
99
|
+
* BigMathR::EulerF.tan(1, 20)
|
100
|
+
* #=> 0.15574077246549022305e1
|
101
|
+
* @since 0.1.0
|
102
|
+
*/
|
103
|
+
static VALUE
|
104
|
+
__impl_eulerf_tan(VALUE unused_obj, VALUE x, VALUE prec)
|
105
|
+
{
|
106
|
+
return tan_branch(x, prec, tan_eulerf);
|
107
|
+
}
|
108
|
+
|
109
|
+
/**
|
110
|
+
* Computes cosecant of +x+.
|
111
|
+
*
|
112
|
+
* @param x [Numeric] Numerical argument
|
113
|
+
* @param prec [Integer] Arbitrary precision
|
114
|
+
* @return [Complex] Complex solution
|
115
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
116
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
117
|
+
* @example
|
118
|
+
* BigMathR::EulerF.csc(1, 20)
|
119
|
+
* #=> 0.11883951057781212163e1
|
120
|
+
* @since 0.1.0
|
121
|
+
*/
|
122
|
+
static VALUE
|
123
|
+
__impl_eulerf_csc(VALUE unused_obj, VALUE x, VALUE prec)
|
124
|
+
{
|
125
|
+
return csc_branch(x, prec, csc_eulerf);
|
126
|
+
}
|
127
|
+
|
128
|
+
/**
|
129
|
+
* Computes secant of +x+.
|
130
|
+
*
|
131
|
+
* @param x [Numeric] Numerical argument
|
132
|
+
* @param prec [Integer] Arbitrary precision
|
133
|
+
* @return [Complex] Complex solution
|
134
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
135
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
136
|
+
* @example
|
137
|
+
* BigMathR::EulerF.sec(1, 20)
|
138
|
+
* #=> 0.18508157176809256179e1
|
139
|
+
* @since 0.1.0
|
140
|
+
*/
|
141
|
+
static VALUE
|
142
|
+
__impl_eulerf_sec(VALUE unused_obj, VALUE x, VALUE prec)
|
143
|
+
{
|
144
|
+
return sec_branch(x, prec, sec_eulerf);
|
145
|
+
}
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Computes cotangent of +x+.
|
149
|
+
*
|
150
|
+
* @param x [Numeric] Numerical argument
|
151
|
+
* @param prec [Integer] Arbitrary precision
|
152
|
+
* @return [Complex] Complex solution
|
153
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
154
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
155
|
+
* @example
|
156
|
+
* BigMathR::EulerF.cot(1, 20)
|
157
|
+
* #=> 0.64209261593433070301e0
|
158
|
+
* @since 0.1.0
|
159
|
+
*/
|
160
|
+
static VALUE
|
161
|
+
__impl_eulerf_cot(VALUE unused_obj, VALUE x, VALUE prec)
|
162
|
+
{
|
163
|
+
return cot_branch(x, prec, cot_eulerf);
|
164
|
+
}
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Computes complex sine of +z+.
|
168
|
+
*
|
169
|
+
* @param z [Numeric] Numerical argument
|
170
|
+
* @param prec [Integer] Arbitrary precision
|
171
|
+
* @return [Complex] Complex solution
|
172
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
173
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
174
|
+
* @example
|
175
|
+
* BigMathR::EulerF.csin(1+1i, 20)
|
176
|
+
* #=> (0.12984575814159772948e1+0.63496391478473610827e0i)
|
177
|
+
* @since 0.1.0
|
178
|
+
*/
|
179
|
+
static VALUE
|
180
|
+
__impl_eulerf_csin(VALUE unused_obj, VALUE z, VALUE prec)
|
181
|
+
{
|
182
|
+
return csin_branch(z, prec, csin_eulerf);
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Computes complex cosine of +z+.
|
187
|
+
*
|
188
|
+
* @param z [Numeric] Numerical argument
|
189
|
+
* @param prec [Integer] Arbitrary precision
|
190
|
+
* @return [Complex] Complex solution
|
191
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
192
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
193
|
+
* @example
|
194
|
+
* BigMathR::EulerF.ccos(1+1i, 20)
|
195
|
+
* #=> (0.83373002513114904889e0-0.9888977057628650964e0i)
|
196
|
+
* @since 0.1.0
|
197
|
+
*/
|
198
|
+
static VALUE
|
199
|
+
__impl_eulerf_ccos(VALUE unused_obj, VALUE z, VALUE prec)
|
200
|
+
{
|
201
|
+
return ccos_branch(z, prec, ccos_eulerf);
|
202
|
+
}
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Computes complex tangent of +z+.
|
206
|
+
*
|
207
|
+
* @param z [Numeric] Numerical argument
|
208
|
+
* @param prec [Integer] Arbitrary precision
|
209
|
+
* @return [Complex] Complex solution
|
210
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
211
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
212
|
+
* @example
|
213
|
+
* BigMathR::EulerF.ctan(1+1i, 20)
|
214
|
+
* #=> (0.27175258531951171652e0+0.10839233273386945435e1i)
|
215
|
+
* @since 0.1.0
|
216
|
+
*/
|
217
|
+
static VALUE
|
218
|
+
__impl_eulerf_ctan(VALUE unused_obj, VALUE z, VALUE prec)
|
219
|
+
{
|
220
|
+
return ctan_branch(z, prec, ctan_eulerf);
|
221
|
+
}
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Computes complex cosecant of +z+.
|
225
|
+
*
|
226
|
+
* @param z [Numeric] Numerical argument
|
227
|
+
* @param prec [Integer] Arbitrary precision
|
228
|
+
* @return [Complex] Complex solution
|
229
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
230
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
231
|
+
* @example
|
232
|
+
* BigMathR::EulerF.ccsc(1+1i, 20)
|
233
|
+
* #=> (0.62151801717042842124e0-0.30393100162842645035e0i)
|
234
|
+
* @since 0.1.0
|
235
|
+
*/
|
236
|
+
static VALUE
|
237
|
+
__impl_eulerf_ccsc(VALUE unused_obj, VALUE z, VALUE prec)
|
238
|
+
{
|
239
|
+
return ccsc_branch(z, prec, ccsc_eulerf);
|
240
|
+
}
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Computes complex secant of +z+.
|
244
|
+
*
|
245
|
+
* @param z [Numeric] Numerical argument
|
246
|
+
* @param prec [Integer] Arbitrary precision
|
247
|
+
* @return [Complex] Complex solution
|
248
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
249
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
250
|
+
* @example
|
251
|
+
* BigMathR::EulerF.csec(1+1i, 20)
|
252
|
+
* #=> (0.4983370305551867852e0+0.59108384172104504804e0i)
|
253
|
+
* @since 0.1.0
|
254
|
+
*/
|
255
|
+
static VALUE
|
256
|
+
__impl_eulerf_csec(VALUE unused_obj, VALUE z, VALUE prec)
|
257
|
+
{
|
258
|
+
return csec_branch(z, prec, csec_eulerf);
|
259
|
+
}
|
260
|
+
|
261
|
+
/**
|
262
|
+
* Computes complex cotangent of +z+.
|
263
|
+
*
|
264
|
+
* @param z [Numeric] Numerical argument
|
265
|
+
* @param prec [Integer] Arbitrary precision
|
266
|
+
* @return [Complex] Complex solution
|
267
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
268
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
269
|
+
* @example
|
270
|
+
* BigMathR::EulerF.ccot(1+1i, 20)
|
271
|
+
* #=> (0.21762156185440268135e0-0.86801414289592494862e0i)
|
272
|
+
* @since 0.1.0
|
273
|
+
*/
|
274
|
+
static VALUE
|
275
|
+
__impl_eulerf_ccot(VALUE unused_obj, VALUE z, VALUE prec)
|
276
|
+
{
|
277
|
+
return ccot_branch(z, prec, ccot_eulerf);
|
278
|
+
}
|
279
|
+
|
280
|
+
/**
|
281
|
+
* Computes hyperbolic sine of +x+.
|
282
|
+
*
|
283
|
+
* @param x [Numeric] Numerical argument
|
284
|
+
* @param prec [Integer] Arbitrary precision
|
285
|
+
* @return [BigDecimal] Real solution
|
286
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
287
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
288
|
+
* @example
|
289
|
+
* BigMathR::EulerF.sinh(1, 20)
|
290
|
+
* #=> 0.11752011936438014569e1
|
291
|
+
* @since 0.1.0
|
292
|
+
*/
|
293
|
+
static VALUE
|
294
|
+
__impl_eulerf_sinh(VALUE unused_obj, VALUE x, VALUE prec)
|
295
|
+
{
|
296
|
+
return sinh_branch(x, prec, sinh_eulerf);
|
297
|
+
}
|
298
|
+
|
299
|
+
/**
|
300
|
+
* Computes hyperbolic cosine of +x+.
|
301
|
+
*
|
302
|
+
* @param x [Numeric] Numerical argument
|
303
|
+
* @param prec [Integer] Arbitrary precision
|
304
|
+
* @return [BigDecimal] Real solution
|
305
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
306
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
307
|
+
* @example
|
308
|
+
* BigMathR::EulerF.cosh(1, 20)
|
309
|
+
* #=> 0.15430806348152437785e1
|
310
|
+
* @since 0.1.0
|
311
|
+
*/
|
312
|
+
static VALUE
|
313
|
+
__impl_eulerf_cosh(VALUE unused_obj, VALUE x, VALUE prec)
|
314
|
+
{
|
315
|
+
return cosh_branch(x, prec, cosh_eulerf);
|
316
|
+
}
|
317
|
+
|
318
|
+
/**
|
319
|
+
* Computes hyperbolic tangent of +x+.
|
320
|
+
*
|
321
|
+
* @param x [Numeric] Numerical argument
|
322
|
+
* @param prec [Integer] Arbitrary precision
|
323
|
+
* @return [BigDecimal] Real solution
|
324
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
325
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
326
|
+
* @example
|
327
|
+
* BigMathR::EulerF.tanh(1, 20)
|
328
|
+
* #=> 0.76159415595576488813e0
|
329
|
+
* @since 0.1.0
|
330
|
+
*/
|
331
|
+
static VALUE
|
332
|
+
__impl_eulerf_tanh(VALUE unused_obj, VALUE x, VALUE prec)
|
333
|
+
{
|
334
|
+
return tanh_branch(x, prec, tanh_eulerf);
|
335
|
+
}
|
336
|
+
|
337
|
+
/**
|
338
|
+
* Computes hyperbolic cosecant of +x+.
|
339
|
+
*
|
340
|
+
* @param x [Numeric] Numerical argument
|
341
|
+
* @param prec [Integer] Arbitrary precision
|
342
|
+
* @return [BigDecimal] Real solution
|
343
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
344
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
345
|
+
* @example
|
346
|
+
* BigMathR::EulerF.csch(1, 20)
|
347
|
+
* #=> 0.85091812823932154512e0
|
348
|
+
* @since 0.1.0
|
349
|
+
*/
|
350
|
+
static VALUE
|
351
|
+
__impl_eulerf_csch(VALUE unused_obj, VALUE x, VALUE prec)
|
352
|
+
{
|
353
|
+
return csch_branch(x, prec, csch_eulerf);
|
354
|
+
}
|
355
|
+
|
356
|
+
/**
|
357
|
+
* Computes hyperbolic secant of +x+.
|
358
|
+
*
|
359
|
+
* @param x [Numeric] Numerical argument
|
360
|
+
* @param prec [Integer] Arbitrary precision
|
361
|
+
* @return [BigDecimal] Real solution
|
362
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
363
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
364
|
+
* @example
|
365
|
+
* BigMathR::EulerF.sech(1, 20)
|
366
|
+
* #=> 0.64805427366388539957e0
|
367
|
+
* @since 0.1.0
|
368
|
+
*/
|
369
|
+
static VALUE
|
370
|
+
__impl_eulerf_sech(VALUE unused_obj, VALUE x, VALUE prec)
|
371
|
+
{
|
372
|
+
return sech_branch(x, prec, sech_eulerf);
|
373
|
+
}
|
374
|
+
|
375
|
+
/**
|
376
|
+
* Computes hyperbolic cotangent of +x+.
|
377
|
+
*
|
378
|
+
* @param x [Numeric] Numerical argument
|
379
|
+
* @param prec [Integer] Arbitrary precision
|
380
|
+
* @return [BigDecimal] Real solution
|
381
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
382
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
383
|
+
* @example
|
384
|
+
* BigMathR::EulerF.coth(1, 20)
|
385
|
+
* #=> 0.13130352854993313036e1
|
386
|
+
* @since 0.1.0
|
387
|
+
*/
|
388
|
+
static VALUE
|
389
|
+
__impl_eulerf_coth(VALUE unused_obj, VALUE x, VALUE prec)
|
390
|
+
{
|
391
|
+
return coth_branch(x, prec, coth_eulerf);
|
392
|
+
}
|
393
|
+
|
394
|
+
/**
|
395
|
+
* Computes complex hyperbolic sine of +z+.
|
396
|
+
*
|
397
|
+
* @param z [Numeric] Numerical argument
|
398
|
+
* @param prec [Integer] Arbitrary precision
|
399
|
+
* @return [Complex] Complex solution
|
400
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
401
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
402
|
+
* @example
|
403
|
+
* BigMathR::EulerF.csinh(1+1i, 20)
|
404
|
+
* #=> (0.63496391478473610827e0+0.12984575814159772948e1i)
|
405
|
+
* @since 0.1.0
|
406
|
+
*/
|
407
|
+
static VALUE
|
408
|
+
__impl_eulerf_csinh(VALUE unused_obj, VALUE z, VALUE prec)
|
409
|
+
{
|
410
|
+
return csinh_branch(z, prec, csinh_eulerf);
|
411
|
+
}
|
412
|
+
|
413
|
+
/**
|
414
|
+
* Computes complex hyperbolic cosine of +z+.
|
415
|
+
*
|
416
|
+
* @param z [Numeric] Numerical argument
|
417
|
+
* @param prec [Integer] Arbitrary precision
|
418
|
+
* @return [Complex] Complex solution
|
419
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
420
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
421
|
+
* @example
|
422
|
+
* BigMathR::EulerF.ccosh(1+1i, 20)
|
423
|
+
* #=> (0.83373002513114904889e0+0.9888977057628650964e0i)
|
424
|
+
* @since 0.1.0
|
425
|
+
*/
|
426
|
+
static VALUE
|
427
|
+
__impl_eulerf_ccosh(VALUE unused_obj, VALUE z, VALUE prec)
|
428
|
+
{
|
429
|
+
return ccosh_branch(z, prec, ccosh_eulerf);
|
430
|
+
}
|
431
|
+
|
432
|
+
/**
|
433
|
+
* Computes complex hyperbolic tangent of +z+.
|
434
|
+
*
|
435
|
+
* @param z [Numeric] Numerical argument
|
436
|
+
* @param prec [Integer] Arbitrary precision
|
437
|
+
* @return [Complex] Complex solution
|
438
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
439
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
440
|
+
* @example
|
441
|
+
* BigMathR::EulerF.ctanh(1+1i, 20)
|
442
|
+
* #=> (0.10839233273386945435e1+0.27175258531951171652e0i)
|
443
|
+
* @since 0.1.0
|
444
|
+
*/
|
445
|
+
static VALUE
|
446
|
+
__impl_eulerf_ctanh(VALUE unused_obj, VALUE z, VALUE prec)
|
447
|
+
{
|
448
|
+
return ctanh_branch(z, prec, ctanh_eulerf);
|
449
|
+
}
|
450
|
+
|
451
|
+
/**
|
452
|
+
* Computes complex hyperbolic cosecant of +z+.
|
453
|
+
*
|
454
|
+
* @param z [Numeric] Numerical argument
|
455
|
+
* @param prec [Integer] Arbitrary precision
|
456
|
+
* @return [Complex] Complex solution
|
457
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
458
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
459
|
+
* @example
|
460
|
+
* BigMathR::EulerF.ccsch(1+1i, 20)
|
461
|
+
* #=> (0.30393100162842645035e0-0.62151801717042842124e0i)
|
462
|
+
* @since 0.1.0
|
463
|
+
*/
|
464
|
+
static VALUE
|
465
|
+
__impl_eulerf_ccsch(VALUE unused_obj, VALUE z, VALUE prec)
|
466
|
+
{
|
467
|
+
return ccsch_branch(z, prec, ccsch_eulerf);
|
468
|
+
}
|
469
|
+
|
470
|
+
/**
|
471
|
+
* Computes complex hyperbolic secant of +z+.
|
472
|
+
*
|
473
|
+
* @param z [Numeric] Numerical argument
|
474
|
+
* @param prec [Integer] Arbitrary precision
|
475
|
+
* @return [Complex] Complex solution
|
476
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
477
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
478
|
+
* @example
|
479
|
+
* BigMathR::EulerF.csech(1+1i, 20)
|
480
|
+
* #=> (0.4983370305551867852e0-0.59108384172104504804e0i)
|
481
|
+
* @since 0.1.0
|
482
|
+
*/
|
483
|
+
static VALUE
|
484
|
+
__impl_eulerf_csech(VALUE unused_obj, VALUE z, VALUE prec)
|
485
|
+
{
|
486
|
+
return csech_branch(z, prec, csech_eulerf);
|
487
|
+
}
|
488
|
+
|
489
|
+
/**
|
490
|
+
* Computes complex hyperbolic cotangent of +z+.
|
491
|
+
*
|
492
|
+
* @param z [Numeric] Numerical argument
|
493
|
+
* @param prec [Integer] Arbitrary precision
|
494
|
+
* @return [Complex] Complex solution
|
495
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
496
|
+
* @raise [TypeError] Occurs when +z+ is not a numeric class.
|
497
|
+
* @example
|
498
|
+
* BigMathR::EulerF.ccoth(1+1i, 20)
|
499
|
+
* #=> (0.86801414289592494862e0-0.21762156185440268135e0i)
|
500
|
+
* @since 0.1.0
|
501
|
+
*/
|
502
|
+
static VALUE
|
503
|
+
__impl_eulerf_ccoth(VALUE unused_obj, VALUE z, VALUE prec)
|
504
|
+
{
|
505
|
+
return ccoth_branch(z, prec, ccoth_eulerf);
|
506
|
+
}
|
507
|
+
|
508
|
+
/**
|
509
|
+
* Document-module: BigMathR::EulerF
|
510
|
+
*
|
511
|
+
* A module that provides using Euler's formula.
|
512
|
+
* It is used internally.
|
513
|
+
* <br>
|
514
|
+
* By using this formula for complex analysis,
|
515
|
+
* it can be applied to differential equations and Fourier transforms.
|
516
|
+
* <br>
|
517
|
+
* == Synopsis
|
518
|
+
* The function names defined are the same as those in the C/C++ standard.
|
519
|
+
* <br>
|
520
|
+
* - Exponential function: +:cexp+ <br>
|
521
|
+
* - Base-2 (Binary) exponent: +:cexp2+ <br>
|
522
|
+
* - Sine: +:sin+ +:csin+ <br>
|
523
|
+
* - Cosine: +:cos+ +:ccos+ <br>
|
524
|
+
* - Tangent: +:tan+ +:ctan+ <br>
|
525
|
+
* - Hyperbolic sine: +:sinh+ +:csinh+ <br>
|
526
|
+
* - Hyperbolic cosine: +:cosh+ +:ccosh+ <br>
|
527
|
+
* - Hyperbolic tangent: +:tanh+ +:ctanh+ <br>
|
528
|
+
* Follow, those reciprocals of not defined in C/C++ standard.
|
529
|
+
* <br>
|
530
|
+
* - Cosecant: +:csc+ +:ccsc+ <br>
|
531
|
+
* - Secant: +:sec+ +:csec+ <br>
|
532
|
+
* - Cotangent: +:cot+ +:ccot+ <br>
|
533
|
+
* - Hyperbolic cosecant: +:csch+ +:ccsch+ <br>
|
534
|
+
* - Hyperbolic secant: +:sech+ +:csech+ <br>
|
535
|
+
* - Hyperbolic cotangent: +:coth+ +:ccoth+ <br>
|
536
|
+
* Reference::
|
537
|
+
* Kiso kara hatten made Sankaku kansuu (Japanese) - Michimasa Kobayashi (Beret Shuppan)
|
538
|
+
*/
|
539
|
+
void
|
540
|
+
InitVM_EulerF(void)
|
541
|
+
{
|
542
|
+
rb_define_module_function(rb_mEulerF, "cexp", __impl_eulerf_cexp, 2);
|
543
|
+
rb_define_module_function(rb_mEulerF, "cexp2", __impl_eulerf_cexp2, 2);
|
544
|
+
|
545
|
+
rb_define_module_function(rb_mEulerF, "sin", __impl_eulerf_sin, 2);
|
546
|
+
rb_define_module_function(rb_mEulerF, "cos", __impl_eulerf_cos, 2);
|
547
|
+
rb_define_module_function(rb_mEulerF, "tan", __impl_eulerf_tan, 2);
|
548
|
+
rb_define_module_function(rb_mEulerF, "csc", __impl_eulerf_csc, 2);
|
549
|
+
rb_define_module_function(rb_mEulerF, "sec", __impl_eulerf_sec, 2);
|
550
|
+
rb_define_module_function(rb_mEulerF, "cot", __impl_eulerf_cot, 2);
|
551
|
+
|
552
|
+
rb_define_module_function(rb_mEulerF, "csin", __impl_eulerf_csin, 2);
|
553
|
+
rb_define_module_function(rb_mEulerF, "ccos", __impl_eulerf_ccos, 2);
|
554
|
+
rb_define_module_function(rb_mEulerF, "ctan", __impl_eulerf_ctan, 2);
|
555
|
+
rb_define_module_function(rb_mEulerF, "ccsc", __impl_eulerf_ccsc, 2);
|
556
|
+
rb_define_module_function(rb_mEulerF, "csec", __impl_eulerf_csec, 2);
|
557
|
+
rb_define_module_function(rb_mEulerF, "ccot", __impl_eulerf_ccot, 2);
|
558
|
+
|
559
|
+
rb_define_module_function(rb_mEulerF, "sinh", __impl_eulerf_sinh, 2);
|
560
|
+
rb_define_module_function(rb_mEulerF, "cosh", __impl_eulerf_cosh, 2);
|
561
|
+
rb_define_module_function(rb_mEulerF, "tanh", __impl_eulerf_tanh, 2);
|
562
|
+
rb_define_module_function(rb_mEulerF, "csch", __impl_eulerf_csch, 2);
|
563
|
+
rb_define_module_function(rb_mEulerF, "sech", __impl_eulerf_sech, 2);
|
564
|
+
rb_define_module_function(rb_mEulerF, "coth", __impl_eulerf_coth, 2);
|
565
|
+
|
566
|
+
rb_define_module_function(rb_mEulerF, "csinh", __impl_eulerf_csinh, 2);
|
567
|
+
rb_define_module_function(rb_mEulerF, "ccosh", __impl_eulerf_ccosh, 2);
|
568
|
+
rb_define_module_function(rb_mEulerF, "ctanh", __impl_eulerf_ctanh, 2);
|
569
|
+
rb_define_module_function(rb_mEulerF, "ccsch", __impl_eulerf_ccsch, 2);
|
570
|
+
rb_define_module_function(rb_mEulerF, "csech", __impl_eulerf_csech, 2);
|
571
|
+
rb_define_module_function(rb_mEulerF, "ccoth", __impl_eulerf_ccoth, 2);
|
572
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/******************************************************************************
|
2
|
+
exp.c -- Exponential Functions
|
3
|
+
|
4
|
+
Author: tribusonz
|
5
|
+
Lisence: 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
|
+
* Computes exponential function of +x+.
|
14
|
+
*
|
15
|
+
* @param x [Numeric] Numerical argument
|
16
|
+
* @param prec [Integer] Arbitrary precision
|
17
|
+
* @return [BigDecimal] Real solution
|
18
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
19
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
20
|
+
* @example
|
21
|
+
* BigMathR::EDF.exp(1, 20)
|
22
|
+
* #=> 0.27182818284590452354e1
|
23
|
+
* @since 0.1.0
|
24
|
+
*/
|
25
|
+
static VALUE
|
26
|
+
__impl_exp_edf(VALUE unused_obj, VALUE x, VALUE prec)
|
27
|
+
{
|
28
|
+
return exp_branch(x, prec, exp_edf);
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Computes binary exponent of +x+.
|
34
|
+
*
|
35
|
+
* @param x [Numeric] Numerical argument
|
36
|
+
* @param prec [Integer] Arbitrary precision
|
37
|
+
* @return [BigDecimal] Real solution
|
38
|
+
* @raise [ArgumentError] Occurs when +prec+ is not a positive integer.
|
39
|
+
* @raise [TypeError] Occurs when +x+ is not a numeric class.
|
40
|
+
* @example
|
41
|
+
* BigMathR::EDF.exp2(1/2r, 20)
|
42
|
+
* #=> 0.14142135623730950488e1
|
43
|
+
* @since 0.1.0
|
44
|
+
*/
|
45
|
+
static VALUE
|
46
|
+
__impl_exp2_edf(VALUE unused_obj, VALUE x, VALUE prec)
|
47
|
+
{
|
48
|
+
return exp2_branch(x, prec, exp2_edf);
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Document-module: BigMathR::Exp
|
54
|
+
*
|
55
|
+
* A module that treats the exponential functions.
|
56
|
+
* It is used internally.
|
57
|
+
* <br>
|
58
|
+
* This formula was discovered by the author shortly afterwards. It will be proven in time.
|
59
|
+
* <br>
|
60
|
+
* == Synopsis:
|
61
|
+
* The function names defined are the same as those in the C/C++ standard.
|
62
|
+
* <br>
|
63
|
+
* Exponential function: +exp()+ <br>
|
64
|
+
* Base-2 (binary) exponent: +exp2()+ <br>
|
65
|
+
*
|
66
|
+
*/
|
67
|
+
void
|
68
|
+
InitVM_Exp(void)
|
69
|
+
{
|
70
|
+
rb_define_module_function(rb_mExp, "exp_edf", __impl_exp_edf, 2);
|
71
|
+
rb_define_module_function(rb_mExp, "exp2_edf", __impl_exp2_edf, 2);
|
72
|
+
}
|