Improve expo analytical integral stability#21060
Improve expo analytical integral stability#21060hageboeck merged 3 commits intoroot-project:masterfrom
Conversation
|
This will clash with #20992. Should we close that one? |
Thanks for pointing this out. |
Let's move it here, so we can save a few CI runs. |
Test Results 22 files 22 suites 3d 7h 39m 51s ⏱️ Results for commit f9d6908. ♻️ This comment has been updated with latest results. |
|
The tests seem to fail because the commit from #20993 is not in here, but the tests rely on this behaviour. So maybe we should do the following:
@swetank18, what do you think? |
Thanks, that makes sense to me. |
f3dcfcc to
dcf9bb8
Compare
|
Hello, no problem! The total code changes look good, but could you squash the last three commits (the tests) into one? Alternatively, we can squash the entire work into one commit when we merge, but I think it's reasonable to have the code changes and the tests in separate commits. |
And in doing that, could you run |
dcf9bb8 to
e1aa462
Compare
I’ve squashed the test commits into a single commit, run git clang-format on the branch, and force-pushed the updated history. Please let me know if anything else should be adjusted. |
The test you implemented uses a numeric integrator from the gsl and this fails: It seems that the analytic integral didn't get used. |
e1aa462 to
f9d6908
Compare
Thanks for the detailed output. You're right — the test triggered the numeric GSL integrator instead of the analytic path. Since this behavior isn’t guaranteed to return NaN, I’ve removed the invalid-sigma test to avoid relying on fallback behavior. |
Fix analytical integral tests to use TF1::Integral Fix tests to use TF1::Integral instead of AnalyticalIntegral
For future reference, the reason why returning NaN from the analytic integral function doesn't work: For the Gaussian, for the same reasons, the numeric integrator is invoked, so the test wasn't supposed to work. |
Motivation
The analytical integral of exponential TF1 functions computes differences of
exponentials, which can suffer from numerical cancellation or overflow when the
integration bounds are close or the exponent is large.
Changes
expm1-based formulation
Impact