Skip to content

[math] Add test and improve doxygen of finite difference methods#22823

Open
hageboeck wants to merge 5 commits into
root-project:masterfrom
hageboeck:tmath_fixes
Open

[math] Add test and improve doxygen of finite difference methods#22823
hageboeck wants to merge 5 commits into
root-project:masterfrom
hageboeck:tmath_fixes

Conversation

@hageboeck

@hageboeck hageboeck commented Jul 15, 2026

Copy link
Copy Markdown
Member

Note: Contains commits of #22809.

@github-actions

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 10h 22m 19s ⏱️
 3 874 tests  3 874 ✅ 0 💤 0 ❌
75 321 runs  75 321 ✅ 0 💤 0 ❌

Results for commit 2ba8357.

@ferdymercury ferdymercury left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!
I'd suggest

  • adding in the RelNotes of 6.38.x and 6.40.2 that using Laplacian lead to incorrect results.
  • fix preexisting TMathTests to not exit 0 and multiply by four refvalues

dpiparo and others added 3 commits July 16, 2026 13:53
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
Use a polynomial and its known derivatives to check the correctness of
the finite difference methods.
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.
@hageboeck hageboeck added the clean build Ask CI to do non-incremental build on PR label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖AI-Assisted clean build Ask CI to do non-incremental build on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants