Repository navigation
[6.42] Fix precision of eta at negative z in GenVector - #24262
Open
root-project-bot wants to merge 2 commits into
Open
root-project-bot wants to merge 2 commits into
root-project-bot wants to merge 2 commits into
Conversation
Eta_FromRhoZ computes log(zs + sqrt(zs^2 + 1)) with zs = z/rho. For zs < 0 the sum subtracts two nearly equal numbers. The error of eta is then about zs^2 times the rounding error of the scalar type. For large negative zs the function also drops the 0.5/zs term that it keeps for positive zs. For a float vector with rho = 50 and |z| = 340, eta(+z) = 2.61543298 and eta(-z) = -2.61543393. On 3e6 points with rho in [1, 300], |z| in (0, 600] and |z|/rho >= 1, the largest error against asinhl is 1.3 ULP (float) and 2.6 ULP (double) at z > 0, and 256 ULP (float) and 9.0e4 ULP (double) at z < 0. A cut on eta is then less stable against rounding in one half of a detector than in the other half. Compute the formula for |zs| and apply the sign of zs to the result. Eta is then an odd function of z, bit for bit. The results at z > 0 do not change. The error at z < 0 is equal to the error at z > 0. (cherry picked from commit 7baf838)
Eta_FromRhoZ of GenVectorX is a copy of the function of GenVector and has the same loss of precision for z < 0. Compute the formula for |zs| and apply the sign of zs to the result, as in GenVector. (cherry picked from commit bd5a3e8)
root-project-bot
requested review from
bellenot,
guitargeek and
hageboeck
as code owners
November 19, 2026 22:06
2 tasks done
Test Results 21 files 21 suites 3d 12h 17m 42s ⏱️ For more details on these failures, see this check. Results for commit 59f40d2. ♻️ This comment has been updated with latest results. |
This branch has not been deployed
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 #24233, requested by @guitargeek. For your information @felicepantaleo