Skip to content

[6.42] Fix precision of eta at negative z in GenVector - #24262

Open
root-project-bot wants to merge 2 commits into
root-project:v6-42-00-patchesfrom
root-project-bot:BP_6.42_pull_24233
Open

root-project-bot wants to merge 2 commits into
root-project:v6-42-00-patchesfrom
root-project-bot:BP_6.42_pull_24233

Conversation

@root-project-bot

Copy link
Copy Markdown

Backport of #24233, requested by @guitargeek. For your information @felicepantaleo

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)
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Test Results

    21 files      21 suites   3d 12h 17m 42s ⏱️
 3 892 tests  3 891 ✅ 0 💤 1 ❌
72 659 runs  72 658 ✅ 0 💤 1 ❌

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants