Skip to content

Commit

Permalink
Increase ulps and remove epsilon in approx_eq!
Browse files Browse the repository at this point in the history
  • Loading branch information
janw20 committed May 3, 2024
1 parent ca8dd1c commit 503c12c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pineappl_cli/src/export/applgrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn reconstruct_subgrid_params(grid: &Grid, order: usize, bin: usize) -> Result<S
.sorted_unstable_by(|a, b| a.total_cmp(b))
.dedup_by(|&a, &b| approx_eq!(f64, a, b, ulps = 128))
.collect_vec();

result.set_q2_bins(mu2_grid.len());
result.set_q2_min(*mu2_grid.first().unwrap());
result.set_q2_max(*mu2_grid.last().unwrap());
Expand All @@ -63,7 +63,7 @@ fn reconstruct_subgrid_params(grid: &Grid, order: usize, bin: usize) -> Result<S
// TODO: reconstruct the interpolation order. for now leave it as the default
// result.set_q2_order(...);
}

result.set_x_bins(x_grid.len());
result.set_x_min(*x_grid.first().unwrap());
result.set_x_max(*x_grid.last().unwrap());
Expand Down Expand Up @@ -237,7 +237,7 @@ pub fn convert_into_applgrid(
.map(|&x1| {
appl_x1
.iter()
.position(|&x| approx_eq!(f64, x, x1, ulps = 128, epsilon = 1e-12))
.position(|&x| approx_eq!(f64, x, x1, ulps = 512))
.map_or_else(
|| {
Err(anyhow!(
Expand All @@ -254,7 +254,8 @@ pub fn convert_into_applgrid(
.map(|&x2| {
appl_x2
.iter()
.position(|&x| approx_eq!(f64, x, x2, ulps = 128, epsilon = 1e-12))
// .position(|&x| approx_eq!(f64, x, x2, ulps = 128, epsilon = 1e-12))
.position(|&x| approx_eq!(f64, x, x2, ulps = 512))
.map_or_else(
|| {
Err(anyhow!(
Expand Down

0 comments on commit 503c12c

Please sign in to comment.