boostorg / boostorg/boost

finite_difference_derivative with 6th Order calc coeff error value

Open
#926 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
8.6k
Forks
1.9k
Avg merge
39m
Merged PRs (30d)
2

Description

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(1) / static_cast(7));
```
The coeff number 168 was wrong acrooding to the comment expression below. The Number 168 seems to be calc by 140*6/5, which the correct coeff should be 140*5/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(1) / static_cast(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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.