Skip to content

Problem with numerical accuracy in Grid::evolve and Grid::evolve_info #223

@cschwan

Description

@cschwan

This continues the observation from NNPDF/pineko#72 (comment):

There are in fact three values similar to each other in the imported grid:

  1. 0.0033523339485467950
  2. 0.0033523339485468126
  3. 0.0033523339485468304

What happens is that (1) is close (less than 64 ULPS) to (2), and (2) is close to (3), but (1) isn't close to (3). Mathematically speaking numerical equality with a tolerance interval isn't transitive. Because of that probably (1) and (2) are removed here

pineappl/pineappl/src/grid.rs

Lines 1808 to 1809 in f2152da

x1.sort_by(f64::total_cmp);
x1.dedup_by(|a, b| approx_eq!(f64, *a, *b, ulps = 64));

and (3) is the representative value chosen by Grid::evolve_info, but then Grid::evolve can't find (1) using the same tolerance, because the distance of (1) to (3) is up to two times the tolerance.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions