Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finite_difference_derivative with 6th Order calc coeff error value #926

Open
Swordhalo opened this issue Jul 3, 2024 · 0 comments
Open

Comments

@Swordhalo
Copy link

Version: 1.85.0
file path: boost\math\differentiation\finite_difference.hpp

In function: finite_difference_derivative with 6th Order, calc step h by :

// Error: h^6f^(7)(x)/140 + 5|f(x)|eps/h
      Real h = pow(eps / 168, static_cast<Real>(1) / static_cast<Real>(7));

The coeff number 168 was wrong acrooding to the comment expression below. The Number 168 seems to be calc by 1406/5, which the correct coeff should be 1405/6 = 350/3.
Besides, it should be eps * Coeff instead of eps / 168.
The final expression of step h should be like:

Real h = pow(eps * 350 / 3 , static_cast<Real>(1) / static_cast<Real>(7));

And, every comment about ’eps^2/3, eps^4/5, eps^6/7' were not used in the code, which also attentioned in the website document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant