[6.40] [math] Add test and improve doxygen of finite difference methods#22840
Merged
dpiparo merged 5 commits intoJul 18, 2026
Merged
Conversation
(cherry picked from commit 2cebd26)
The standard second-order central, backward and forward differences contained a mistake: a factor-of-4 error. See finite different coefficients here: https://en.wikipedia.org/wiki/Finite_difference_coefficient (cherry picked from commit 99c7a96)
Use a polynomial and its known derivatives to check the correctness of the finite difference methods. (cherry picked from commit 9851599)
(cherry picked from commit f715d64)
The test failed without any consequences because it was always returning 0. Other "tests" in this file will need to be updated to check their outputs in the future. Furthermore: - The second derivatives are unstable with short, so remove it from the test. - The targets for the second derivatives were wrong by a factor 4; fix. - Due to rounding, finite differences on integers don't exactly hit the target. Allow a delta of 1. (cherry picked from commit f3d03cb)
1 task
Test Results 22 files 22 suites 3d 15h 24m 0s ⏱️ Results for commit a068d3a. |
dpiparo
merged commit Jul 18, 2026
7397997
into
root-project:v6-40-00-patches
33 of 34 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #22823, requested by @hageboeck.