Skip to content

Commit

Permalink
improved pt distance precision with expm1 #168
Browse files Browse the repository at this point in the history
  • Loading branch information
jacanchaplais committed Nov 23, 2023
1 parent b133fdf commit cfe914f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graphicle/calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,4 +656,4 @@ def aggregate_momenta(

@nb.vectorize("float64(float64, float64)")
def _pt_distance(pt_1: float, pt_2: float) -> float:
return 1.0 - math.exp(-0.5 * pow((pt_1 - pt_2) / min(pt_1, pt_2), 2))
return -math.expm1(-0.5 * pow((pt_1 - pt_2) / min(pt_1, pt_2), 2))

0 comments on commit cfe914f

Please sign in to comment.