bigdecimal-math_r 0.2.5 → 0.2.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.
- checksums.yaml +4 -4
- data/changelog.md +33 -0
- data/ext/bigdecimal/math_r/const.c +0 -8
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acos/branch.h +1 -1
- data/ext/bigdecimal/math_r/internal/algo/bigmath/acsc/branch.h +1 -1
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/branch.h +1 -1
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/edom.h +1 -2
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asech/logrep.h +0 -1
- data/ext/bigdecimal/math_r/internal/algo/bigmath/asin/branch.h +1 -1
- data/ext/bigdecimal/math_r/internal/algo/bigmath/atanh/branch.h +1 -1
- data/ext/bigdecimal/math_r/internal/algo/bigmath/rcm2/edf.h +3 -3
- data/ext/bigdecimal/math_r/solver.c +5 -1
- data/lib/bigdecimal/math_r/version.rb +1 -1
- metadata +1 -2
- data/lib/bigdecimal/math_r.so +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9afea6caf50f7f5fb373b89cbb3014c57cfd14377db98462b681dbfe27e288d6
|
4
|
+
data.tar.gz: 27f3ebfbdf90fbce30895a10be0b34318be3f0e2eae23b66aaf14851e7fc6973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b0492824d423b2673ff0c6faa70bb443ea92086b88b63a6791e02412e52e1cb6f6075815025724ad029d13da86ca85509bbeb8596694ae5c6c46093cc6f309f
|
7
|
+
data.tar.gz: 3916b4ad816aa0736561e22f9d56c522d07d97b5ebc089021254fd7dd40c8edc71a55f9a19784cf78be3d719ad8f3512d2546d79752da3100fb53287a5d1f059
|
data/changelog.md
CHANGED
@@ -7,6 +7,39 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.2.7] - 2025-10-XX
|
11
|
+
|
12
|
+
### Fix
|
13
|
+
- rcm2_edf(): Ignore Increase/Declease for exponent
|
14
|
+
|
15
|
+
### Added
|
16
|
+
- BigMathR#EulerGamma
|
17
|
+
- BigMathR::Const::EulerGamma#borwein_bailey
|
18
|
+
|
19
|
+
## [0.2.6] - 2025-10-XX
|
20
|
+
|
21
|
+
### Fix
|
22
|
+
- A some function's branch-cut set open-ended range
|
23
|
+
- BigMathR#asech invalid soltion
|
24
|
+
- `solver_triginv()` and `solver_hyperbinv` an error occurs when the value is a Complex with an imaginary part of 0.
|
25
|
+
- rcm2_edf(): type conversion error
|
26
|
+
|
27
|
+
## [0.2.5] - 2025-10-XX
|
28
|
+
|
29
|
+
### Fix
|
30
|
+
- Change require `./math_r.so` to `math_r`
|
31
|
+
|
32
|
+
## [0.2.4] - 2025-10-XX
|
33
|
+
|
34
|
+
### Fix
|
35
|
+
- Delete `BigMathR.EulerGamma`
|
36
|
+
- Delete `BigMathR::Const::EulerGamma#borwein_bailey`
|
37
|
+
|
38
|
+
## [0.2.3] - 2025-10-XX
|
39
|
+
|
40
|
+
### Fix
|
41
|
+
- unload `math_r.so`.
|
42
|
+
|
10
43
|
## [0.2.2] - 2025-10-XX
|
11
44
|
|
12
45
|
### Changed
|
@@ -54,7 +54,6 @@ __impl_const_e(VALUE unused_obj, VALUE prec)
|
|
54
54
|
return rb_bigmath_const_e(prec);
|
55
55
|
}
|
56
56
|
|
57
|
-
#if 0
|
58
57
|
/**
|
59
58
|
* The Euler-Mascheroni constant gamma.
|
60
59
|
* @example
|
@@ -69,7 +68,6 @@ __impl_const_euler_gamma(VALUE unused_obj, VALUE prec)
|
|
69
68
|
{
|
70
69
|
return rb_bigmath_const_euler_gamma(prec);
|
71
70
|
}
|
72
|
-
#endif
|
73
71
|
|
74
72
|
/**
|
75
73
|
* The natural logarithm of 2.
|
@@ -165,7 +163,6 @@ __impl_const_e_napier(VALUE unused_obj, VALUE prec)
|
|
165
163
|
return E_napier(prec);
|
166
164
|
}
|
167
165
|
|
168
|
-
#if 0
|
169
166
|
/**
|
170
167
|
* Implement by Borwein-Bailey's formula (Brent-McMillan type formula)
|
171
168
|
*
|
@@ -182,7 +179,6 @@ __impl_const_euler_gamma_borwein_bailey(VALUE unused_obj, VALUE prec)
|
|
182
179
|
{
|
183
180
|
return EulerGamma_borwein_bailey(prec);
|
184
181
|
}
|
185
|
-
#endif
|
186
182
|
|
187
183
|
/**
|
188
184
|
* Implement by BBP's formula (Borwein and Bailey 2002)
|
@@ -208,9 +204,7 @@ InitVM_Const(void)
|
|
208
204
|
{
|
209
205
|
rb_define_module_function(rb_mBigMathR, "PI", __impl_const_pi, 1);
|
210
206
|
rb_define_module_function(rb_mBigMathR, "E", __impl_const_e, 1);
|
211
|
-
#if 0
|
212
207
|
rb_define_module_function(rb_mBigMathR, "EulerGamma", __impl_const_euler_gamma, 1);
|
213
|
-
#endif
|
214
208
|
rb_define_module_function(rb_mBigMathR, "LOG2", __impl_const_log2, 1);
|
215
209
|
rb_define_module_function(rb_mBigMathR, "LOG_PI", __impl_const_log_pi, 1);
|
216
210
|
rb_define_module_function(rb_mBigMathR, "LOG10", __impl_const_log10, 1);
|
@@ -220,12 +214,10 @@ InitVM_Const(void)
|
|
220
214
|
rb_define_module_function(rb_mConstPI, "machin", __impl_const_pi_machin, 1);
|
221
215
|
rb_define_module_function(rb_mConstE, "napier", __impl_const_e_napier, 1);
|
222
216
|
rb_define_module_function(rb_mConstE, "euler_number", __impl_const_e_napier, 1);
|
223
|
-
#if 0
|
224
217
|
rb_define_module_function(rb_mConstEulerGamma, "borwein_bailey",
|
225
218
|
__impl_const_euler_gamma_borwein_bailey, 1);
|
226
219
|
rb_define_module_function(rb_mConstEulerGamma, "brent_mcmillan",
|
227
220
|
__impl_const_euler_gamma_borwein_bailey, 1);
|
228
|
-
#endif
|
229
221
|
rb_define_module_function(rb_mConstLOG2, "bbp2002", __impl_const_log2_bbp2002, 1);
|
230
222
|
}
|
231
223
|
|
@@ -4,7 +4,7 @@ acos_branch(VALUE x, VALUE prec, bigmath_func1 acos_cb)
|
|
4
4
|
const ID leq = rb_intern("<=");
|
5
5
|
VALUE y = Qundef;
|
6
6
|
VALUE p001 = rb_BigDecimal1(rb_str_new_cstr("0.001"));
|
7
|
-
VALUE domain = rb_range_new(INT2FIX(0), INT2FIX(1),
|
7
|
+
VALUE domain = rb_range_new(INT2FIX(0), INT2FIX(1), false);
|
8
8
|
|
9
9
|
x = rb_num_canonicalize(x, prec, ARG_REAL, ARG_RAWVALUE);
|
10
10
|
|
@@ -3,7 +3,7 @@ acsc_branch(VALUE x, VALUE prec, bigmath_func1 acsc_cb)
|
|
3
3
|
{
|
4
4
|
VALUE y = Qundef;
|
5
5
|
VALUE p_domain = rb_range_new(INT2FIX(1), DBL2NUM(HUGE_VAL), false);
|
6
|
-
VALUE m_domain = rb_range_new(DBL2NUM(-HUGE_VAL), INT2FIX(-1),
|
6
|
+
VALUE m_domain = rb_range_new(DBL2NUM(-HUGE_VAL), INT2FIX(-1), false);
|
7
7
|
|
8
8
|
x = rb_num_canonicalize(x, prec, ARG_REAL, ARG_RAWVALUE);
|
9
9
|
|
@@ -11,13 +11,12 @@ asech_edom(VALUE x, VALUE prec)
|
|
11
11
|
sqr = rb_funcall1(
|
12
12
|
rb_funcall1(BIG_ONE, '-', absx), '/',
|
13
13
|
rb_funcall1(absx, '+', BIG_ONE));
|
14
|
-
w = rb_Complex(BIG_ZERO, rb_bigmath_sqrt(sqr, n));
|
14
|
+
w = rb_Complex(BIG_ZERO, rb_bigmath_sqrt(rb_num_uminus(sqr), n));
|
15
15
|
w = rb_funcall1(w, '*', rb_funcall1(recip_x, '+', BIG_ONE));
|
16
16
|
w = rb_funcall1(w, '+', recip_x);
|
17
17
|
y = rb_bigmath_carg(w, n);
|
18
18
|
if (rb_num_negative_p(x))
|
19
19
|
y =rb_funcall1(rb_bigmath_const_pi(n), '-', y);
|
20
20
|
y = rb_Complex(BIG_ZERO, y);
|
21
|
-
|
22
21
|
return rb_num_round(y, prec);
|
23
22
|
}
|
@@ -4,7 +4,7 @@ asin_branch(VALUE x, VALUE prec, bigmath_func1 asin_cb)
|
|
4
4
|
const ID leq = rb_intern("<=");
|
5
5
|
VALUE y = Qundef;
|
6
6
|
VALUE p001 = rb_BigDecimal1(rb_str_new_cstr("0.001"));
|
7
|
-
VALUE domain = rb_range_new(INT2FIX(-1), INT2FIX(1),
|
7
|
+
VALUE domain = rb_range_new(INT2FIX(-1), INT2FIX(1), false);
|
8
8
|
|
9
9
|
x = rb_num_canonicalize(x, prec, ARG_REAL, ARG_RAWVALUE);
|
10
10
|
|
@@ -4,7 +4,7 @@ atanh_branch(VALUE x, VALUE prec, bigmath_func1 atanh_cb)
|
|
4
4
|
const ID leq = rb_intern("<=");
|
5
5
|
VALUE y = Qundef;
|
6
6
|
VALUE p0999 = rb_BigDecimal1(rb_str_new_cstr("0.999"));
|
7
|
-
VALUE domain = rb_range_new(INT2FIX(-1), INT2FIX(1),
|
7
|
+
VALUE domain = rb_range_new(INT2FIX(-1), INT2FIX(1), false);
|
8
8
|
|
9
9
|
x = rb_num_canonicalize(x, prec, ARG_REAL, ARG_RAWVALUE);
|
10
10
|
|
@@ -19,7 +19,7 @@ rcm2_edf(VALUE x, VALUE *reso)
|
|
19
19
|
while (RTEST(rb_num_coerce_cmp(INT2FIX(2), fra, rb_intern("<="))))
|
20
20
|
{
|
21
21
|
fra = rb_funcall1(fra, '/', rat_two);
|
22
|
-
TYPE(resov) == T_FIXNUM ?
|
22
|
+
resov = TYPE(resov) == T_FIXNUM ?
|
23
23
|
LONG2FIX(FIX2LONG(resov) + 1) :
|
24
24
|
rb_funcall(resov, succ, 0);
|
25
25
|
}
|
@@ -29,14 +29,14 @@ rcm2_edf(VALUE x, VALUE *reso)
|
|
29
29
|
while (RTEST(rb_num_coerce_cmp(INT2FIX(1), fra, '>')))
|
30
30
|
{
|
31
31
|
fra = rb_funcall1(fra, '*', rat_two);
|
32
|
-
TYPE(resov) == T_FIXNUM ?
|
32
|
+
resov = TYPE(resov) == T_FIXNUM ?
|
33
33
|
LONG2FIX(FIX2LONG(resov) - 1) :
|
34
34
|
rb_funcall(resov, pred, 0);
|
35
35
|
}
|
36
36
|
}
|
37
37
|
if (has_sign)
|
38
38
|
fra = rb_num_uminus(fra);
|
39
|
-
*reso =
|
39
|
+
*reso = resov;
|
40
40
|
}
|
41
41
|
return fra;
|
42
42
|
}
|
@@ -864,6 +864,8 @@ solver_triginv(ID func, VALUE z, VALUE prec)
|
|
864
864
|
{
|
865
865
|
if (rb_num_real_p(z) || rb_num_zero_p(rb_num_imag(z)))
|
866
866
|
{
|
867
|
+
if (RB_TYPE_P(z, T_COMPLEX))
|
868
|
+
z = rb_num_real(z);
|
867
869
|
if (func == mf_asin)
|
868
870
|
{
|
869
871
|
VALUE domain = rb_range_new(INT2FIX(-1), INT2FIX(1), 0);
|
@@ -1113,6 +1115,8 @@ solver_hyperbinv(ID func, VALUE z, VALUE prec)
|
|
1113
1115
|
{
|
1114
1116
|
if (rb_num_real_p(z) || rb_num_zero_p(rb_num_imag(z)))
|
1115
1117
|
{
|
1118
|
+
if (RB_TYPE_P(z, T_COMPLEX))
|
1119
|
+
z = rb_num_real(z);
|
1116
1120
|
if (func == mf_asinh)
|
1117
1121
|
{
|
1118
1122
|
w = asinh_branch(z, prec, cb_asinh);
|
@@ -1152,7 +1156,7 @@ solver_hyperbinv(ID func, VALUE z, VALUE prec)
|
|
1152
1156
|
w = asech_branch(z, prec, cb_asech);
|
1153
1157
|
else if (rb_num_domain_p(m_domain, z))
|
1154
1158
|
{
|
1155
|
-
w = asech_branch(z, prec, cb_asech);
|
1159
|
+
w = asech_branch(rb_num_uminus(z), prec, cb_asech);
|
1156
1160
|
w = rb_Complex(w, rb_bigmath_const_pi(prec));
|
1157
1161
|
}
|
1158
1162
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigdecimal-math_r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tribusonz-2
|
@@ -366,7 +366,6 @@ files:
|
|
366
366
|
- ext/bigdecimal/math_r/solver.c
|
367
367
|
- ext/bigdecimal/math_r/trig.c
|
368
368
|
- lib/bigdecimal/math_r.rb
|
369
|
-
- lib/bigdecimal/math_r.so
|
370
369
|
- lib/bigdecimal/math_r/const/E_euler.rb
|
371
370
|
- lib/bigdecimal/math_r/const/EulerGamma_engel.rb
|
372
371
|
- lib/bigdecimal/math_r/const/LOG2_bbp2007.rb
|
data/lib/bigdecimal/math_r.so
DELETED
Binary file
|