num4equ 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/ext/num4equ/CNum4Equ.c +4 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9999f0550bf5719b1f533abe772b711527b6ca26608f910fc53866944eea78e
|
4
|
+
data.tar.gz: 1e898d1910107d1b81ea430ed79bdc92874413ce0320a992873bcc1c63d23f42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71701934716dc8bd1ab3952a226cb00741fd9a335a7030328747bda8dc981b1a891a388d693a89fa72a4421b44e6446472a0ecc99bdb995576504819e9eaa955
|
7
|
+
data.tar.gz: 548a45584072da76972d4e964df7cd46b58e371c53106a978aa449abc29372552a46f726c3f1aac6016bb1df1837dcb4c98ea0a7dc97c677ae259de63ad8fe32
|
data/CHANGELOG.md
CHANGED
data/ext/num4equ/CNum4Equ.c
CHANGED
@@ -56,12 +56,13 @@ static double CNum4Equ_doNewtonMethodFFI(double a, Func func, int *ok)
|
|
56
56
|
do {
|
57
57
|
double fx;
|
58
58
|
double fxh;
|
59
|
-
double df;
|
60
59
|
|
60
|
+
// xn_1 = xn - f(x)/f'(x)
|
61
|
+
// f'(x) = lim (f(x + h) - f(x)) / h
|
62
|
+
// h -> 0
|
61
63
|
fx = func(xn);
|
62
64
|
fxh = func(xn + DX);
|
63
|
-
|
64
|
-
xn_1 = xn + -1 * fx / df;
|
65
|
+
xn_1 = xn + -1 * DX * fx / (fxh - fx);
|
65
66
|
if (fabs(xn_1 - xn) < EPS) break;
|
66
67
|
xn = xn_1;
|
67
68
|
idx++;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: num4equ
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- siranovel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi-compiler
|
@@ -69,7 +69,7 @@ licenses:
|
|
69
69
|
- MIT
|
70
70
|
metadata:
|
71
71
|
changelog_uri: http://github.com/siranovel/num4equation/blob/main/CHANGELOG.md
|
72
|
-
documentation_uri: https://rubydoc.info/gems/num4equ/0.1.
|
72
|
+
documentation_uri: https://rubydoc.info/gems/num4equ/0.1.2
|
73
73
|
homepage_uri: http://github.com/siranovel/num4equation
|
74
74
|
wiki_uri: https://github.com/siranovel/mydocs/tree/main/num4equation
|
75
75
|
post_install_message:
|