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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f4d45a4303869d3bc6c7a47da7dddf6cc67f47e6de2f96be6d0e04a2f0fefd0
4
- data.tar.gz: 4c4cc2f0c5c88d016826d5575df652ce113a7c934bf693332eac4e5d8d8a43fa
3
+ metadata.gz: c9999f0550bf5719b1f533abe772b711527b6ca26608f910fc53866944eea78e
4
+ data.tar.gz: 1e898d1910107d1b81ea430ed79bdc92874413ce0320a992873bcc1c63d23f42
5
5
  SHA512:
6
- metadata.gz: d897598486152d6fba6a732d36a4d4b725fe99b78b2720c12c43e0bf39d8f0c0e0db2825068c6a2a4c91490f806596279b2b429e3d2e267fe9dd87ee1bf6d498
7
- data.tar.gz: 19c36fde2ef67d634e5bb6c206a94b589ca302cc0d3ddafb3fefea902dac03a0e326b3005b702f6a65fa4e016c26c0a668e2a5fdba627822cb3c1b6a80f2209d
6
+ metadata.gz: 71701934716dc8bd1ab3952a226cb00741fd9a335a7030328747bda8dc981b1a891a388d693a89fa72a4421b44e6446472a0ecc99bdb995576504819e9eaa955
7
+ data.tar.gz: 548a45584072da76972d4e964df7cd46b58e371c53106a978aa449abc29372552a46f726c3f1aac6016bb1df1837dcb4c98ea0a7dc97c677ae259de63ad8fe32
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.1.2] - 2023-05-28
6
+
7
+ ### fixed
8
+ - fix refactoring for newtonMethod
9
+
5
10
  ## [0.1.1] - 2023-05-20
6
11
 
7
12
  ### fixed
@@ -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
- df = (fxh - fx) / DX;
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.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-20 00:00:00.000000000 Z
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.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: